ByteDistill: Cross-Tokenizer Distillation via Chunk-wise Byte-Level Distribution Alignment

Yang Chen, Xianqi Yu, Shaowei Yao, Fuyu Lv, Dan Ou, TanghaihongNeurIPS 2026

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.

Figure 1: ByteDistill training pipeline. Teacher and student vocabulary distributions are mapped to 256-dimensional next-byte distributions and compared at matching byte positions within aligned chunks. Training uses fixed responses and forward KL off-policy, or student rollouts and reverse KL on-policy. Only the student is updated.

The process, resulting in an objective called Byte-Level Distribution Alignment (BLDA), works in three steps:

  1. 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."
Figure 2: Building aligned byte chunks. The Qwen3 (teacher) and Gemma2 (student) tokenizations of “state-of-the-art” have different boundaries. Grouping overlapping token spans produces four chunks C1, . . . , C4, each covering the same substring on both sides.
  1. 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 for play, plane, and please all get summed into the bucket for byte p.
  2. 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 like player or playful, ByteDistill blends two possibilities: continuing a longer candidate token, or ending play and immediately predicting the first byte of the next token ([ing]).
Byte-prefix tree showing how ByteDistill handles continuations vs. token-ending probability mass at "play".

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

Abstract

Teacher and student language models often use different tokenizers, so their next-token probabilities cannot be compared directly. ByteDistill expresses both predictions over the same 256 byte values. It groups overlapping teacher and student token spans into chunks covering the same text and, within each chunk, sums token probabilities according to the next UTF-8 byte. At an observed token boundary, the ending probability is assigned to the next token's byte distribution. Byte-Level Distribution Alignment (BLDA) then compares the resulting conditional byte distributions with KL divergence, preserving each model's tokenizer and token history. In off-policy distillation from Qwen3-8B to Gemma-2-2B, ByteDistill reaches 49.27% average Pass@1 on GSM8K and MATH, exceeding SFT by 5.40 points and CTLS by 1.78 points. It also achieves 38.65 ROUGE-L on DialogSum with 1,500 training examples and improves Countdown accuracy for all three students in on-policy distillation. The project repository is available at https://github.com/Piplup0924/ByteDistill.
BibTeX
@inproceedings{chen2026bytedistill,
  author = {Yang Chen and Xianqi Yu and SHAOWEI YAO and Fuyu Lv and Dan Ou and Tanghaihong},
  title = {{ByteDistill: Cross-Tokenizer Distillation via Chunk-wise Byte-Level Distribution Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=od5PZv55K2},
}
Figure