BPM

Preprint · 2026

Cross-Tokenizer On-Policy Distillation via Byte-Prefix Marginalization

Hao Wang1,2, Kun Yuan†2, Wenlin Zhong2,3, Minglei Zhang2, Han Xiao4, Ming Sun2, Honggang Qi§1

1 University of Chinese Academy of Sciences 2 KwaiKAT Team, Kuaishou Technology 3 Zhejiang University 4 The Chinese University of Hong Kong Project lead   §Corresponding author
Exact 99% of positions (>99%) equal the teacher's exact byte-prefix marginal
Closed 43.9% of the teacher–student gap (best pair)
pass@8 60.9% six-benchmark avg on the best pair, +8.5 over its best baseline
Pairs 100% teacher pairs won (3/3), math and code

Abstract

Open-weight language models from different families exhibit complementary capabilities, motivating their consolidation into a compact student through on-policy distillation (OPD). However, full-vocabulary OPD typically assumes a shared tokenizer, while existing cross-tokenizer methods may discard teacher probability mass or assign it to student tokens with unrelated content. We introduce Byte-Prefix Marginalization (BPM), which re-expresses the teacher’s next-token distribution over the student vocabulary in a shared byte space. Specifically, BPM assigns each teacher token’s probability to the longest student token whose byte representation is a prefix of the teacher token’s bytes, aggregates mass mapped to the same student token, and places otherwise unmatched mass in an explicit residual category. This produces a vocabulary-complete, byte-aligned, and mass-preserving target for dense OPD. The target exactly recovers the teacher-induced byte-prefix marginal when the relevant prefix does not span multiple teacher tokens (a condition satisfied at more than 99% of training positions) and uses a mass-preserving, chain-factorized lower bound otherwise. Across Qwen3-32B, GLM-Z1-9B-0414, and MiniMax-M2.7 as teachers, BPM consistently outperforms current cross-tokenizer methods on six mathematics and programming benchmarks, improving six-benchmark avg@8 by 3.7–6.6 points over the strongest baselines.

BPM teaser: routing teacher probability mass into the student vocabulary through shared bytes

Tokens are dialects.
Bytes are the common tongue.

BPM routes the teacher's probability through the byte stream both models share — supervision survives the change of vocabulary.

Contributions

Key Contributions

Full-Vocabulary, Identity-Preserving Target

Every unit of teacher probability is routed by bytes or parked in an explicit residual — exact on 99%+ of positions, mass conserved.

Wins on Every Pair

Beats overlap, rank, hybrid, and sequence-level baselines on all three teacher pairs — including contests held after every teacher's cutoff.

A Failure Mode of Byte-Exact Fidelity

Whitespace-only code rows transfer pure segmentation noise (49%→9% pass collapse); a precomputed row mask removes it.

Method

From Rollout to Target

01

Student-Owned On-Policy Rollouts

The student samples under its own template and decode settings — supervision lands where it acts.

02

Teacher Re-Scoring in Its Own Template

The same bytes, re-rendered in the teacher's template, scored into full-vocabulary distributions.

03

Byte-Prefix Marginalization

Teacher mass routes to the longest student token prefixing its bytes; the rest to an explicit residual.

04

β-Divergence Distillation

One β axis spans FKL / JSD / RKL against the projected target; a whitespace-row mask guards code.

Pipeline

Method Overview

BPM method overview showing student rollouts, teacher re-scoring, and byte-prefix probability routing
BPM pipeline: student rollouts → teacher re-scoring → byte-prefix routing → β-divergence distillation.

Method Insight

One Ribbon, Two Readings

Two tokenizers read the same bytes and cut them differently — in exactly four ways. Follow one strip of text through all four; hover a case to isolate it.

Precomputed Routing The byte-alignment table is built once per tokenizer pair, before training starts.
teacher bytes student 1:11:nn:1m:n·solve·therefore</think>·tokenizers·solve·therefore</think>·tokenizers↓ 1.00↘ longest prefix · rest next⊕ .70×.90×.95 = .60prefix + residual ∅ ·solve·therefore</think>·tokenizers

Benchmark Results

Results on Six Benchmarks

