Wizard-Swapped Credit Assignment for Training Multi-Agent Domain Reasoners

When several language models are chained into a team (one proposes intermediate facts, one checks them, one computes), and the team is trained with reinforcement learning on whether the final answer is right, every member receives the same reward. A good proposal followed by a botched calculation is punished, and a lucky guess rescued by a careful checker is rewarded. We propose a fix taken from human–computer interaction. In a Wizard-of-Oz study, a hidden operator quietly takes over one component of a system so that the other components can be studied in isolation. Here, the hidden operator is a fixed stand-in policy that sometimes knows the reference answer. To score one team member's output, we temporarily swap every other member for this stand-in, run the episode to completion, and compare the result against other candidate outputs for the same input. The stand-in is never imitated. It only provides a stable, low-noise context in which one role's contribution can be measured.

This matters most where generalist models fall short on specialized domains. TheoremQA, a benchmark of 800 university-level questions requiring formal theorems, shows that open models score below 15% and that pasting theorem definitions into the prompt does not help much. The bottleneck is using domain rules across several steps, not recalling them. Prompted role decompositions such as MACM suggest that splitting "finding usable conditions" from "verifying" and "computing" helps on hard problems. Nobody has trained such a decomposition on domain reasoning so that each role improves at its own job. Wizard-swapped credit makes that training signal clean enough to work. It also tells us which role holds the domain gap.

Core Claim

Group Relative Policy Optimization (GRPO) is a reinforcement learning method that samples several outputs for the same prompt and scores each by how its reward compares to the group's mean and spread, so no separate value network is needed. It assigns per-role credit badly in multi-agent pipelines because each role's outputs are evaluated against co-trained partners that are noisy and keep changing.

Our fix works as follows. For role $r$ and input $x$, sample $G$ candidate outputs $o_1,\dots,o_G$ from that role's policy. Complete each episode with a frozen wizard $W_{-r}$ filling the other roles, and compute

$$A_i^{(r)} = \frac{R(o_i, W_{-r}) - \mathrm{mean}_j\, R(o_j, W_{-r})}{\mathrm{std}_j\, R(o_j, W_{-r})},$$

where $R$ is the verifiable outcome reward, either a numeric answer match or a correct multiple-choice option. This advantage is then mixed with the ordinary on-policy team advantage.

The claim is specific and falsifiable. First, this role-isolated advantage should beat outcome-only multi-agent GRPO on domain reasoning benchmarks at matched compute. Second, the gain should persist when the wizard is no stronger than the policy being trained, for example a frozen copy of the initial checkpoint given privileged access to the reference answer. That second condition separates a credit-assignment effect from disguised distillation.

Relation to Prior Work

The method sits on two lines of GRPO extensions.

M-GRPO trains a planner with tool-using sub-agents. It deliberately ties sub-agent reward to final success and syncs their trajectories by duplicating or pruning them. It was tested only on web-assistant tasks. We keep its vertical team structure but reject its rule that a competent sub-agent shares the blame for a downstream failure.

GiGPO and HGPO get step-level credit by grouping steps that visit identical states, called "anchor states." HGPO notes that exact repeats with matching history are rare in long rollouts. When states do not repeat, both methods fall back to trajectory-level GRPO. Free-text reasoning almost never repeats a state, so these methods supply the motivating problem rather than a solution. Wizard swapping constructs the shared context that anchor-state grouping waits to observe.

The Wizard-of-Oz literature supplies the mechanism and also constrains it. Swappable architectures, in which a human can replace a dialogue or navigation module in real time (Marge; Katsakioris et al. split one system across two wizards), are the direct template. Guideline Bias in Wizard-of-Oz Dialogues warns that wizards inject their own habits into collected data. That warning is why we never train on wizard outputs and only use the wizard to evaluate the trained roles. It is also why we measure whether the wizard's identity biases the learned policy.

The domain-gap work motivates the setting:

  • TheoremQA shows that adding definitions fails.
  • KMQA finds that 44% of medical reading-comprehension errors come from knowledge missing from both the retrieved text and the knowledge graph.
  • AMR reaches strong MedQA scores with routing between specialist agents, memory, and reflection, but trains no weights.

Aegis attributes failures to specific agents after the fact, using GRPO-trained diagnosers on synthetically corrupted logs. Wizard swapping instead gives attribution online, during training, by intervening rather than by diagnosing.

n-Musketeers constrains the design. It merges expert models through soft hidden-state routing trained with GRPO. That routing helped on mid-difficulty arithmetic but hurt on saturated logic tasks (96.88% fell to 82.81%). We therefore use explicit text-level roles, the kind MACM found most helpful on the hardest problems, and we report results by difficulty level to see whether that tension reappears.

Research Program

We build a three-role team on Qwen2.5-3B and Qwen2.5-7B, the model sizes used in the GiGPO and HGPO evaluations. The roles follow MACM:

  • a Thinker proposes intermediate conditions, such as which theorem applies and what quantities it yields;
  • a Judge accepts or rejects each condition;
  • an Executor writes and runs Python to compute the final answer.

Each role has its own LoRA adapter, a small set of trainable low-rank weights added to the shared base model. Every training batch mixes two kinds of rollout. Ordinary team rollouts provide the standard outcome advantage. Wizard-swapped rollouts, one role at a time, provide $A^{(r)}$. We mix the two with a weight $\lambda$, and anneal $\lambda$ toward the on-policy signal so that the roles finally adapt to each other rather than to the wizard.

We study three wizard types.

  1. Strong wizard: a larger frozen open model.
  2. Self-wizard: the frozen initial checkpoint.
  3. Privileged self-wizard: the frozen initial checkpoint given the reference answer when acting as Judge or Thinker.

