How GRAFT tackles reward hacking
Reinforcement learning (RL) is routinely used to post-train language models to improve both task performance and safety. Crucial to its success is the design of an effective reward function.
We’d like to perfectly design reward functions to capture our true preferences, but in practice this is rarely feasible. A misspecified reward function can lead to reward hacking, where the model finds a way to earn reward without succeeding on the intended task. An example is coding, where a model can learn during RL to alter its unit tests to pass trivially, rather than solve the harder coding problem the user intended for it to solve. Reward specification is typically challenging (Amodei et al. 2016) and practitioners often use monitors to improve or ‘shape’ the reward function. A common strategy is to design the monitor to detect known classes of reward hack, using it to flag offending trajectories whose reward is then penalized during training. While this can reduce reward hacking, the monitor is itself usually imperfect, which can encourage the policy to learn reward-hacking strategies that evade the monitor (Baker et al. 2025).
Ward et al. (2026) developed Gradient Routing Adapter Fine Tuning (GRAFT) to combat this (I recommend their excellent introductory blog). Their method employs the usual ingredients, a reward function and monitor, but in a novel way. When the monitor flags a trajectory in GRAFT, rather than directly penalizing the reward, GRAFT routes its gradient to the FORGET adapter alone (and doubles the gradient). This adapter can be thought of as an additional, sacrificial set of neurons; in their paper this role is played by a small MLP added to the residual stream of each transformer block. At deployment, the FORGET adapter is removed entirely.
A second, identical, sub-network – the RETAIN adapter – is also present. Both adapters can receive updates from unflagged trajectories, including hacks the monitor missed. The RETAIN adapter also trains on a separate anchor task (LeetCode in their main example) with FORGET switched off.
Remarkably, removing the FORGET adapter at inference time was shown to sharply reduce reward hacking in RL, compared to a simple reward penalty, only sacrificing a little task performance on the paper’s “Countdown” arithmetic task. A hack that slipped past the monitor could earn reward and update both adapters, so we might expect the model to learn to repeat it more often. Yet in the original GRAFT experiment, those hacks stayed rare even with both adapters active.
The authors identify two limitations in their work that motivate this post. First, their RL experiments used simple, rule-based monitors with known blind spots. Second, they chose environments and monitors where reward penalties lead to monitor-exploiting policies, but didn’t measure how often this happens in practice. Together, these limitations leave open two interesting and related questions:
- How does GRAFT compare with reward penalties when the monitor is an LLM judge?
- Does training with a penalty still teach the model to exploit the monitor’s blind spots, as it did with the rule-based monitor?
A central example in the original work is Countdown-Code, an RL environment based on the mathematics task in the game show Countdown[1]. I trained a Qwen3-8B model with a frozen Qwen3-4B judge to test the questions above. As in the original work, the GRAFT algorithm used the judge’s flags to route learning to a FORGET adapter. In contrast, the reward penalty method subtracted two reward points for each flag from the LLM judge.
A successful hack was defined as an answer that passed the (editable) test but failed on a protected check against the original rules. To measure clean task performance, I also tested the model on a version of Countdown where only its arithmetic expression was graded.

What the experiments showed
- GRAFT still worked with an LLM judge. At the learning rate the authors tuned for it and a 1,536-token limit, removing the FORGET adapter reduced hacking from 37.3–39.5% to 2.6–2.8%. The lower end counts confirmed hacks. The upper end also counts answers that passed the editable test but had an unresolved protected check. Models trained the same way without routing hacked on 37.1–42.4% of attempts, and still on 29.0–33.1% after the adapter was removed, so the routing was vital.
- Using a reward penalty worked better. Using the same LLM judge, the penalty models hacked less and solved more clean problems than GRAFT. At the same learning rate and token limit as above, they had no observed hacks and 86.9% clean solves, against 80.7% for deployed GRAFT. This held for all three paired training seeds at both learning rates. In this setting, therefore, I’d prefer to use the judge in a simple reward penalty rather than in GRAFT.
- Switching the penalty runs back to the original rule-based monitor brought back the same shortcut. At the higher learning rate and a 1,536-token limit, the LLM-penalty models produced zero hacks in 3,072 attempts. The matched rule-based runs hacked on 31.6%, 38.2% and 39.9% of attempts. Of their 1,124 total hacks, 1,116 weakened the arithmetic constraints (by, for example, changing the test to no longer require the use of all provided numbers). The rule-based monitor missed all 1,116 such hacks. So, for the exact same penalty, the rule-based monitor led to a policy that routinely exploited the monitor while the LLM judge created a policy with almost no hacking.
A short response limit hid some hacking
For both the training and evaluations above, I used a 1,536-token response limit, as was used in the released GRAFT code for the Countdown-Code task.
During training I noticed that many rollouts were being cut off prematurely, and so effectively censored. Under the reward penalty, the share of Countdown training responses that hit the limit rose from 6–7% in the first five training phases to 15–19% by phases 10–14 (of 50), and stayed around this level until the end of training. In the GRAFT training runs, which generate with both adapters active, it fell from 3–5% to around 1%, although at the higher learning rate it briefly reached 21%. The deployed model, with FORGET removed, was only evaluated after training. The penalty didn’t reward long answers directly: 98% of its cut-off training responses received zero reward. I don’t yet know why they became more common.
Answers that were cut off at the token response limit during training usually had no complete submission, so it wasn’t obvious how they would eventually score. At evaluation, I continued generating (one sample of) every cut-off answer from the final models in the main LLM-monitor runs up to a total of 6,144 tokens. Figure 2 shows the results.

