Introduction
On-policy distillation trains a student on its own rollouts. A teacher's log-probability can include knowledge inherited from the reference checkpoint, while tiny tail probabilities can make the teacher/reference ratio numerically large and semantically uninformative. Weak-to-strong and delta-distillation methods motivate transferring the teacher's learned change directly [1, 2].
We propose RG-DDT. The teacher-reference delta is evaluated on a bounded student support, gated by the teacher pair's resolved mass, and averaged under the rollout student. A clipped policy-gradient term and an anchor to the initial student complete the objective.
Method
Reliability-gated delta
The code fixes a top support and forms the implicit reward . For each support token it compares the larger teacher/reference log mass with the support maximum, then applies a sigmoid gate. The gate keeps changes that either model assigns meaningful mass and attenuates tail ratios.
# We implement its per-token Rao-Blackwellised policy gradient over the
# student's top-K support (removes token-sampling variance), plus a k3 KL
# anchor to the frozen initial student.
#
# Key mechanism (the contribution): the implicit reward log(T/R) is only
# *identified* on the teacher pair's effective support. Deep in the tail
# (both T and R assign negligible mass) the log-ratio is large but meaningless
# noise -- on a student top-K support a large fraction of columns are such tail
# tokens. We therefore gate the per-token reward by a soft reliability weight
# w(v) = sigmoid((max(log T, log R) - max_u max(log T, log R) - log kappa)/s)
# which keeps tokens either model has "resolved" (mass within kappa of the
# prefix's top mass) and suppresses tail ratios. This focuses the transfer on
# genuine preference changes and protects the strong student from off-support
# noise. The delta is NOT centred: its (negative) common mode carries the
# efficiency/conciseness the teacher's RL learned, which we want to transfer.
# ---------------------------------------------------------------------------
SUPPORT_K = 32
RECIPE = {"learning_rate": 1e-6, "lr_scheduler_type": "constant", "warmup_ratio": 0.0,
"weight_decay": 0.01, "temperature": 1.0, "top_p": 1.0, "loss_type": "bnpo"}
ANCHOR = True
REL_KAPPA = 0.02 # reliability threshold: fraction of per-prefix top mass
REL_SHARP = 1.0 # gate sharpness (log-mass units)
DUAL_CLIP = 3.0 # dual-clip PPO ceiling for negative advantages
# adaptive anchor coefficient (sign controller on the batch-mean student-weighted shift)
_KL = {"coef": 1.0, "eps": 0.01, "min": 0.5, "max": 2.5}def compute_token_loss(advantage, student_logp, pg_loss, extras, rollout, support,
completion_ids, completion_mask, step, total_steps):
sup = support["student"]
slp = sup["student_lp"] # rollout-time student logp on its top-K
tlp = sup["teacher_lp"] # teacher logp on the same ids
rlp = sup["reference_lp"] # reference logp on the same ids
cur = sup["student_logp"] # CURRENT student logp (with gradient)
pbar = torch.softmax(slp, dim=-1).detach() # renormalised rollout student
r = (tlp - rlp).detach() # implicit reward (policy shift)
# reliability gate: trust the log-ratio only where the teacher pair has mass
lm = torch.maximum(tlp, rlp)
top = lm.max(dim=-1, keepdim=True).values
w = torch.sigmoid((lm - top - torch.log(torch.tensor(REL_KAPPA, device=slp.device))) / REL_SHARP)
r = r * w
adv = (pbar * r).detach() # Rao-Blackwellised advantage
ratio = torch.exp(torch.clamp(cur - slp, -20.0, 20.0))
pg1 = -adv * ratio
pg2 = -adv * torch.clamp(ratio, 0.8, 1.2)
clip1 = torch.maximum(pg1, pg2)
clip2 = torch.minimum(-adv * DUAL_CLIP, clip1)
pg = torch.where(adv < 0, clip2, clip1).sum(dim=-1)Knowledge preservation
The policy term uses the current student's differentiable log-probability and the rollout student's detached log-probability. A clipped ratio handles positive advantages, while negative advantages receive an additional dual-clip ceiling. A -style anchor compares the current student with the frozen initial student and uses an adaptive coefficient.
# k3 KL anchor to the frozen initial student (preserves student knowledge)
kl = torch.clamp(rollout["anchor_lp"] - student_logp, -20.0, 20.0)
kl = torch.clamp(torch.exp(kl) - kl - 1, -10.0, 10.0)
coef = extras["kl_coef"][..., 0] if "kl_coef" in extras else _KL["coef"]
return pg + coef * kl
def compute_per_token_signal(student_lp, teacher_lp, teacher_base_lp, mean_student_lp,
mean_teacher_lp, mean_teacher_base_lp, completion_mask, solutions,
step, total_steps, completion_ids=None, completion_texts=None,
tokenizer=None, support=None):
# The whole objective lives in stage 2; here we only update the adaptive
# anchor coefficient from this batch's mean student-weighted teacher shift.
sup = support["student"]
w = torch.softmax(sup["student_lp"], dim=-1)
rm = w * (sup["teacher_lp"] - sup["reference_lp"])
m = completion_mask.unsqueeze(-1).expand_as(rm).float()
tot = torch.stack([(rm * m).sum(), m.sum()]).double()
if torch.distributed.is_available() and torch.distributed.is_initialized():
torch.distributed.all_reduce(tot)
mean = float(tot[0] / tot[1].clamp(min=1.0))
c = _KL["coef"]
c = c * (1 + _KL["eps"]) if mean > 0 else (c * (1 - _KL["eps"]) if mean < 0 else c)
_KL["coef"] = max(_KL["min"], min(_KL["max"], c))
coef = torch.full(completion_mask.shape + (1,), _KL["coef"], device=student_lp.device)
return torch.zeros_like(student_lp), {"kl_coef": coef}The separate stage-1 function returns only the coefficient feature; the full objective remains in the stage-2 loss, so the routing signal has no gradient path through rollout construction.
Results
| Method | ① | ② | ③ |
|---|---|---|---|
| Accuracy, ave@32 ↑ | Accuracy, ave@32 ↑ | Accuracy, ave@32 ↑ | |
| Qwen4-Max | 0.632 | 0.471 | 0.270 |
| OPD² | 0.521 | 0.384 | 0.208 |
| ExOPD | 0.556 | 0.406 | 0.246 |
| Raw teacher-reference delta | 0.402 | 0.267 | 0.116 |
| OPD | 0.573 | 0.409 | 0.244 |
| Constant positive signal | 0.537 | 0.377 | 0.241 |
| Top-K OPD | 0.529 | 0.408 | 0.220 |
| Constant negative signal | 0.521 | 0.396 | 0.233 |
| End-of-turn penalty | 0.566 | 0.405 | 0.256 |
| Direct-OPD | 0.598 | 0.450 | 0.260 |
- ① DeepSeek-R1-Distill-Qwen-7B student / JustRL-DeepSeek-1.5B teacher / DeepSeek-R1-Distill-Qwen-1.5B reference, all in thinking mode, math run · AIME 2024 (ave@32)
- ② Same math checkpoint · AIME 2025 (ave@32)
- ③ Same math checkpoint · HMMT February 2025 (ave@32)
Accuracy is higher when larger. On AIME 2024, RG-DDT reaches 0.632, above OPD² at 0.521 and ExOPD at 0.556. On AIME 2025 it reaches 0.471 versus 0.384, and on HMMT 2025 it reaches 0.270 versus 0.208. The best published value on AIME 2025 is 0.450 from Direct-OPD [1].
How we got here
The submitted comments identify two failure modes: unbounded tail ratios and overwriting student knowledge with a teacher shift that is not supported by the current distribution. The resulting sequence is therefore reliability gating, support-weighted averaging, clipped policy optimization, and an adaptive anchor.
Limitations
The support gate cannot see teacher/reference changes outside the student's top support. Its threshold and sharpness are fixed constants, and the dual clip can suppress useful negative advantages. The adaptive anchor reacts only to the batch mean shift, so heterogeneous prompts can receive the same coefficient. Finally, the results do not establish dominance over every possible teacher or support construction.
References
- Shiyuan Feng, Huan-ang Gao, Haohan Chi et al. (2026). Weak-to-Strong Generalization via Direct On-Policy Distillation.
- Byeongho Heo, Jaehui Hwang, Sangdoo Yun et al. (2026). On-Policy Delta Distillation.
- Wenkai Yang, Weijie Liu, Ruobing Xie et al. (2026). Learning beyond Teacher: Generalized On-Policy Distillation with Reward Extrapolation.
- Yuqian Fu, Haohuan Huang, Kaiwen Jiang et al. (2026). Revisiting On-Policy Distillation: Empirical Failure Modes and Simple Fixes. COLM.