Student: Qwen3.5-2B (thinking mode). Cells are six-benchmark averages, avg@8 / pass@8 (%). P1 = Qwen3-32B (same family), P2 = GLM-Z1-9B, P3 = MiniMax-M2.7 (least overlap); span Jaccard 0.92 / 0.87 / 0.81. Subscripts denote BPM's margin over each pair's best baseline.

Method P1 · Qwen3-32B P2 · GLM-Z1-9B P3 · MiniMax-M2.7
avg@8 pass@8 avg@8 pass@8 avg@8 pass@8
Teacher 67.4%80.3% 63.0%76.7% 65.4%80.5%
Base Student 24.7%40.5% 24.7%40.5% 24.7%40.5%
SimCT 35.3%52.4% 26.3%45.0% 25.0%37.7%
ULD 25.1%41.4% 34.2%50.0% 32.8%48.0%
GOLD 29.7%47.3% 33.0%51.9% 27.5%42.5%
SeqKD 33.8%52.4% 34.9%53.9% 26.4%45.5%
BPM (Ours) 39.0%+3.760.9%+8.5 41.5%+6.659.4%+5.5 38.7%+5.957.1%+9.1
Tokenizer similarity spectrum of the three teacher-student pairs
Three pairs, one axis: tokenizer distance (span Jaccard 0.92 → 0.81)
Fraction of the teacher-student gap closed by BPM versus the strongest baselines
Gap closed: 33.5–43.9% (BPM) vs. 19.9–26.6% (best baselines)

Ablations

Ablation Study

Ablation 01 · Divergence

FKL > JSD > RKL on every pair — and the gap widens as tokenizers drift apart

Variant Math (3) Code (3) All (6)
avg@8pass@8 avg@8pass@8 avg@8pass@8
P1 · Qwen3-32B (teacher) 70.982.564.078.167.480.3
BPM-FKL 47.769.730.352.139.060.9
BPM-JSD 46.165.925.549.735.857.8
BPM-RKL 47.067.026.649.636.858.3
P2 · GLM-Z1-9B (teacher) 63.078.663.074.763.076.7
BPM-FKL 47.165.035.953.841.559.4
BPM-JSD 43.160.734.250.838.655.8
BPM-RKL 42.559.431.149.936.854.6
P3 · MiniMax-M2.7 (teacher) 72.587.158.273.965.480.5
BPM-FKL 41.960.635.453.638.757.1
BPM-JSD 43.759.123.848.833.854.0
BPM-RKL 38.559.818.641.728.550.7

Percent. Three-way spread: 3.2 (P1), 4.7 (P2), 10.2 (P3). FKL is β=0, JSD β=½, RKL β=1 at skew 0.1. Tinted rows are teachers.  Pre-collapse peak.

Ablation 02 · Data

Harder math and 1.78× more prompts leave the ranking intact

GLM-Z1-9B pair FKLJSDRKLAvg.
Original mix (20k)
avg@841.538.636.839.0
pass@859.455.854.656.6
Harder-math mix (20k)
avg@8 39.4−2.138.9+0.3 37.4+0.638.6−0.4
pass@8 57.1−2.357.0+1.2 55.1+0.556.4−0.2
Expanded corpus (35.5k)
avg@8 40.7−0.838.9+0.3 37.6+0.839.1+0.1
pass@8 58.4−1.058.3+2.5 53.9−0.756.9+0.3

Six-benchmark percent. Subscripts give the change from the original mix.

Ablation 03 · Whitespace mask

On all-whitespace rows, byte-exact fidelity turns toxic — and a mask removes it

Whitespace collapse on the GLM-Z1-9B pair and its removal by the precomputed whitespace-row mask
Unmasked whitespace rows drive code pass rates from 49% down to 9%; masking 3.5% of rows removes the collapse.

Design Principle

Route the mass.
Keep the identity.

Every unit of teacher probability is delivered to the student token that owns its bytes, or accounted for in an explicit residual. Nothing dropped, nothing renamed.

Read the arXiv preprint

Citation

Cite this work

@misc{wang2026bpm,
  title={Cross-Tokenizer On-Policy Distillation via Byte-Prefix Marginalization},
  author={Hao Wang and Kun Yuan and Wenlin Zhong and Minglei Zhang and Han Xiao and Ming Sun and Honggang Qi},
  year={2026},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  eprint={2607.22334},
}