Qwen3-4B-OPD-RL-Code-Step200

This is the final student checkpoint after 200 on-policy distillation (OPD) updates from Why On-Policy Distillation Sometimes Fails: Vanishing Learning Signals. It starts from Qwen/Qwen3-4B and learns from the fixed teacher Qwen3-4B-Non-Thinking-RL-Code-Step300 (public reference). The uploaded model is the distilled student; the teacher's weights are not included.

Paper · Project page · Code and numerical results

Training

The run uses a reverse-KL OPD objective approximated with the student's top 16 tokens, student-probability weights, and a global mean over valid response tokens. Student-generated responses provide the prefixes for fixed-teacher supervision.

Setting Value
Initial student Qwen/Qwen3-4B
Teacher training alias Qwen3-4B-Non-Thinking-RL-Code-Step300
Training data PRIME-RL/Eurus-2-RL-Data (code subset)
Final training step 200
Optimizer AdamW; learning rate 1e-6; constant schedule
Prompt batch / rollouts per prompt 64 / 1
Maximum prompt / response tokens 2048 / 16384
Sampling temperature 1.0
Public recipe code_rl

Qwen3 non-thinking chat template (enable_thinking=False). See the experiment map for launcher provenance and the reproducibility notes for the historical evaluation protocol.

Step-200 evaluation

The following numbers are archived results of the paper run. Accuracy is avg@4, the mean correctness of sampled responses, macro-averaged over the three benchmarks. This is not pass@k, which counts whether any sample succeeds. The maximum validation response length is 16384 tokens, with temperature 1.0 and top-p 1.0.

Benchmark Final avg@4 (%)
HumanEval+ 86.13
MBPP+ 70.44
LiveCodeBench 24.62
Macro average 60.39

The initial student scored 52.69%; the step-200 checkpoint scores 60.39% (+7.70 percentage points). The final logged top-16 loss is 0.00069608, a 99.4% reduction from update 1. This is the final reduction, not the minimum loss observed earlier in training, and the logged surrogate is not the full-vocabulary KL.

  • Completed 2026-09-23 reproduction on 2 H200 GPUs with native checkpoint resumes, not the older 149-step run. Eight responses were generated; avg@4 uses the archived fixed reward-independent four-of-eight selection at every validation checkpoint.

  • These are archived paper-run metrics; the exported/uploaded checkpoint has not yet been independently re-evaluated during packaging.

Use

Load this repository with AutoTokenizer and AutoModelForCausalLM (Transformers 4.56.2 or a compatible newer version, with PyTorch and Accelerate). Use its saved chat template; the example below is a short inference example, not a reproduction of the benchmark protocol.

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "leizhao7/Qwen3-4B-OPD-RL-Code-Step200"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto"
)
messages = [{"role": "user", "content": "Write a Python function that returns the unique elements of a list in order."}]
inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,

    enable_thinking=False,

    return_dict=True,
    return_tensors="pt",
).to(model.device)
output = model.generate(
    **inputs,
    max_new_tokens=1024,
    do_sample=True,
    temperature=1.0,
    top_p=1.0,
)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Scope and limitations

This is a research checkpoint for reproducing and studying OPD. The paper reports one run per condition under a fixed 200-update horizon. These results do not establish broad general-purpose performance, safety, or that loss plateaus persist under every training configuration. The checkpoint retains the limitations of its initial student and can produce incorrect answers or code.

License and provenance

This OPD checkpoint modifies the Apache-2.0 Qwen3 student. Preserve the upstream Apache-2.0 license and attribution, and state that the weights were modified by 200 OPD updates. No teacher weights are included. See LICENSE and UPSTREAM_ATTRIBUTION.md. The code repository's MIT license is separate from the model's upstream terms.

The linked Keven16 repository is a verified public checkpoint with the same name. The released local training configuration does not establish that this was the historical download origin; no historical HF source ID or revision is asserted. The teacher repository is linked for attribution and reproducibility; it is not listed as the initial student. Training-time upstream revisions are not recoverable from the public numerical release alone. This release includes SHA256SUMS, checkpoint provenance, and validation.json documenting export checks separately from the archived benchmark results.

Citation

@misc{zhao2026opdlearningsignals,
  title={Why On-Policy Distillation Sometimes Fails: Vanishing Learning Signals},
  author={Lei Zhao and Qichao Zhao and Bowen Zuo and Qishi Zhan},
  year={2026},
  eprint={2610.11247},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2610.11247}
}
Downloads last month
173
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for leizhao7/Qwen3-4B-OPD-RL-Code-Step200

Finetuned
Qwen/Qwen3-4B
Finetuned
(1196)
this model

Dataset used to train leizhao7/Qwen3-4B-OPD-RL-Code-Step200

Collection including leizhao7/Qwen3-4B-OPD-RL-Code-Step200

Paper for leizhao7/Qwen3-4B-OPD-RL-Code-Step200