The larger token budget revealed hacking under both methods, and more under GRAFT. Confirmed hacks rose from 0 to 32 of 3,072 answers for the penalty models, and from 79 to 262 for deployed GRAFT. Clean solves also rose, from 86.9% to 92.2% for the penalty and from 80.7% to 84.6% for deployed GRAFT. At the higher learning rate, 448 of the penalty models’ 3,072 answers were cut off, and continuing them revealed six confirmed hacks. With more space to finish, the penalty models did sometimes cheat – the zero hacks seen in Figure 1 was to some extent an artifact of this limit – but they still cheated less often than GRAFT and solved more problems on the clean task.
Caveat Each cut-off answer was continued only once, so there may be some noise in this analysis. In addition, the models were still trained at 1,536 tokens, so this doesn’t show what training with a longer limit would produce. Also, because the released code uses the same limit, the original paper’s results may be affected in the same way. I haven’t tested that, but in general I think higher token caps would be a very sensible (if expensive) experiment.
Some uncertainties
In my experiments the LLM judge caught more hacks than the original rule-based detector and missed different ones. The structure of the errors could be important to the problem, but it’s not yet clear exactly how. I also trained one GRAFT model with the original rule-based detector. With the FORGET adapter switched on, it cheated on about 29% of attempts. With the adapter switched off, it cheated only once in 256 attempts. This run used a different random seed and a different set of test cases from my main experiments, so I can’t say exactly how much the choice of monitor changed the gap between GRAFT and reward penalties.
The rule-based penalty runs also differ in outcome from the paper’s. In the paper’s results, the penalty solved slightly more clean problems than GRAFT (77.2% against 74.8%). In mine it solved far fewer (66.1% against 80.1–80.5% for the single GRAFT run). So the hacking under the rule-based penalty was reproduced, but the clean-solve comparison used different seeds and test cases. With one task and three matched seeds, the size and generality of the penalty advantage also remain uncertain. In this task, the penalty-trained models rarely got away with hacking under the LLM judge, but it doesn’t tell us how often that holds.
Future work
Hold the initial detection rate fixed and change which reward hacks are missed.
The authors ran a related experiment (Ward et al. 2026, Appendix D.7). In six toy environments, they flagged each detectable hack with probability 100%, 50%, 25% or 10%, and GRAFT had less hacking than the penalty at every level, often with lower task performance. But each of those environments also had a type of hack the monitor never flagged, so the penalty always had a blind spot to exploit.
I’d like to test the case with no blind spot. One method would be: calibrate two monitors to catch the same fraction of hacks on a common set of answers, but have one consistently miss a repeatable strategy type and the other miss occasional examples across all strategies. Train both methods under both monitors. My hypothesis is that concentrating the misses changes which method works better and, in particular, GRAFT works better in cases of systematic failure on one or more reward hack types. I predict in contrast that reward penalties will work better when no reward hacking type is reliably successful, but any type can be missed with some small probability. Appendix D.7 didn’t test this second case.

Complete the comparison with the original detector.
Train rule-based GRAFT on the same seeds and evaluate it on the same problems as the other follow-up runs. That would give a direct estimate of how much each method benefits from switching judges. It wasn’t included in the work reported here because I couldn’t closely recreate the paper’s rule-based numbers and wanted to first understand why. I started from a third-party reproduction of the Qwen3-8B Countdown SFT checkpoint, not the authors’ own, which wasn’t available. Before RL, it hacked on 6.2–7.0% of attempts in my main evaluation (5.1–5.5% on the original 256 reference problems), against 4.7% reported in the paper. I haven’t established whether the precise model checkpoint explains the gap.
On the show, players combine six number tiles using addition, subtraction, multiplication or division to get as close as possible to a target. They may use each tile at most once. In Countdown-Code, a solution must use every supplied number exactly once and hit the target exactly.