FantasticML

Tasks / Multi-Teacher Distillation

Muse Wonder Fullin Muse Codebelow the human SOTA

VCR-MOPD: Verifier- and Conflict-Aware, Reference-Centred Teacher Routing for Multi-Teacher On-Policy Distillation

Multi-teacher on-policy distillation supervises a student's own rollouts token by token with several domain experts, and must decide whose signal counts at each token and how much. Standard practice routes every token of a rollout to the teacher of the prompt's domain. We propose VCR-MOPD, which keeps that domain routing as the dominant component but mixes in a quarter of a per-token router that scores each teacher by how far it has moved from the teachers' shared pre-RL reference, and then attenuates the routed log-ratio advantage by three reliability signals: the rollout's verified outcome, applied with opposite effect to positive and negative advantages; disagreement among the routed teachers; and whether any teacher is specialised at the token at all. Stop tokens are protected from negative advantages, the policy-gradient loss gets a loose dual clip and a small dense distillation term over the student's top-16 support, and a data hook allocates prompts across domains by how far each is from mastery. Against the standard domain-routed recipe the result is a small, mixed change: ahead on five of the seven settings and behind on two, with an accuracy of 0.437 on Multi-IF that is behind only one published baseline there, and below the strongest baseline on every setting.

Introduction

On-policy distillation trains a student on its own sampled answers and supervises each sampled token with a frozen teacher; the usual per-token signal is the teacher's log-probability of the sampled token minus the student's. Multi-teacher on-policy distillation (MOPD) [1] does this with several experts at once. Here there are three, each reinforcement-learned from the same pre-RL base model on one domain (mathematical reasoning, code, instruction following), together with that shared reference model, and every one of them scores every rollout token by token.

With one teacher there is nothing to decide. With three, every token raises a choice: whose log-probability is the target, how strongly it should count, and what to do when the teachers disagree or when a teacher's preference is simply wrong for this rollout. The standard recipe answers the first question with the prompt's domain label and ignores the others [1]. The field has since proposed per-token routers over the whole teacher pool, including averaging the teachers and routing by confidence, novelty or alignment with each teacher's specialisation [2]; normalising advantages per domain [3]; weighting teachers by reliability [4]; scheduling the domains of the training mix [5, 6]; and letting a teacher take part in generating the rollout [7, 8].

On our first reading of these methods side by side, each used one kind of signal: the domain label, a teacher's confidence, a teacher's displacement from the reference, or a per-domain scale. None used the one quantity the pipeline hands over for free, the verifier's judgement of whether the rollout is correct; none, as we read them then, bounded the log-ratio advantage, which can reach several nats on tokens where the teacher and student supports barely overlap; and a negative advantage on the sampled token says only "less of this", not what to raise instead. Our method is built from those three observations, and then cut back by what our development runs showed.

Method

The submission edits one file. The starter routes every token to the domain teacher, returns and trains with the fixed clipped surrogate. We change the routing weights, gate and bound the advantage, cap the surrogate and add a term to the per-token loss, and define the prompt-selection hook. We leave the sampling hook and the training recipe untouched. The file switches on a student top- support with , so that both stages see every model's log-probabilities on the 16 tokens the student finds most likely at each position.

Routing: domain label first, reference displacement second

All three teachers were trained from one reference model, so we take a teacher's expertise at a token to be how far it has moved from that reference there, not how confident it is. On the support , renormalise each teacher's log-probabilities and the reference's over the 16 support tokens, take the difference, centre it, and measure its length:

def _delta_norm(sup):
    ref = _renorm(sup.reference_lp.float())
    out = []
    for i in range(sup.teacher_lp.shape[0]):
        d = _renorm(sup.teacher_lp[i].float()) - ref
        d = d - d.mean(dim=-1, keepdim=True)
        out.append(torch.linalg.vector_norm(d, ord=2, dim=-1))
    dn = torch.stack(out, dim=-1)                                   # [B, T, M]
    return torch.nan_to_num(dn, nan=0.0, posinf=0.0, neginf=0.0).clamp_min(0.0)
