Word Recovery in Large Language Models Enables Character-Level Tokenization Robustness
Organizations: Mohamed bin Zayed University of Artificial Intelligence (MBZUAI) · Provable Responsible AI and Data Analytics (PRADA) Lab · King Abdullah University of Science and Technology
Abstract
Large language models (LLMs) trained with canonical tokenization exhibit surprising robustness to non-canonical inputs such as character-level tokenization, yet the mechanisms underlying this robustness remain unclear. We study this phenomenon through mechanistic interpretability and identify a core process we term word recovery. We first introduce a decoding-based method to detect word recovery, showing that hidden states reconstruct canonical word-level token identities from character-level inputs. We then provide causal evidence by removing the corresponding subspace from hidden states, which consistently degrades downstream task performance. Finally, we conduct a fine-grained attention analysis and show that in-group attention among characters belonging to the same canonical token is critical for word recovery: masking such attention in early layers substantially reduces both recovery scores and task performance. Together, our findings provide a mechanistic explanation for tokenization robustness and identify word recovery as a key mechanism enabling LLMs to process character-level inputs.
Figures & tables
| Benchmark | Gemma-2-9B-It | Qwen2.5-7B-Instruct | Llama-3.2-3B-Instruct | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Canon | Char | Recovery | Canon | Char | Recovery | Canon | Char | Recovery | |
| ARC-E | 96.8 | 53.8 | 69.9 | ||||||
| ARC-C | 96.6 | 55.4 | 71.2 | ||||||
| CSQA | 96.4 | 51.1 | 55.9 | ||||||
| OpenbookQA | 95.7 | 51.6 | 58.6 | ||||||
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Length | 2 | 3 | 4 | 5+ |
|---|---|---|---|---|
| Gemma | 0.83 | 0.90 | 0.91 | 0.82 |
| Qwen | 0.86 | 0.76 | 0.63 | 0.39 |
| Llama | 0.89 | 0.83 | 0.75 | 0.72 |
| Model | Canon | Char |
|---|---|---|
| Qwen2.5-1.5B-Instruct | 89.6 | -24.5 |
| Qwen2.5-3B-Instruct | 92.3 | -6.70 |
| Qwen2.5-7B-Instruct | 95.6 | -2.30 |
| Gemma-2-2B-It | 87.0 | -33.7 |
| Gemma-2-9B-It | 96.8 | -3.50 |
| Mistral-7B-Instruct-v0.1 | 83.5 | -58.4 |
| Clean run | Masking (France) |
|---|---|
| “Paris”: 0.9997710586 | “Paris”: 0.1813361049 |
| “paris”: 9.157e-05 | “Rome”: 0.1692125201 |
| “Par”: 5.018e-05 | “Berlin”: 0.1167379990 |
| “París”: 3.708e-05 | “Madrid”: 0.0662391782 |
| “パリ” : 1.445e-05 | “Toronto”: 0.0468508899 |
| “Pari”: 9.783e-06 | “Re”: 0.0389084555 |
Language Model Robustness
Language model robustness studies how reliably language models preserve correct, safe behavior under input changes, distribution shifts, and adversarial pressure.
See all 471 papers