Abstract
Modern language models (LMs) are traditionally viewed as being constrained by their deterministic subword tokenization. This paper challenges that assumption, demonstrating that instruction-tuned models possess a latent ability to process text segmented in non-canonical ways. By evaluating major model families across diverse benchmarks, we show that strategically selecting alternative tokenizations at inference time can significantly improve performance in tasks requiring orthographic or structural awareness, such as arithmetic and code understanding.
Introduction
Most Large Language Models rely on subword tokenization methods like Byte-Pair Encoding (BPE) to map text into a fixed sequence of vocabulary IDs. This process is typically deterministic; a word like "strawberry" is always decomposed into the same specific sub-tokens. Conventional wisdom suggests that LMs are "slaves" to this tokenizer, as the internal character structure of a subword is often obscured once it is converted into an ID. This limitation is frequently cited as the reason models struggle with character-level tasks or multi-digit arithmetic.
However, this research reveals that LMs are surprisingly robust to "broken" tokens—alternative segmentations of the same string using the model's existing vocabulary. Not only can models maintain performance under these conditions, but non-canonical tokenization can be leveraged as an inference-time intervention to boost accuracy by up to 33%.
Methodology
The study investigates two primary forms of non-canonical tokenization:
- Random Tokenization: Utilizing a recursive algorithm similar to BPE-dropout, canonical tokens are split into smaller, valid sub-tokens from the vocabulary at random.
- Character-level Tokenization: Text is forced into a sequence of individual character tokens, providing the most granular representation possible.
The researchers evaluated three prominent model families—Qwen-2.5-7B, Llama-3.1-8B, and OLMo-2-7B—across 20 benchmarks. These included standard Multiple Choice (MC) and Short Answer (SA) tasks, alongside four new targeted tasks designed to test orthographic awareness: character counting, acronym generation, codeline description, and 10-digit arithmetic.
The Role of Instruction Tuning
A pivotal finding of this research is the disparity between base models and instruction-tuned (SFT) models. Base models, which function as "document completers," often fail when presented with non-canonical tokens, producing gibberish. This is not due to a lack of understanding, but rather a tendency to mimic the "style" of the input; if the input appears misspelled or strangely formatted, the model mimics that perceived error in its output.
In contrast, instruction-tuned models are trained to be helpful and fluent regardless of input style. The use of chat templates (e.g., <|user|> and <|assistant|> tags) acts as a crucial signal, allowing the model to decouple the input's tokenization style from its own response generation. This "unlocks" the model's latent ability to process fragmented tokens correctly.
Key Results and Performance Gains
The experiments yielded several significant insights:
- Robustness: Qwen-2.5-7B-Instruct retained 93.4% of its canonical performance when subjected to random tokenizations and 90.8% with character-level tokens.
- Code Understanding: By switching to character-level tokenization at inference time, Llama-3.1-Instruct achieved a +14.3% improvement in describing complex code snippets.
- Arithmetic Breakthrough: The most dramatic improvement occurred in 10-digit arithmetic. By forcing the model to see numbers in "right-aligned" digit groups (mimicking how humans use commas), performance improved by +33.7% without any additional fine-tuning.
- Scaling Robustness: A clear correlation was observed: models with higher base accuracy generally exhibited greater resilience to non-canonical tokenization.
Discussion and Limitations
While the results are promising, the study notes that performance generally declines as the "length ratio" increases—i.e., as the tokenization becomes more granular and the sequence length grows. Processing more tokens for the same string increases the computational load and the risk of the model losing context.
Future research directions include the development of dynamic tokenization algorithms that can automatically determine the optimal segmentation for a specific prompt at inference time. Additionally, there is significant potential in exploring whether explicitly incorporating non-canonical tokens during the pretraining phase could further enhance model robustness and reasoning capabilities.
Conclusion
This paper demonstrates that the "tokenization bottleneck" is less rigid than previously thought. Instruction-tuned LMs possess a secret capacity to handle diverse text segmentations, offering a new frontier for improving model performance through inference-time interventions rather than costly retraining.
Summary updated