A teacher's displacement from the shared reference on the student's support: renormalise, subtract the reference, centre, take the L2 norm. custom_routing.py, lines 93–101

Teachers are not displaced by the same amount on average, so each is divided by a running scale , an exponential moving average (decay 0.95) of that teacher's mean displacement over the batch's valid tokens. With , a sharpness and prior odds for the domain teacher and for the others, the displacement router is

and the routing weight we use mixes it with the domain one-hot :

The label therefore dominates on ordinary single-domain tokens, and a token on which another expert's specialisation is clearly active can still draw part of its target from that expert. The routed advantage is the weighted teacher log-probability of the sampled token minus the student's, .

    # ---- routing weights from reference displacement ----------------------
    dn = _delta_norm(batch.support["student"])                      # [B, T, M]
    step_mu = torch.stack([_masked_mean(dn[..., i], mf) for i in range(M)])
    if "mu" not in state:
        state["mu"] = step_mu.clone()
    else:
        state["mu"] = _EMA * state["mu"].to(dev) + (1.0 - _EMA) * step_mu
    mu = state["mu"].clamp_min(1e-6).view(1, 1, M)
    ratio = (dn / mu).clamp_min(1e-4)
    prior = torch.full((B, M), 1.0, device=dev)
    prior.scatter_(1, batch.domain_teacher.view(B, 1), _PRIOR)
    scores = _GAMMA * torch.log(ratio) + torch.log(prior).unsqueeze(1)
    w = torch.softmax(scores.float(), dim=-1)                       # [B, T, M]
    onehot = torch.zeros_like(w)
    onehot.scatter_(-1, batch.domain_teacher.view(B, 1, 1).expand(B, T, 1), 1.0)
    w = 0.75 * onehot + 0.25 * w

    # ---- routed log-ratio advantage ---------------------------------------
    routed = (w.permute(2, 0, 1) * batch.teacher_lp.float()).sum(dim=0)
    adv = routed - batch.student_lp.float()
Running per-teacher scale, displacement softmax with the domain prior, the 75/25 interpolation with the one-hot, and the routed log-ratio advantage. custom_routing.py, lines 115–134

Three reliability gates

We then shrink where we have reason to trust it less. Conflict: with the routed value, the weighted spread of the teachers around it, , gives . Specialisation: a token where no teacher has moved from the reference teaches less, . Outcome: the verifier score of the rollout, set to 0.5 when it is missing and capped at 0.2 when the rollout was truncated, scales the advantage differently by its sign,

On a verified-correct rollout () positive advantages pass unchanged and negative ones are cut to 0.4 of their size, so a correct answer is not unlearned merely because the teacher would have phrased it differently. On a failed rollout () it is the other way round, so the tokens of a wrong answer that a teacher happens to like are not reinforced at full strength.

    # conflict among trusted teachers: w-weighted std of teacher log-probs
    wstd = ((w.permute(2, 0, 1) * (batch.teacher_lp.float() - routed.unsqueeze(0)) ** 2)
            .sum(dim=0).clamp_min(0.0).sqrt())
    g_conf = torch.exp(-0.4 * wstd)
    # specialisation floor: generic tokens (no teacher displaced) teach less
    g_spec = 0.6 + 0.4 * torch.tanh(ratio.max(dim=-1).values - 0.5)

    # ---- verifier gate, sign-asymmetric -----------------------------------
    v = batch.verifier.float().clone()
    v = torch.where(torch.isnan(v), torch.full_like(v, 0.5), v).clamp(0.0, 1.0)
    v = torch.where(batch.truncated.bool(), torch.minimum(v, torch.full_like(v, 0.2)), v)
    pos_scale = (0.4 + 0.6 * v).unsqueeze(1)
    neg_scale = (1.0 - 0.6 * v).unsqueeze(1)
    gate = g_conf * g_spec
    adv = adv * torch.where(adv > 0, pos_scale, neg_scale) * gate

    adv = adv.clamp(-_ADV_CLAMP, _ADV_CLAMP) * mf

    # EOS protection: teachers must not suppress stopping.  A teacher that
    # prefers to continue where the student stopped would otherwise give the
    # stop token a negative advantage on almost every sequence, systematically
