From Where Words Come: Efficient Regularization of Code Tokenizers Through Source Attribution

Pavel Chizhov, Egor Bogomolov, Ivan P. Yamshchikov
4/15/2026
cs.CL

No official code found. Best implementation: pchizhov/sa-bpe (1 star, Apache-2.0, last commit 2026-04-16).

Abstract

Efficiency and safety of Large Language Models (LLMs), among other factors, rely on the quality of tokenization. A good tokenizer not only improves inference speed and language understanding but also provides extra defense against jailbreak attacks and lowers the risk of hallucinations. In this work, we investigate the efficiency of code tokenization, in particular from the perspective of data source diversity. We demonstrate that code tokenizers are prone to producing unused, and thus under-trained, tokens due to the imbalance in repository and language diversity in the training data, as well as the dominance of source-specific, repetitive tokens that are often unusable in future inference. By modifying the BPE objective and introducing merge skipping, we implement different techniques under the name Source-Attributed BPE (SA-BPE) to regularize BPE training and minimize overfitting, thereby substantially reducing the number of under-trained tokens while maintaining the same inference procedure as with regular BPE. This provides an effective tool suitable for production use.

View on arXivView PDF

Code Implementations(1)

pchizhov/sa-bpeCommunity70%
Apache-2.0

Source-Attributed BPE implementation for the paper "From Where Words Come: Efficient Regularization of Code Tokenizers Through Source Attribution" (ACL 2026)

10Apr 11, 20266 months agoApache-2.0

Similar Papers

Cite this paper

@article{chizhov2026from,
  title  = {From Where Words Come: Efficient Regularization of Code Tokenizers Through Source Attribution},
  author = {Pavel Chizhov and Egor Bogomolov and Ivan P. Yamshchikov},
  year   = {2026},
  eprint = {2604.14053},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.14053v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.14053.svg)](https://codeofpaper.com/paper/2604.14053)

Discussion