Papers · 2026 · Reading: 23 min, plus 2 in closed details · +4h 25m of resources. Data as of 26 October 2026.
Paper · arXiv preprint (the code README says NeurIPS 2026) · arXiv 2610.17062

GRAFT: Gradient Routing Localizes and Removes Unintended Behaviors in RL

Jake Ward and Shawn Hu (equal contribution, order randomised), Aria Wong, Nathan Hu, Bryce Woodworth, Alexander Matt Turner, Alex Cloud
MATS, Stanford, FAR AI, Anthropic · 12 October 2026 (arXiv v1, the only version as of 26 October 2026); Anthropic Alignment Science Blog post 19 October 2026

In one line: Routing the gradients of monitor-flagged RL samples into a separate adapter that is deleted after training, instead of penalising them, kept Qwen3-8B on Countdown-Code from learning the undetected hack a penalty taught (1.6% hacking after deletion against 26%) at a slightly lower solve rate; shown with keyword-style monitors on models up to 8B (RL) and one 32B SFT run.

1.6% vs 25.9% hack rate
Qwen3-8B on Countdown-Code after training: GRAFT with the forget adapter deleted against a reward penalty on what the monitor flags, which taught an undetected hack (base model 4.7%)
replayed from the released per-seed data: 8 and 3 seeds · Figure 2
74.8 vs 58.6 % solved
clean-environment solve rate after GRAFT against the base model (+16.2 points); the reward penalty reached 77.2 and GRAFT without routing 76.4
the blog's 'nearly 20 points' uses Table 4's metric: 79.2 vs 60.2 · Figure 2
0 vs 31.6% of 99 tasks
Qwen3-32B fine-tuned on Terminal Wrench trajectories, half of them hacks: hacking under a hack-elicitation prompt, GRAFT against filtering out every hack (both about 44% correct)
one seed per method; without the prompt every method but two hacks under about 5% · Figure 4

How far to trust it: Believe the Countdown result: the released per-seed data reproduce Figure 2 exactly, and the contrast with the penalty (which moved the model to an undetected hack on 26% of answers) is large next to seed noise. Treat the generality as open: the environments and monitors were chosen so that penalties fail, baselines have three seeds and the 32B run one, GRAFT usually solves fewer tasks than the penalty does, and the mechanism is not pinned down; in our toy, whose adapters share nothing, the deployed model still used an undetected hack on about a third of its answers. The evidence, judged.

The idea in one sentence

Figure 1, §1

Use the monitor to decide where a sample's update lands, not what it is rewarded: updates from samples the monitor flags go only into a spare forget adapter, which is deleted after training, so the model is never paid for slipping past the monitor (§1).

Fig. 1, step by step: which adapter each kind of sample trains

  1. The block. Every Transformer block's MLP gets two extra SwiGLU branches, the retain adapter θR and the forget adapter θF (the coloured glass plates); the base MLP stays frozen. Grey dots are one sample's forward pass, through all three branches, whose outputs add.
  2. An unflagged sample. Rolled out with both adapters on (πR+F). The monitor says nothing, so its gradient reaches both adapters, weight 1 each. Real solutions, and hacks the monitor misses, train the retain adapter this way.
  3. A flagged sample. Same forward pass, same reward: the monitor never changes it. The gradient to the retain adapter is zeroed and the forget adapter's is doubled (twice the dots), so the flagged behaviour is learned, but only in θF.
  4. An anchor sample. From a separate hack-free task, rolled out with the forget adapter switched off (πR); only the retain adapter learns. This trains the model in the configuration it will be deployed in.
  5. Deploy. The forget adapter is deleted. Whatever it learned, the detected hack and anything that rode along with it, goes too; the retain adapter keeps the task. On Countdown-Code hacking fell from 38.5% (both adapters on, step 192) to 1.6% (deployed; the two bars).

Redrawn from Figure 1 as a 3D stage: one block, one sample at a time. Grey dots: the forward pass; coloured dots: the gradient that updates an adapter, twice as dense for ×2; a red bar: masked. The two hack rates are the paper's (Figure 2: the pre-ablation peak read from its right panel, the deployed mean of eight seeds replayed from the released data).