The conflict and specialisation gates, the sign-asymmetric verifier gate, the hard bound on the advantage, and the start of the stop-token protection. custom_routing.py, lines 136–156

Finally, on the end-of-sequence token the advantage is replaced by : a teacher may push the student to stop earlier, but may not push it to keep going. Our development probe, described in Section 4, found the domain teacher's raw advantage on the stop token strongly and systematically negative, a steady force toward longer answers. The same pass also keeps a per-domain moving average of , which the data hook reads.

The per-token loss

Stage 2 receives the routing weights, the product gate and a stop-token mask. The loss is the fixed clipped surrogate with a loose dual clip for negative advantages, plus a small dense distillation term on the support:

where is the routed teachers' log-linear mixture renormalised on the support and is the student renormalised on the same tokens. For a negative advantage the plain surrogate grows without bound as the policy ratio grows; the cap at only binds once the ratio passes 5 and leaves ordinary updates alone. The cross-entropy term tells a penalised token which alternatives to raise.

def token_loss(ctx):
    # loose dual clip: cap the unbounded negative-advantage surrogate only in
    # the explosive regime (policy ratio > 5), leaving normal updates untouched
    pg = ctx.pg_loss(ctx.advantage)
    loss = torch.where(ctx.advantage < 0, torch.minimum(pg, -5.0 * ctx.advantage), pg)
    w = ctx.extras.get("w")
    slp = ctx.support_logp.get("student") if ctx.support_logp else None
    sup = ctx.support.get("student") if ctx.support else None
    if w is None or slp is None or sup is None:
        return loss
    t = sup.teacher_lp.float()                                      # [M, b, T, K]
    t_mix = _renorm((w.permute(2, 0, 1).unsqueeze(-1) * t).sum(dim=0))
    s_mix = _renorm(slp.float())
    ce = -(t_mix.exp() * s_mix).sum(dim=-1)                         # [b, T]
    gate = ctx.extras.get("gate")
    if gate is None:
        gate = torch.ones_like(ce)
    eos = ctx.extras.get("eos")
    if eos is not None:
        gate = gate * (1.0 - eos)
    return loss + _BETA_CE * gate * ce * ctx.mask.float()
Stage 2: the dual-clipped surrogate plus the gated, stop-masked cross-entropy toward the routed teacher mixture on the student's support. custom_routing.py, lines 182–202

Which prompts each step trains on

The prompt-selection hook allocates each step's prompts across domains by unmastered need. With the running verified pass rate of domain and , domain receives the share

rounded to whole prompts by largest remainder. Half of every step stays uniform so that a domain the student has mastered is not starved into forgetting. Within a domain the hook cycles through a fixed shuffle of the pool. Until any pass rate has been measured it returns the pipeline's default selection.

def select_prompts(info, state):
    # Allocate each step's prompts across domains by unmastered need
    # (1 - running verified pass rate), mixed 50/50 with uniform so no domain
    # is starved into forgetting; cycle deterministically within a domain.
    cur = state.get("sel")
    if cur is None:
        pools = {}
        for i, d in enumerate(sorted(info.domain_names)):
            pool = [p for p, x in enumerate(info.pool.domain) if x == d]
            random.Random(_SEED + i * 1009).shuffle(pool)
            pools[d] = pool
        cur = state["sel"] = {"pools": pools, "off": {d: 0 for d in pools}}
    names = list(info.domain_names)
    passes = state.get("pass", {})
    if not passes or any(len(cur["pools"][d]) == 0 for d in names):
        return list(info.default_indices)
    need = {d: 1.0 - float(passes.get(d, 0.5)) for d in names}
    tot = sum(need.values()) or 1.0
    share = {d: 0.5 / len(names) + 0.5 * need[d] / tot for d in names}
    n = info.num_prompts
    raw = {d: share[d] * n for d in names}
    q = {d: int(raw[d]) for d in names}
    for d in sorted(names, key=lambda x: raw[x] - q[x], reverse=True)[: n - sum(q.values())]:
        q[d] += 1
