TL;DR
When teaching a small language model to mimic a larger one from a different family, their incompatible vocabularies make it impossible to directly compare their predictions. ByteDistill solves this by translating both models' token predictions into the universal language of raw UTF-8 bytes—allowing any teacher to distill rich, probability-level intuition into any student without forcing either model to abandon its native tokenizer.
What Problem Does This Paper Address?
Imagine trying to learn French from a tutor who slices sentences into completely different word fragments than you do. In knowledge distillation, we train a small "student" LLM to mimic the full probability distribution of next-word guesses from a large "teacher" LLM, which conveys far richer intuition than training on single text answers alone.
However, different model families (like Alibaba's Qwen and Google's Gemma) use different tokenizers—the dictionaries that chop text into subword pieces. One model might view playing as [play][ing], while another sees [playing]. Because their output vocabularies represent completely different text chunks at different moments in a sentence, you cannot directly compare their probability distributions. Existing workarounds try to learn clunky translation matrices, sort probabilities blindly, or only compare spots where tokens happen to match—leaving valuable teaching moments on the table.
Methods
What do [play][ing] and [playing] have in common? Underneath the hood, they decode to the exact same sequence of UTF-8 bytes (p-l-a-y-i-n-g). ByteDistill uses this universal 256-byte alphabet as a common meeting ground, keeping both models subword-based during actual operation and only dropping down to bytes to calculate the training loss.
The process, resulting in an objective called Byte-Level Distribution Alignment (BLDA), works in three steps:
- Linear-Time Chunking: A single-pass algorithm scans the teacher and student tokenizations of the same text, grouping overlapping tokens into shared substrings called "chunks."
- Prefix-Matched Byte Aggregation: At every byte position inside a chunk, each model looks at its own vocabulary probabilities for tokens matching the byte prefix seen so far, and sums them according to the next byte they would emit. For example, at the start of
playing, the probabilities forplay,plane, andpleaseall get summed into the bucket for bytep. - Handling Token Boundaries: What happens after
play, where the teacher finishes a token ([play]), while the student is still mid-token ([playing])? Instead of throwing away the teacher's probabilities for longer words likeplayerorplayful, ByteDistill blends two possibilities: continuing a longer candidate token, or endingplayand immediately predicting the first byte of the next token ([ing]).
Finally, the resulting 256-way byte distributions are compared using standard KL divergence—forward KL for fixed training datasets (off-policy), and reverse KL when learning from the student's own live attempts (on-policy).
Datasets
The authors do not introduce new benchmarks, relying instead on established datasets across three distinct regimes:
- Mathematical Reasoning (Off-policy): Trained on OpenMathInstruct-2 (1M examples for teacher tuning, 320K for student distillation) and evaluated zero-shot on GSM8K and MATH. They also test Chinese math reasoning using HighMATH (split into 3,399 training and 1,000 test problems).
- Low-Resource Summarization (Off-policy): DialogSum, restricting student distillation to a small 1,500-dialogue subset to test data efficiency.
- Arithmetic Game (On-policy): Countdown-Task-GOLD (30.4k train / 10k test), where models combine numbers using basic arithmetic to hit a target value.
Key Insights and Ideas
- It helps even when tokenizers almost match: In the on-policy Countdown task, ByteDistill improved a Qwen2.5 student learning from a Qwen3 teacher—even though their tokenizers have a 99.9% overlap! Why? Shifting the learning target from rigid "next-token identity" to "next-byte continuation" provides denser, finer-grained supervision inside tokens, not just at their boundaries.
- Long-horizon reasoning sticks better: When problems require long chains of thought (140+ words on GSM8K), ByteDistill retains 39.0% of the teacher's accuracy, compared to 35.0% for the best baseline and 29.2% for standard fine-tuning. Because ByteDistill doesn't skip mismatched token spans, the student gets uninterrupted guidance across long, complex derivations.
Key Results
- English & Chinese Math (Qwen3-8B $\rightarrow$ Gemma-2-2B): ByteDistill hits 49.27% average Pass@1 across GSM8K and MATH, beating standard Supervised Fine-Tuning (SFT) by +5.40 points and the strongest cross-tokenizer baseline (CTLS) by +1.78 points. Gains hold up on smaller students (MiniCPM4-0.5B), instruction-tuned students, and Chinese HighMATH (17.4% vs. 16.3% for the best baseline and 12.6% for SFT).
- Low-Resource Summarization: With just 1,500 examples on DialogSum, ByteDistill achieves 38.65 ROUGE-L, beating SFT by +5.21 points and slightly edging out the teacher itself (38.25).
- On-Policy Distillation: Across three students spanning near-identical (0.999), moderate (0.640), and severe (0.063) tokenizer overlap with a Qwen3-4B teacher, ByteDistill beats both SFT initialization and competing online methods (GOLD, DSKDv2) across the board—with its biggest lead (+1.74 points over GOLD) on Llama-3.2-1B where tokenizer mismatch is moderate.
Limitations and Future Work
- Blind to Control Tokens: Because structural tokens like
<EOS>or chat-template markers don't map to shared text bytes, BLDA ignores them—relying on standard SFT losses or initialization to teach the student when to stop talking. - Single-Path Approximation: When closing token boundaries, ByteDistill only follows the single tokenization path actually observed in the text, rather than summing over every mathematically possible way the tokenizer could have sliced that string.
- Unoptimized Speed & Untested Domains: The GPU byte-aggregation code lacks custom fused kernels or caching, and the speed-vs.-accuracy trade-offs haven't been benchmarked yet. Future work remains to test ByteDistill on code generation, longer on-policy runs, and scripts with heavy byte-fallback (like Santhali and Shan).
Summary updated