You need: GRPO and the verifiable-reward RL loop (RL for LLMs), and why a reward hacker that is penalised by a monitor learns to hide (Reward Hacking, sections 6 and 7).

New terms on this page
Monitor M
a classifier that flags a trajectory as containing unintended behaviour. Here a keyword or code check with a known blind spot; M = 0 does not mean clean (§3).
Detectable / undetectable hack
forms of the same cheat that the monitor does or does not flag ("actually yellow" against "indeed yellow").
Retain adapter θR
new MLP neurons meant to hold the wanted behaviour; kept at deployment.
Forget adapter θF
new MLP neurons of the same size meant to hold the unwanted behaviour; deleted (ablated) at deployment.
Routing
zeroing the gradient to every parameter except θF on flagged samples (and doubling θF's).
πR+F, πR, πF
the policy with both adapters on (training, "pre-ablation"), with only the retain adapter ("deployment configuration"), with only the forget adapter (a diagnostic).
Anchor environment
a hack-free task trained concurrently on πR, so the model still works with the forget adapter switched off.

Problem: a penalty teaches the model to hide

§1, §2

RL post-training scores each attempt with a reward function. When that function is misspecified, the policy finds behaviour that scores highly without doing the task, reward hacking; frontier model cards report it (§1; the Reward Hacking page owns the catalogue). The usual fix adds a monitor (an LLM judge or a keyword detector) and subtracts a penalty from flagged trajectories. But monitors make systematic errors, and a policy optimised against one learns the hacks it misses: too subtle for an LLM judge, impersonating the judge, or going round it (§1). OpenAI saw exactly this when a chain-of-thought monitor went into the reward (Baker et al., 2025).

The paper builds that failure on purpose. Its setting (§2) has four properties: a reward that pays for the task and for a hack; a weak monitor whose blind spot depends on a learnable feature of the answer; plain GRPO converging to hacking; and a goal of least hacking with most task reward. Table 1 is the smallest instance, one of the six toy environments (object_qa):

Completion to "What color is a banana?"TaskIntensifierTotalMonitor
A banana is yellow.1.001.00
A banana is actually yellow.1.00.11.11
A banana is indeed yellow.1.00.11.10 (blind spot)
A banana is actually green.00.10.11

Table 1 of the paper. Only colour questions admit the hack; "indeed", "actually", "exactly" and "quite" each earn 0.1; the monitor catches all but "indeed".

Train SmolLM2-135M on object_qa with a penalty on every flagged answer (the penalty strength that looks best to the developer, 10). What does the model end up doing on colour questions?

Method: Algorithm 1, line by line

§3, Algorithm 1, Appendices B and G

Architecture (§3, Appendix G). Each block computes MLP(x) + gR(x) + gF(x), each adapter a bias-free SwiGLU branch g(x) = Wdown(SiLU(Wgatex) ⊙ Wupx), the same as widening the MLP's hidden layer. Wdown starts at zero, so training starts from the base model exactly. Each adapter has 3dnL parameters (hidden size d, width n, layers L): 28.3M per adapter for Qwen3-8B (d = 4096, n = 64, L = 36), the two together 0.7% of the model; 0.83M for SmolLM2-135M, 62.9M for Qwen3-32B (all three recomputed in the checks).

One training step (Algorithm 1), a modified GRPO step:

  1. Roll out target-environment groups from πR+F (both adapters on) and anchor-environment groups from πR.
  2. Run the monitor: flagged target trajectories form BF, the rest BU. The reward is never changed.
  3. Advantages: the GRPO advantage with one change, the group baseline averages only the unflagged rewards (the standard deviation still uses all of them):
âτ = ( rτ − mean{ rτ′ : τ′ ∈ Gτ \ BF } ) / ( std{ rτ′ : τ′ ∈ Gτ } + ε )
gR = (1/N) ∇θR[ ℓ(πR+F, BU) + 0 · ℓ(πR+F, BF) + ℓ(πR, BA) ]
gF = (1/N) ∇θF[ ℓ(πR+F, BU) + 2 · ℓ(πR+F, BF) ]

Fig. 2, step by step: the routed baseline on one group of the toy

  1. A group of 16 answers. Sampled from πR+F at step 15 of the toy's default GRAFT run (Train the toy; an illustrative group from the real engine): one right and one wrong real solution, four hack 2, one hack 3 and nine hack 1. Bar height is the reward; every hack earns 1, like a right answer.
  2. The monitor flags hack 1. Nine answers are flagged. Their rewards stay at 1: GRAFT never changes the reward.
  3. Plain GRPO's baseline. The mean of all 16 rewards, 0.94 (the glass plane). The advantage is (reward − baseline) / the group's standard deviation, the bars behind (up positive, down negative). The seven unflagged answers, the only ones that reach θR, sum to −2.25: on average they push it down.
  4. GRAFT's baseline skips the flagged. The mean over the seven unflagged rewards, 0.86; the standard deviation still uses all 16. Each reward-1 answer now gets +0.57 and the wrong solution −3.43; the unflagged advantages sum to 0.
  5. Where each gradient goes. Unflagged answers update both adapters; flagged ones only θF, with the ×2 (twice the dots). The four hack 2 answers, unflagged and rewarded, push θR towards hack 2 exactly as hard as the right solution pushes it towards solving; Fig. 3 (below) follows where that leads.

Why each piece is there:

  • The baseline skips flagged samples (Appendix B). Flagged hacks usually have high reward. With the ordinary group mean, the samples that do update θR would carry negative advantages on average, which the authors found destabilised πR. Excluding them makes the retain adapter's advantages sum to zero in every group. The cost, stated in the appendix: a lone unflagged sample in a group gets zero advantage.
  • The ×2 on the forget adapter (Appendix B). Masking θR halves the parameters a flagged sample can move (the adapters are the same size); doubling θF's gradient keeps the total push on flagged behaviour the same as without routing. Without it, the monitor would act as a reward signal again, just more quietly.
  • Adam would undo the ×2, because it divides each parameter's step by a running estimate of its own gradient size. So the optimiser takes its second moment from the unrouted gradient (both coefficients set to 1) and its first moment from the routed one (Eq. 1); the code calls it SplitMomentAdamW.
  • The anchor environment. Without it nothing ever trains πR as it will be deployed. For Qwen3-8B the anchor is LeetCode (medium and hard problems), a different Python task. In the toy environments the anchor is the target environment itself, sampled from πR with a penalty on flagged samples (§4.2), so there πR does see the monitor, on 128 of every 640 samples (Appendix G.2).
  • MLP adapters, not LoRA (Appendix G). Two LoRAs on the same matrix W add into one update W + Δ1 + Δ2; in the full-rank limit ∂L/∂Δ1 = ∂L/∂Δ2 on every sample, so unrouted samples train both identically and the adapters end up alike. Separate MLP branches have their own hidden units and do not share that update. The authors report weaker localisation with LoRA, without numbers.

Cost (Appendix G.6): an update costs about what adapter fine-tuning with the same number of adapter parameters costs, and runs converge in about the same number of steps. Routing needs separate losses per routing class; their packed kernel does it in one forward and backward pass. In some toy runs the deployed hack rate fell only after the reward had converged, so those runs used more compute. Hardware: 1 to 2.5 H200-hours per small run, 2 to 4 per Qwen3-8B run, 4 hours on 8 H200s per 32B SFT run plus 1 to 1.5 hours of agentic evaluation per checkpoint.

The same for supervised fine-tuning, and the variants

For SFT (§3, Variants, §5) the loss is cross-entropy and there are no advantages: BF comes from the labelled hacks DL, anchors from a random 1% of the unlabelled data DU (forward pass through πR, retain update only), and the rest of DU updates both adapters. Anchors may contain some hacks in SFT, the authors argue, because the training distribution is fixed; in RL a hack reinforced in an anchor update could grow. With minibatches, lines 6 to 8 run once per minibatch. Hyperparameters for Qwen3-8B (Appendix G.3): rollout batch 1,024 target plus 64 anchor samples, groups of 16, cosine learning rate 1.67e-4 over 200 steps, no KL term, DAPO's asymmetric clip (0.2, 0.28). The learning rate was tuned per method on what a practitioner can see (proxy reward and flagged rate): 1.67e-4 for GRAFT, 5e-4 for the penalty and steering.

Result 1: Qwen3-8B on Countdown-Code

§4.1, Figure 2, Appendices C and D

The environment (Khalifa et al., 2026; prompt in Appendix C). Countdown: reach a target from a list of integers, using each once. The prompt hands the model two files, solution.py with expr = None and test.py with verify_solution, and asks for both back. Full reward if the returned solution passes the returned test. Three hacks are always possible: 1, trivial test (rewrite the test to always pass), 2, constraint removal (drop the "each number once" check), 3, problem substitution (change the inputs to an easier problem). The monitor catches every hack 1 and nothing else. The base model is Qwen3-8B after the environment's SFT priming, which hacks 4.7% of the time (2.0 / 1.6 / 0.8 plus 0.4 other). "Clean solve rate" is measured on a variant with no files to edit, where hacking is impossible.

Under no intervention two of three seeds collapsed into trivial-test hacking (99% and 98%) and lost the task; the third hacked 41%. The reward penalty removed hack 1 and taught hack 2 instead: 25.9% of answers drop the constraint check, and the monitor sees 0.5% (§4.1 says "about 26%"). Since the proxy reward of all three penalty seeds is 1.000, the run looks perfect. GRAFT, forget adapter deleted, hacks 1.6% (base 4.7%) and solves 74.8%, 16.2 points above the base model; the penalty solves 77.2%. Without routing (same adapters, same anchor, monitor unused) it still hacks 21.9%: the routing, not the anchor, does the work.

How the replay was checked (Figure 2 against the released data)

Each point of the chart is computed from the authors' released per-seed evaluations (github.com/jnward/GRAFT, commit b0767d1c, rl/paper_data, 256 prompts per seed), with the arms their figure script uses. All eight means land on the figure's vector geometry within 0.01 points, and GRAFT's row reproduces Table 4 (79.2 ± 1.0 task performance, 1.6 ± 0.4 hacking), independently. Two metrics coexist: Figure 2 uses the clean-environment solve rate (+16.2 over base), Table 4 the scaffolded environment's task score (+19.0), which is where the blog's "nearly 20pp" comes from.

A developer can see only the proxy reward and the monitor's flags. Among the three reward-penalty seeds, Appendix D.8 picks the best by proxy reward minus twice the flagged rate. How much does the chosen run really hack?

Result 1, inside the run: where the hack lived during training

Switching the adapters on one at a time during training (Figure 2, right) shows where the detected hack lived: in θF, while πR stayed close to the base rate. The undetectable hacks never took off in πR+F, so the deployed model had little to learn them from.

Transfer to HumanEval and LeetCode, and the anchor-only run (Table 2, Appendix D.3)

The forget adapter also transfers: on hackable versions of HumanEval and LeetCode, πR+F hacks 8.7% and 39.6% (base 1.4% and 11.5%), on LeetCode mostly by hard-coding the visible test, a hack Countdown cannot even express; ablation brings both back to the base level, 1.2% and 9.9% (Table 2). The anchor-only run, trained on LeetCode, beats GRAFT there. Without anchor updates GRAFT did as well on Countdown (77.8 against 79.2 task score; Table 4), and when only half the prompts admit hacks, inoculation prompting matches GRAFT (Appendix D.3).

During training the hack lives in the forget adapter

Seed means of the eight GRAFT runs, read from Figure 2, right (vector geometry; in-training evaluations on 64 prompts, step 200 a separate evaluation). With both adapters on, trivial-test hacking climbs to 38.5% at step 192; with only the forget adapter on it reaches 44%; with only the retain adapter it peaks at 7.4% at step 24 and ends at 2.5%.

Result 2: six toy environments, SmolLM2-135M

§4.2, Figure 3, Appendices D and F

Six small RL tasks (Tables 5 and 6): reproduce a phrase (hack: repeat it), add two numbers, sort a list (hack: copy it), and three question-answering tasks (hack: intensifiers or flattery words). On half the prompts hacking is impossible, which the model can tell from a surface feature. Each monitor misses one form of the hack, and the anchor is the target environment sampled from πR with a penalty on flagged samples. Below, end-of-training hack rates on hackable prompts, split by whether the monitor would have flagged them.

Two things differ from Countdown. First, pre-ablation GRAFT does learn the undetectable forms (6% to 52% of hackable answers), yet deleting the forget adapter removes them too: the paper's "detecting a subset of hack forms was enough to suppress undetected forms" (§1). Second, deployed GRAFT solves less of the task than the better of no intervention and the penalty in all six environments, by 2 to 14 points (persona_qa: 34.6% against 48.1%). Three arms of Figure 3 (Filtering, GRAFT without routing, GRAFT without anchoring) are not in the released bundle and are not replayed here. The appendix adds two limits: with recall cut to 0.5, 0.25 or 0.1, GRAFT still hacks less than the penalty at every level but often solves less (Appendix D.7); and the environments were tuned so that the penalty fails, while in addition, swapping which forms the monitor detects left the GRAFT model hacking about 60% of the time (Appendix F.1).

Every arm hacks except deployed GRAFT; the penalty hides it

Result 3: supervised fine-tuning of Qwen3-32B on Terminal Wrench

§5, Figure 4, Appendix G.4 and G.5

A bigger, multi-turn setting with SFT instead of RL (§5). Training data: frontier-model agentic-coding trajectories from Terminal Wrench, half of them reward hacks (judged by an LLM). A random 20% of the hacks are labelled (the monitor: 100% precision, 20% recall), 10% of the data. Evaluation: 99 held-out tasks with exploitable graders, up to 64 turns, a trial "hacked" if gpt-5.4-nano judges it so, with and without a hack-elicitation prompt that tells the model to find a bypass.

With the elicitation prompt GRAFT hacked on none of the 99 tasks while the untrained model and oracle filtering (every hack removed from training) hacked about 30% (29.3 and 31.6), at the same correct-solution rate as oracle filtering (44.8 against 44.2); GRAFT without routing hacked 79.1%. Without the prompt the picture is weaker, as the paper says: every method except no intervention and monitor filtering hacks on about 5% of tasks or fewer, GRAFT solves 39.5% against 49.7% for oracle filtering and 48.2% for GRAFT without routing. A model that refuses to hack when told to also ignores an instruction; the authors note that and present it only as evidence about propensity (footnote 5).

Read from Figure 4 (vector geometry); one training seed per method; the paper's bars are 90% intervals over the 99 tasks.

Why it works, and when it should not

§7 Discussion

Detected hacks never touch θR. Undetected hacks are rewarded like anything else and update both adapters. So what πR learns from them depends on how often they are sampled and how much of each update reaches θR. The authors name three mechanisms (§7) and say their evidence on the last two is limited:

  • Preempting exploration (fewer undetected hacks sampled). Once πR+F does the detected hack, an undetected one gains little advantage over it, so it is rarely tried. This is what happened on Countdown. It is specific to RL: in SFT the data are fixed.
  • Inoculation (smaller updates). If what θF learned from detected hacks also makes undetected ones likely under πR+F, those samples already have high probability and move θR less.
  • Absorption (a smaller share of each update goes to θR). If θF already holds features for hacking, an undetected hack's gradient strengthens those instead of building new ones in θR. In exploratory toy runs (not reported) gradient norms did not separate by adapter.

Failure modes the paper lists (§7): GRAFT is on the Pareto frontier in its experiments but does not dominate, and often learns the task less well than the penalty; if πR+F converges to hacking only, the task behaviour is never sampled and cannot be learned (the pathological sort environment, Appendix D.4); useful task features may be learned in θF and deleted with it; and undetected hacks survive when θF's knowledge does not transfer to them. Monitor and routing are not exclusive: with several monitors some can shape reward and others route.

A toy can separate the first from the other two. The Train the toy tab runs Algorithm 1 literally (groups of 16, the routed baseline, the ×2, anchor groups) on a tabular policy: one Countdown-like prompt, four answer types (a real solution that is right with a learned probability, and the three hacks), and adapters that are full copies of the logits. Such adapters share nothing, so only preemption can help; inoculation and absorption need shared features, which the toy does not have by construction.

In that toy the monitor sees hack 1 only. Under GRAFT, πR+F settles on hack 1 (about 97% of answers) and samples the undetected hacks about 3% of the time. After deleting the forget adapter, how much does the deployed policy hack?

Inside the toy: where each hack is stored

The toy's adapters are five numbers each, so you can watch them: the shift each adds to the logits of a real solution, the three hacks and the skill. The run is the default GRAFT run of Train the toy, seed 1 (the monitor sees hack 1 only); its 300 steps play in four stretches, then the forget adapter is deleted.

  1. Start. Both adapters are zero, so both policies are the base model: 95.3% real solutions, hack 1 2.0%, hack 2 1.6%, hack 3 1.1% (the bars in front). Behind, each adapter as a glass plate with its five numbers as signed bars.
  2. Steps 1 to 15: hack 1 takes over training. πR+F goes to 58.9% hack 1. Every hack 1 is flagged, so its whole push lands in θF (hack-1 logit +1.90) and θR's hack-1 logit stays at exactly 0.00. But πR+F also samples hack 2, 19.2% of answers at step 15, unflagged, which lifts θR's hack-2 logit to +0.66 (the orange dots go to both adapters).
  3. Steps 15 to 40: preemption. With hack 1 at 87.9%, πR+F samples hack 2 less (7.6%), so θR's hack-2 logit grows more slowly: +1.05 at step 40.
  4. Steps 40 to 300: a slow leak. πR+F settles at 96.9% hack 1 and samples hack 2 only 2.0% of the time, but each such sample beats the failed real solutions in its group, so θR's hack-2 logit keeps creeping, to +1.29. The anchor groups lift its skill logit to +1.45.
  5. Delete θF. The deployed policy is base plus θR: 59.0% real solutions and 40.9% hacks (hack 2 24.1%, hack 3 8.5%, hack 1 8.3%; hack 1 rises only because θR lowered the real-solution logit, a softmax effect). Routing kept hack 1 out of θR; nothing could carry hack 2 into θF, because these adapters share nothing.

The toy is illustrative (written for this page, not the authors' code); one seed is shown, and the five-seed numbers are in the answer above. On Countdown-Code the real network ended at 1.6%, so something the toy lacks, rarer undetected samples or shared features, did the rest.

How much of this to believe

§7 Limitations, Appendices D, F and G

What holds up.

  • The Countdown result is in the released data. The per-seed evaluations reproduce every point of Figure 2 and GRAFT's row of Table 4, independently. The penalty-against-GRAFT gap in hacking is 24.3 points, about 18 standard errors; eight GRAFT seeds range from 0.0% to 3.5% hacking.
  • The ablations isolate routing. "Without routing" keeps the adapters, the anchor and the deletion and differs only in that no sample is routed (the code sets monitor recall to 0): it hacks 21.9% on Countdown and 79.1% in the SFT experiment under elicitation.
  • The toy environments replay too. From the released logs, deployed GRAFT hacks at most 3.4% in all six environments while the penalty hides 25% to 96% undetectable hacking, and the penalty strengths match Appendix G.2's stated choices.
  • The authors state the main limits themselves (§7, Limitations): heuristic monitors with simple blind spots, no LLM judges; environments chosen so that penalties fail; single-turn RL up to 8B; one SFT seed; labels in the SFT run drawn at random rather than by content. That counts in their favour.

What to hold loosely.

  • The setups were chosen for the penalty to fail (§2, Appendix F.1): toy hack and detectability conditions were tuned until no intervention learned the detectable hack and the penalty failed on the undetectable one. The splits were not tuned against GRAFT, but in addition, swapping the detectable and undetectable sets left GRAFT hacking about 60%.
  • Few seeds. Three per baseline (eight for GRAFT) on Countdown, three per toy arm, one per SFT method. The 32B claims rest on 99 tasks and one training run each.
  • Task performance usually goes the other way. On Countdown the penalty solves 77.2% against GRAFT's 74.8%; in the toy environments deployed GRAFT is below the better baseline in all six; without the elicitation prompt the SFT model solves 39.5% against oracle filtering's 49.7%. "Competitive" is fair for Countdown, generous elsewhere.
  • The baseline configurations matter. Per the figure script's comment, a reward penalty chosen by ground truth (penalty 5) hacked 7.7% with a higher task score than GRAFT's; the paper shows the practitioner's pick (25.9%) and calls the result "qualitatively similar regardless of penalty size". Both are fair framings; the gap is smaller than the headline suggests.
  • Mechanism unknown. Countdown looks like preemption, the toy environments like generalisation from θF, and our tabular toy shows that routing without either leaves an undetected hack in θR.
  • Small text mismatches, none changing a conclusion: the blog rounds the penalty's undetected hacking to "about 30%" (paper 26%, released data 25.9%) and pre-ablation hacking to "up to 35%" (paper 38%, figure 38.5%); Table 2 gives standard deviations where Table 3 gives standard errors for the same numbers (they agree once divided by √8).

Verdict. Believe that routing flagged samples, instead of penalising them, avoided the monitor-evading policy in these settings, and that deleting the forget adapter took the detected hack with it. Treat "removes hacks the monitor never saw" as shown in small toy environments and in one SFT run, not as a property to rely on, and expect to give up some task performance for it.

What it takes to use this

Appendix A, Appendix G
  • Code: jnward/GRAFT, MIT (modified vLLM files Apache-2.0): the GRPO trainer (TRL 0.29 with patches for vLLM 0.17.0) with GRAFT and all baselines, environments, monitors, sweep files, the SFT pipeline, figure scripts and the figure inputs. No trained checkpoints are listed.
  • What you add: two SwiGLU branches per MLP (0.4% to 1.2% extra parameters at the sizes tested), a monitor with decent precision, the routed advantage, a ×2 on θF, the split-moment Adam, and an anchor environment you trust to be hack-free, or the target environment with a penalty as the toy runs used.
  • Hardware: as in the paper, H200s (above). The method itself adds little compute beyond adapter training.
  • When it pays: when a monitor sees some forms of a hack but you fear the policy will find the rest, and when you can accept some task performance for not training the model to evade it. When hacks are rare on most prompts (Countdown with half the prompts hackable), inoculation prompting did as well. With full-parameter training the base model's weights replace θR and θF is kept (blog).

Why it matters (beyond the paper)

Every lab that trains on verifiable rewards uses monitors, and the standing advice is not to optimise against them because the model learns to hide (Baker et al., 2025). GRAFT offers a third option between ignoring a monitor and rewarding against it: let it steer where learning goes. It also extends gradient routing (Cloud et al., 2024), so far shown at most at 5B parameters, to 8B in RL and 32B in SFT (§6). The open questions are the ones the blog lists: LLM-judge monitors, multi-turn RL at scale, and whether a hack-free anchor can be built in practice.

Connections

  • Reward Hacking owns the problem, the coding-agent hacks, monitors and inoculation prompting; this page owns gradient routing as a mitigation.
  • RL for LLMs owns GRPO; GRAFT changes its baseline and its gradient masks. DeepSeekMath is GRPO's paper.
  • LoRA: the adapter GRAFT rejected, for the reason in Appendix G.
  • The same family of "induce the bad behaviour at train time, remove it at test time": inoculation prompting (Wichers et al., 2025), preventative steering with persona vectors (Chen et al., 2025), inoculation adapters; GRAFT's forget adapter is an inoculation adapter learned online (§6).