Exact Byte-Level Probabilities from Tokenized Language Models for FIM-Tasks and Model Ensembles
Buu Phan, Brandon Amos, Itai Gat, Marton Havasi, Matthew J. Muckley, Karen Ullrich
Abstract
Tokenization is associated with many poorly understood shortcomings in language models (LMs), yet remains an important component for long sequence scaling purposes. This work studies how tokenization impacts model performance by analyzing and comparing the stochastic behavior of tokenized models with their byte-level, or token-free, counterparts. We discover that, even when the two models are statistically equivalent, their predictive distributions over the next byte can be substantially different, a phenomenon we term as "tokenization bias". To fully characterize this phenomenon, we introduce the Byte-Token Representation Lemma, a framework that establishes a mapping between the learned token distribution and its equivalent byte-level distribution. From this result, we develop a next-byte sampling algorithm that eliminates tokenization bias without requiring further training or optimization. In other words, this enables zero-shot conversion of tokenized LMs into statistically equivalent token-free ones. We demonstrate its broad applicability with two use cases: fill-in-the-middle (FIM) tasks and model ensembles. In FIM tasks where input prompts may terminate midtoken, leading to out-of-distribution tokenization, our method mitigates performance degradation and achieves 18% improvement in FIM coding benchmarks, while consistently outperforming the standard token healing fix. For model ensembles where each model employs a distinct vocabulary, our approach enables seamless integration, resulting in improved performance up to 3.7% over individual models across various standard baselines in reasoning, knowledge, and coding. Code is available at: https://github.com/facebookresearch/Exact-Byte-Level- Probabilities-from-Tokenized-LMs.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
12 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Universal Cross-Tokenizer Distillation via Approximate Likelihood Matching cites MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers
- Universal Cross-Tokenizer Distillation via Approximate Likelihood Matching cites Knowledge Fusion of Large Language Models
- Sampling from Your Language Model One Byte at a Time cites Universal Cross-Tokenizer Distillation via Approximate Likelihood Matching
- Sampling from Your Language Model One Byte at a Time cites Language Models are Few-Shot Learners
- Sampling from Your Language Model One Byte at a Time cites The Curious Case of Neural Text Degeneration
- Broken Tokens? Your Language Model can Secretly Handle Non-Canonical Tokenizations cites Sampling from Your Language Model One Byte at a Time
- Broken Tokens? Your Language Model can Secretly Handle Non-Canonical Tokenizations cites MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers
- MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers cites Language Models are Few-Shot Learners
- Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
- Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Universal Cross-Tokenizer Distillation via Approximate Likelihood Matching
- Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers
- Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Language Models are Few-Shot Learners
- OmniDraft: A cross-vocabulary, online adaptive drafter for on-device speculative decoding cites Universal Cross-Tokenizer Distillation via Approximate Likelihood Matching
- Knowledge Fusion of Large Language Models cites LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusion
- Knowledge Fusion of Large Language Models cites Language Models are Few-Shot Learners
Cited by top-tier papers12
- Dynamic Chunking for End-to-End Hierarchical Sequence ModelingSukjun Hwang, Brandon Wang, Albert GuICLR 2026 · 76 citations
- Universal Cross-Tokenizer Distillation via Approximate Likelihood MatchingBenjamin Minixhofer, Ivan Vulic, Edoardo Maria PontiNeurIPS 2025 · 48 citations
- Broken Tokens? Your Language Model can Secretly Handle Non-Canonical TokenizationsBrian Siyuan Zheng, Alisa Liu, Orevaoghene Ahia, Jonathan Hayase et al.NeurIPS 2025 · 19 citations
- Sampling from Your Language Model One Byte at a TimeJonathan Hayase, Alisa Liu, Noah Smith, Sewoong OhICML 2026 · 9 citations
- OmniDraft: A cross-vocabulary, online adaptive drafter for on-device speculative decodingRamchalam Kinattinkara Ramakrishnan, Zhaocong Yuan, Jay Zhuo, Chen Feng et al.NeurIPS 2025 · 6 citations
Builds on13
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- MEGABYTE: Predicting Million-byte Sequences with Multiscale TransformersLili Yu, Daniel Simig, Colin Flaherty, Armen Aghajanyan et al.NeurIPS 2023 · 197 citations
- Knowledge Fusion of Large Language ModelsFanqi Wan, Xinting Huang, Deng Cai, Xiaojun Quan et al.ICLR 2024 · 113 citations
- LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative FusionDongfu Jiang, Xiang Ren, Bill Yuchen LinACL 2023 · 95 citations
Related papers
- ByteFlow: Language Modeling through Adaptive Byte Compression without a TokenizerChunyuan Deng, Sanket Lokegaonkar, Colin Lockard, Besnik Fetahu et al.ICLR 2026 · 1 citation
- SpaceByte: Towards Deleting Tokenization from Large Language ModelingKevin SlagleNeurIPS 2024 · 34 citations
- Byte Latent Transformer: Patches Scale Better Than TokensArtidoro Pagnoni, Ramakanth Pasunuru, Pedro Rodríguez, John Nguyen et al.ACL 2025 · 116 citations
- Zero-Shot Tokenizer TransferBenjamin Minixhofer, Edoardo Maria Ponti, Ivan VulicNeurIPS 2024 · 37 citations
- Scaffold-BPE: Enhancing Byte Pair Encoding for Large Language Models with Simple and Effective Scaffold Token RemovalHaoran Lian, Yizhe Xiong, Jianwei Niu, Shasha Mo et al.AAAI 2025