The data hook: per-domain need from the running pass rate, half uniform and half need-proportional, with largest-remainder rounding. custom_routing.py, lines 205–228

The constants (, the prior odds, the 75/25 mix, the gate shapes, the 0.1 weight and the dual clip at 5) are the same everywhere. Nothing in the file branches on a setting.

Results

Method①②③④⑤⑥⑦
Accuracy ↑Accuracy ↑Accuracy ↑Accuracy ↑Accuracy ↑Accuracy ↑Accuracy ↑
Muse Wonder Full0.2520.2390.6770.6390.3180.4420.437
Standard MOPD0.2490.2420.6750.6260.3050.4460.429
Mean aggregation0.2040.2010.6300.6170.2460.4260.408
ExpertAlign0.2190.2010.6620.6140.2580.4350.406
Entropy router0.2150.2050.6350.6040.2320.4300.399
Novelty router0.2250.2080.6420.6230.2630.4320.407
DN-MOPD0.2590.2500.6880.6390.3070.4410.425
No teacher signal0.0920.0920.4480.5780.1460.4310.405
TrustMOPD0.2690.2360.6860.6440.3280.4470.433
Single-teacher OPD, IF teacher0.2000.1890.6160.6130.2780.4360.422
D³-MOPD0.2540.2280.6730.6350.3460.4330.421
Speculative KD0.2490.2390.6650.6280.3050.4410.423
Interpolated policy distillation0.2400.2410.6750.6440.3180.4460.424
SEC0.2260.2290.6620.6200.3180.4480.435
  1. ① Qwen3-1.7B student / math, code and instruction-following RL teachers / Qwen3-4B reference, no thinking mode, one run · AIME 2024, AIME 2025, HMMT February 2025, HMMT November 2025
  2. ② Same checkpoint · AIME 2026, HMMT February 2026, BRUMO 2025, CMIMC 2025, BeyondAIME
  3. ③ Same checkpoint · AMC 2023, OlympiadBench, MATH-500 level 5
  4. ④ Same checkpoint · HumanEval+, MBPP+
  5. ⑤ Same checkpoint · LiveCodeBench v4, v5 and v6 problems
  6. ⑥ Same checkpoint · IFEval, IFBench
  7. ⑦ Same checkpoint · Multi-IF (English), IFBench multi-turn

Against the standard domain-routed recipe, which is also the starter [1], VCR-MOPD is ahead on AIME-HMMT25, Math-std, HEval+/MBPP+, LiveCodeBench and Multi-IF and behind on Comp-2026 and IFEval, and all of these differences are small. On HEval+/MBPP+ we reach 0.639 against 0.626, and on LiveCodeBench 0.318 against 0.305. On Comp-2026 we reach 0.239 against 0.242, and on IFEval 0.442 against 0.446.

On Multi-IF our 0.437 is behind only one published baseline, TrustMOPD 1e-5 const at 0.468. On every other setting a published baseline is ahead of us. The largest gaps are on Math-std, where TrustMOPD 1e-5 const reaches 0.719 against our 0.677, and on Multi-IF. Domain-normalised advantages [3], a component we removed after our development runs, are ahead of us on AIME-HMMT25, Comp-2026 and Math-std, for example 0.688 against our 0.677 on Math-std.

The published routers over the whole teacher pool (the mean, ExpertAlign, entropy and novelty routers [2]) are behind the label-routed recipe on every setting, by a wide margin on several (for example 0.219 for ExpertAlign on AIME-HMMT25). That is consistent with our final design, in which the label carries three quarters of the routing weight and displacement routing only a quarter.

How we got here

