Cross-Tokenizer On-Policy Distillation via Byte-Prefix Marginalization
Paper • 2607.22334 • Published
How to use K1zE/BPM with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="K1zE/BPM")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("K1zE/BPM")
model = AutoModelForMultimodalLM.from_pretrained("K1zE/BPM", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use K1zE/BPM with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "K1zE/BPM"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "K1zE/BPM",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/K1zE/BPM
How to use K1zE/BPM with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "K1zE/BPM" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "K1zE/BPM",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "K1zE/BPM" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "K1zE/BPM",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use K1zE/BPM with Docker Model Runner:
docker model run hf.co/K1zE/BPM
arXiv:2607.22334 · Project page
Qwen3.5-2B distilled from GLM-Z1-9B-0414 with BPM (Byte-Prefix Marginalization), a cross-tokenizer on-policy distillation method. Forward-KL arm, step 149.
Every cell is avg@8 / pass@8, matching Table 1 of the paper. Sampling: temperature 0.6,
top-p 0.95, top-k 20, 8 samples per prompt, thinking enabled.
| Model | AIME 2026 | HMMT 2026 | MATH-500 | HumanEval+ | LiveCodeBench | TACO | Avg |
|---|---|---|---|---|---|---|---|
| GLM-Z1-9B-0414 (teacher) | 63.3 / 90.0 | 33.3 / 48.5 | 92.3 / 97.4 | 89.8 / 96.9 | 45.6 / 63.2 | 53.5 / 64.0 | 63.0 / 76.7 |
| Qwen3.5-2B (base) | 7.5 / 26.7 | 10.6 / 18.2 | 60.5 / 84.6 | 52.5 / 84.0 | 11.6 / 17.6 | 5.3 / 11.7 | 24.7 / 40.5 |
| SimCT | 15.8 / 30.0 | 12.5 / 27.3 | 58.6 / 89.2 | 50.2 / 78.5 | 12.6 / 23.6 | 8.4 / 21.2 | 26.3 / 45.0 |
| ULD | 17.5 / 40.0 | 12.5 / 24.2 | 81.2 / 94.4 | 66.0 / 88.3 | 15.8 / 25.8 | 12.4 / 27.2 | 34.2 / 50.0 |
| GOLD | 22.1 / 53.3 | 17.4 / 33.3 | 81.8 / 96.4 | 63.0 / 89.0 | 9.0 / 23.6 | 4.8 / 15.5 | 33.0 / 51.9 |
| SeqKD | 23.3 / 50.0 | 14.8 / 27.3 | 74.4 / 93.4 | 60.1 / 87.1 | 20.1 / 31.3 | 16.8 / 34.3 | 34.9 / 53.9 |
| BPM | 35.4 / 63.3 | 21.2 / 36.4 | 84.8 / 95.4 | 68.8 / 91.4 | 22.3 / 33.5 | 16.5 / 36.4 | 41.5 / 59.4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("K1zE/BPM")
model = AutoModelForCausalLM.from_pretrained("K1zE/BPM", dtype="auto", device_map="auto")
msgs = [{"role": "user", "content": "What is the remainder of 7^100 modulo 13?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=2048)[0][ids.shape[-1]:], skip_special_tokens=True))
Prompts: K1zE/BPM. Research checkpoint, not instruction-tuned for general use.
@misc{wang2026crosstokenizeronpolicydistillationbyteprefix,
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},
eprint={2607.22334},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2607.22334},
}