The privileged self-wizard is the analogue of a human operator who knows the ground truth. It can rate a proposed condition as useful toward a known answer without being any more capable than the policy.

On a 150-item TheoremQA subset, physics and engineering graduate students act as human Judges. This lets us check whether model-wizard credit ranks Thinker outputs the same way human-wizard credit does, and whether wizard identity leaves biases in the policy.

The analysis question is diagnostic as much as performance-driven: where does the domain gap live? By swapping each role for a privileged wizard at evaluation time, we measure how much accuracy each role recovers. This tests TheoremQA's suggestion that the bottleneck is operationalizing rules, which would show up as the Thinker recovering the most accuracy, rather than calculation, which would show up as the Executor recovering the most.

Baselines

Naive references. The lower reference is the untrained base model in a single-agent program-of-thought setup, where the model writes a program to compute the answer. A second reference is the same three-role team, prompted but untrained, which isolates what decomposition alone buys at this model size. For calibration we quote reported numbers:

  • TheoremQA: GPT-4 with program-of-thought reaches "51.0% accuracy," and open-source models score "below 15%" (TheoremQA).
  • MATH Level 5: prompted MACM lifts GPT-4 Turbo from 54.68% to 76.73% (MACM). No TheoremQA number for MACM appears in the research file.
  • MedQA: AMR reports 93.2% against 86.1% for GPT-4 (AMR).

These frontier-model figures are ceilings for context, not competitors for a 7B model.

Strongest trained competitor. This is outcome-credit multi-agent GRPO in the style of M-GRPO, applied to the identical three-role team, base model, and data. The research file gives no number for M-GRPO on GAIA, XBench, or WebWalkerQA. It reports only that the vertical team was "nearly 10% faster and more accurately" than peer-to-peer agents. We therefore reproduce M-GRPO ourselves.

Second trained competitor. This is single-agent GRPO on the same model and data, with verifiable rewards. It tests whether decomposition is needed at all.

Third trained competitor. This is HGPO-style history-grouped step advantages adapted to the team. HGPO reports a 95.96% success rate on ALFWorld but has no domain-reasoning result.

Fair comparison. Wizard rollouts cost tokens, so all methods are matched on total generated tokens and wall-clock GPU hours. Baselines receive the extra budget as larger group size $G$. Every method gets the same hyperparameter search budget, eight configurations, and is evaluated over three seeds.

Key ablations. Two ablations isolate the ingredient. Swapping in a random frozen partner, rather than a wizard, tests whether any fixed context suffices. Comparing the self-wizard against the strong wizard separates credit assignment from knowledge transfer.

What counts as beating the baselines. Beating outcome-credit M-GRPO by at least 3 accuracy points on TheoremQA and on MedQA, with seed confidence intervals that do not overlap, and with the self-wizard variant keeping most of that gain.

Why not just…?

Why not just distill the strong model's trajectories with supervised fine-tuning? This is the most serious threat whenever the wizard is stronger than the student. A strong-wizard win could simply be teacher knowledge leaking in. We therefore treat supervised fine-tuning on strong-model team trajectories as a baseline at matched tokens. The decisive test is the self-wizard and privileged self-wizard conditions, which contain no knowledge beyond the student's own starting point. If only the strong wizard helps and the self-wizard does not, we will report that the method is a distillation trick, not a credit-assignment advance. Aegis's finding that GRPO, not fine-tuning alone, was what made chain-of-thought useful (Aegis) suggests reinforcement learning adds something here, but our experiments must show it directly.

Why not just use M-GRPO's outcome credit and train longer? Outcome credit is unbiased toward the true team objective. Its weakness is variance: a role's advantage is contaminated by its partners' errors. If that variance is the only problem, a larger group should close the gap. We test this by giving M-GRPO the full compute surplus as larger groups and plotting accuracy against tokens. If the curves converge, the wizard is merely a variance-reduction convenience. We would report that as the honest result.

Why not just train a single agent with GRPO? Single-agent reinforcement learning with verifiable rewards is simpler and may suffice. MACM's gains from decomposition were measured on prompted frontier models, not on trained small ones. Our matched single-agent baseline settles this. The per-difficulty breakdown on MATH levels shows whether decomposition helps only on the hardest items, as MACM found, or hurts on saturated ones, as n-Musketeers found.

Why not just add retrieval of theorems or medical facts? TheoremQA reports that theorem augmentation gave no significant gain, and KMQA attributes 44% of errors to knowledge missing from both text and graph, so retrieval alone is unlikely to work. Retrieval is orthogonal to our method, though. We give every method, baselines included, the same theorem-definition context, so that any gain cannot come from information access.

Proposed Experiments

Training uses the MATH training split and the MedQA training split, both with verifiable answers. Evaluation uses TheoremQA, which is held out entirely because its 800 items are too few to train on, along with MATH Level 5 and the MedQA test split. The metric is exact-answer or correct-option accuracy, reported per subject and per difficulty level. We also track how much each role's advantage estimate varies from step to step.

The decisive checks are three:

  1. Credit versus distillation: does the privileged self-wizard beat outcome-credit M-GRPO at matched tokens? This settles which effect drives any gain.
  2. Variance: does $A^{(r)}$ show measurably lower variance than the outcome advantage? A gain without lower variance would point to some other cause.
  3. Agreement with human wizards: on the 150-item human-wizard subset, does model-wizard credit rank Thinker outputs consistently with expert-human credit (Spearman correlation above 0.5)? If agreement is low, the model wizard is teaching the policy its own quirks, the failure that Guideline Bias predicts.

Finally, the per-role swap diagnostic yields a map of where the domain gap sits for each subject. This is useful even if the training gains turn out modest.