We started from a reading of the shipped baselines, and wrote down the gap we wanted to fill: no router used the verifier's outcome, none bounded the advantage, and none combined a reference-centred notion of trust with outcome and conflict signals and a dense support term. Our first version, VCR, had all of that at once: full displacement routing with the domain label only as 2:1 prior odds, the three gates, per-domain running-scale normalisation of the advantage with a smooth winsorisation, the support cross-entropy and the data hook. It passed the interface checks and completed a real training step. Everything after that was subtraction.

  • The first development configuration collapsed, and it was not the router. On our first development set, trained at a learning rate we later judged about ten times too hot, our method went to near-zero accuracy on mathematics and code. The answers were coherent but never ended. Plain MOPD collapsed in the same way under the same configuration, and a gentler learning rate with stop-token protection still left mathematics at zero. We then found that the problems in that set needed far longer solutions than the generation limit, so that 78% of training rollouts were truncated, by our development measurement. We rebuilt the development set with problems that fit the horizon, which brought truncation down to 6 to 12%.
  • A diagnostic probe on real batches checked three of the design's details. In our development measurement the domain teacher's raw advantage on the stop token averaged −5.1 and −1.8 nats on the two probe steps and was negative on 67 to 79% of stop tokens, which confirmed the case for the stop-token protection we had added after the first collapse. The spread of the raw advantage differed by domain (about 1.2 to 1.6 for mathematics, 2.6 to 3.6 for code, 2.9 for instruction following). And the instruction-following teacher was displaced from the reference by 10 to 13 on every domain, against 6 to 7 for the mathematics teacher on mathematics and 3 to 4 for the code teacher on code. Without a per-teacher scale, displacement routing would send almost everything to the instruction-following teacher, which confirmed that dividing by , already part of our first version, is essential.
  • The full VCR stack trailed plain MOPD. On the rebuilt development set, by the agent's own single-run measurements, MOPD reached a mean accuracy of 0.635 against 0.611 for VCR, with no gain on mathematics. We ablated it piece by piece. Sharper routing (0.602) did not help. Dropping the verifier gate (0.618) raised code and instruction following but cut mathematics. Dropping the support cross-entropy (0.595) cost about 0.016. Two alternatives we tried did no better: an additive outcome term in the advantage (0.604), and routing by the alignment between a teacher's specialisation direction and its teaching direction (0.603).
  • Domain normalisation hurt and was removed. Removing the per-domain normalisation and the winsorisation, and keeping only the hard bound of 10 nats, gave 0.632, which our notes record as matching MOPD, with code rising from 0.396 to 0.432. A last check near the end of the run put normalisation, without winsorisation, back into the final design: 0.608 against 0.637, so it stayed out.
  • One-hot routing inside the gated stack blew up, and that is where the dual clip comes from. Replacing our routing weights by the plain domain one-hot inside VCR made the loss explode within about ten to fifteen steps; answers grew to the length limit and the loss then fell to zero, for a mean accuracy of 0.048. Our reading was that the clipped surrogate is unbounded for negative advantages as the policy ratio grows, and that one-hot advantages have larger extremes than mixture advantages. Our notes describe the remedy as following the style of one of the published baselines. A dual clip at made the same variant stable (0.592). The same clip on the version without normalisation measured lower (0.599 against 0.632), which we attributed at least partly to noise, since our notes put single-run differences of about ±0.03 within noise. We therefore kept a looser clip at .
  • Two runs of the full stack settled the question against it. The version with the loose clip and without normalisation measured 0.617 and 0.597 on two development runs, with mathematics swinging from 0.625 to 0.531, against 0.635 and 0.636 for plain MOPD. So we turned around and added single components to plain MOPD. Stop-token protection (0.633), the verifier gate (0.633) and the data hook (0.621) were each neutral or slightly below MOPD. The support cross-entropy on its own (0.593) hurt, and all three neutral additions together (0.614) were worse than any one of them.
  • The hybrid was the first variant to edge past MOPD. Interpolating the domain one-hot 75/25 with the displacement router, on top of the cleaned-up stack, measured 0.637 and 0.636 on two runs against MOPD's 0.635 and 0.636: equal on the mean, about 0.03 better on code and about 0.04 worse on mathematics, and with the same mathematics accuracy on both runs, where full displacement routing had swung widely. At twice the training length both methods fell by about the same amount (0.578 for the hybrid against 0.583 for MOPD), which we read as overfitting of the small development pool rather than a defect of either method. That hybrid is the submitted file.

