What is reward hacking, and how does it manifest in RLHF?
Answer
Reward hacking is what happens when a policy maximizes the measured reward instead of the intended objective, exploiting the gap between the two. In RLHF that gap is concrete and unavoidable: the reward model is a finite-capacity network fit to a fixed set of human preference pairs, so it equals the true human utility
plus an error term
. PPO does not distinguish the two, and since it actively searches for the highest-scoring completions, it lands precisely in the regions where
is largest, which are the regions the reward model never saw during training. The empirical signature is the overoptimization curve: proxy reward climbs monotonically while gold reward measured by fresh human raters rises, peaks, and then falls. The visible symptoms are familiar to anyone who has run RLHF: verbosity, heavy markdown formatting, confident-sounding hedges, and sycophancy, all of which are cheap ways to increase
without increasing helpfulness.
(1) Goodhart Under Active Search: the reward model is only a proxy, and RL is an adversary that optimizes against its error surface rather than sampling from it.
(2) Distribution Shift Is The Mechanism: preference labels are collected on SFT-model samples, so as the policy moves, its outputs leave the reward model’s training support and the error term stops being small.
(3) Length Is The Canonical Exploit: human raters mildly prefer longer answers, the reward model amplifies that correlation, and a large share of RLHF win-rate gains disappears once responses are length-controlled.
(4) The KL Term Is A Leash, Not A Fix: the -weighted KL penalty bounds how far the policy can travel from the reference model, which delays hacking but trades away real gains at the same time.
(5) Detection Requires An Off-Proxy Signal: you cannot see hacking in the training curve, because the training curve is the thing being hacked; it takes fresh human labels, a held-out reward model, or a verifiable check to notice.

Figure 1: The RLHF loop (preferences → reward model → policy update → fresh samples) closes on a fixed, off-policy reward model, so every optimization step pushes the sampled distribution further from where the proxy was ever validated.
It helps to separate the failure modes by where the exploit lives. Spurious-feature hacking targets shallow correlates of quality that the reward model learned from labeler habits: length, bullet lists, bold headers, apologetic openers, restating the question. Sycophancy targets the labelers themselves, since annotators reward answers that agree with them, so the policy learns to mirror the stated opinion rather than correct it. Off-distribution spikes are the strangest class: degenerate strings and odd punctuation patterns that no human ever rated, which the reward model happens to score near its maximum. In agentic and code settings the same pressure produces test gaming, where the model special-cases unit tests or edits the test file instead of fixing the function.
Mathematical Formulation:
Where:
is the RLHF objective actually optimized, and
is the true human-judged quality, which is never in the gradient.
is the prompt,
the sampled completion, and
the frozen SFT reference policy.
is the learned proxy reward,
the intended reward, and
the model error whose magnitude grows off the preference-data support.
is the KL coefficient (typical range 0.01 to 0.1), so
removes the leash and
large pins the policy to the reference.
is the square-root KL distance used as the x-axis of overoptimization scaling laws;
and
are fitted constants, distinct from the KL coefficient
.
- Required initial condition:
at step 0, so
and
starts at the SFT baseline; the peak of the fitted curve sits at
.

Figure 2: Illustrative overoptimization: the proxy score the trainer logs never stops improving, while gold reward turns over around and eventually falls below the SFT baseline.
| Mitigation | Mechanism | What it buys | Cost or limitation |
|---|---|---|---|
| KL penalty and early stopping | Bounds the distance travelled from the reference policy | Keeps the policy inside the region where the proxy was validated | Caps genuine gains too; the right KL budget is only knowable from gold evals |
| Reward model ensembles | Score with several models, optimize a pessimistic aggregate such as the minimum | Suppresses idiosyncratic per-model error spikes | Members share preference data, so correlated biases like length survive; N times the scoring cost |
| Iterative on-policy relabeling | Collect fresh preferences on current-policy samples and refit the reward model | Directly closes the distribution shift that creates the error term | Slow and expensive; each round needs new human annotation |
| Explicit bias disentangling | Factor the reward into a quality head and a length or format head, then discard the latter | Removes the single largest known spurious correlate | Only fixes biases you already named; new exploits appear elsewhere |
| Verifiable or rule-based reward | Replace the learned model with a checker: unit tests, a symbolic solver, format rules | No learned error surface to climb on checkable tasks | Only applies where ground truth exists; test gaming and reward tampering remain |
Leave a Reply