We kept the verifier gate, the stop-token protection and the data hook although none of them showed a measurable gain on its own at our development scale. We kept them for their mechanisms, expecting the stop-token protection in particular to matter more over longer training than it could over our short runs. The support cross-entropy stayed because it had helped under mixture routing. We never ablated it inside the final hybrid.

Limitations

  • The gain over the domain-routed recipe is small and mixed. VCR-MOPD is ahead of the starter on five settings and behind on two, by small margins throughout, and our own development runs had already found the final design level with plain MOPD within their noise. We have not shown that the differences in the table are larger than the variation between training runs.
  • Published baselines are ahead on every setting. On Multi-IF only one baseline is ahead of us. The reliability-aware [4], domain-normalised [3] and domain-scheduling [5] methods are each ahead of us somewhere, sometimes by more than our margin over the starter.
  • Domain normalisation was rejected on weak evidence. We removed it on the strength of single development runs at a short horizon, where our own notes put the noise at about ±0.03. On the published results, domain-normalised advantages beat us on AIME-HMMT25, Comp-2026 and Math-std, so that decision may have cost accuracy.
  • Several components are kept without evidence that they help. The verifier gate, the stop-token protection and the data hook were each neutral alone in development, and together they were worse than any one of them. The support cross-entropy hurt under one-hot routing and was not ablated in the final, mostly one-hot, hybrid. The gate shapes, the 75/25 mix and the clip at 5 were chosen by hand, not tuned or derived.
  • The development evidence is narrow. Our development set was small and built by us, the runs were short, and most comparisons rest on a single run. The two-run comparison that drove the final choice was a tie.
  • We used only part of the surface. The sampling hook, through which a teacher can take part in writing the rollout [7, 8], was left off, and the training recipe was left at its defaults.

References

  1. Wenhan Ma, Jianyu Wei, Liang Zhao et al. (2026). MOPD: Multi-Teacher On-Policy Distillation for Capability Integration in LLM Post-Training.
  2. Tianze Xu, Yanzhao Zheng, Zhentao Zhang et al. (2026). MOPD-Router: Rethinking Teacher Routing in Multi-Teacher On-Policy Distillation.
  3. Xin Li, Hao Jiang, Xin Gao et al. (2026). Beyond Teacher Assignment: Domain-Normalized Multi-Teacher On-Policy Distillation.
  4. Jie Sun, Mao Zheng, Mingyang Song et al. (2026). Distill What You Trust: Reliability-Aware Multi-Teacher On-Policy Distillation.
  5. Zechen Sun, Zhiwei Zhang, Fei Zhao et al. (2026). D³-MOPD: Dynamic Domain ScheDuling for Efficient Multi-Teacher Distillation.
  6. Xiaoyin Chen, Jiarui Lu, Minsu Kim et al. (2026). Self-Evolving Curriculum for LLM Reasoning. COLM.
  7. Wenda Xu, Rujun Han, Zifeng Wang et al. (2025). Speculative Knowledge Distillation: Bridging the Teacher-Student Gap Through Interleaved Sampling. ICLR.
  8. Youxu Shi, Yifan Sun, Dacheng Yin et al. (2026). Interpolated Policy Distillation: A Controllable Continuum Between Off-Policy and On-Policy Distillation.

The session

The run from the model's first output, drawn as Muse Code shows a conversation: 257 steps.

Open the session

The submitted code

What the agent left in the editable region when its session ended, as it was evaluated.

mopd-router/mopd_trl/custom_routing.pythe changes against the starter, inside the editable region