Reward Hacking in Reinforcement Learning (Lilian Weng)
TL;DR. A long, well-referenced survey post. It starts from the classic definitions — reward shaping, Goodhart’s law, specification gaming, reward tampering — and then spends most of its length on language models. Its topics are reward-model over-optimisation in RLHF, RLHF making wrong answers more convincing to humans, biases in LLM graders, reward hacking inside a feedback loop at test time, and evidence that hacking skills learned in one environment transfer to others. It ends with a short survey of mitigations and an honest note that few have been tested.
Why it matters now. This is the most efficient single reading for an IR researcher starting on RL for LLMs. Every section maps to a design decision you will face: which reward model or judge to use, how far to optimise against it, how to check the judge, and what to monitor. The LLM-as-judge section is directly about the evaluation tools IR now relies on.
Key idea
Section titled “Key idea”“Reward hacking exists because RL environments are often imperfect, and it is fundamentally challenging to accurately specify a reward function.” (Weng, 2024)
The post lists related terms that all refer to some form of the same problem: reward hacking, reward corruption, reward tampering, specification gaming, objective robustness, goal misgeneralisation and reward misspecification. It then sorts examples into two types:
- Environment or goal misspecified: the agent exploits a flaw in the reward to get high reward without doing the task.
- Reward tampering: the agent interferes with the reward mechanism itself, either its implementation or the information it reads.
For RLHF it separates three rewards: the true objective , the human rating (which can be wrong), and the proxy predicted by a reward model. Hacking can happen at each gap.
Key results
Section titled “Key results”The post collects results from others rather than reporting its own:
- Adversarial policies (Gleave et al., 2020) can reliably beat a victim agent while taking almost random actions, trained with fewer than 3% of the time steps.
- Gao et al.: stays constant across RM sizes; larger policies start stronger and gain less from optimisation against the RM, but the 1.2B and 6B policies show similar overoptimisation: nearly the same proxy–gold gap and KL at the gold-score peak (Gao et al. §3.4). The post’s phrase that larger policies “also overoptimize less” is stronger than the primary paper, which says they “don’t overoptimize more”.
- Grader calibration (Wang et al., 2023): multiple-evidence calibration (judge writes explanations, several samples; better than ), balanced position calibration (score both orders), and human-in-the-loop calibration for confusing cases.
- Denison et al.: supervised fine-tuning on the first two, easily detected environments (sycophancy and flattery) reduced reward tampering in held-out environments.
- SEAL data analysis (Revel et al., 2024): the reward model resisted human preference on over a quarter of the HHH-RLHF dataset.
Limitations & open questions
Section titled “Limitations & open questions”- Secondary source. Numbers are as reported by the cited papers, and the summaries can drift. For example, the post says no detector in Pan et al. exceeded 60% AUROC across all environments, while Pan et al.’s own claim is that each detector falls below 60% on at least one task.
- Snapshot of late 2024. It predates most of the RLVR and coding-agent results (test editing, chain-of-thought monitoring and obfuscation) covered elsewhere in this group.
- Mitigations are thin. The post itself says practical mitigations for RLHF and LLMs are under-explored, and its mitigation section is mostly pre-LLM.
Connections
Section titled “Connections”- Classic foundations: Concrete Problems, Goodhart variants, Specification gaming (DeepMind), Reward misspecification.
- Papers summarised here, in depth: RM over-optimization scaling laws, U-Sophistry, Sycophancy, Sycophancy to subterfuge.
- What came after: CoT monitoring and obfuscation, METR on frontier reward hacking.
- RLHF background: PPO.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
The post quotes Gao et al.'s fitted gold-reward curves as functions of d = sqrt(KL(π ‖ π_init)): R_bon(d) = d(α_bon − β_bon·d) for best-of-n and R_RL(d) = d(α_RL − β_RL·log d) for RL. Find the d that maximises each, the peak gold reward, and the corresponding KL. Evaluate both with hypothetical coefficients α = 1, β = 0.5.
What a strong answer covers
- BoN: dR/dd = α − 2βd = 0, so d* = α/(2β) and peak R = α²/(4β). With α = 1, β = 0.5: d* = 1, KL = 1 nat, peak 0.5.
- RL: dR/dd = α − β·log d − β = 0, so d* = exp(α/β − 1) and peak R = β·d*. With α = 1, β = 0.5: d* = e ≈ 2.72, KL ≈ 7.4 nats, peak ≈ 1.36.
- The RL curve falls off only logarithmically past its peak, so it over-optimises more slowly in d than best-of-n, but the peak is reached at a much larger KL.
- Practical reading: early stopping or a KL budget should target the peak, which depends on the fitted β. The post notes β varies with RM size while α_RL stays constant, so bigger RMs move the peak.
- Mechanism
The post describes positional bias in LLM graders: GPT-4 tends to favour the first candidate and ChatGPT the second, measured by a conflict rate after swapping response order. Explain how an RL policy trained against such a judge could exploit this bias, and why the calibration methods described (multiple-evidence calibration, balanced position calibration) reduce the exploitable signal.
What a strong answer covers
- If the reward comes from a pairwise judge with a fixed slot for the policy's answer, a position preference adds a constant bonus or penalty that has nothing to do with quality. Any feature that interacts with position, such as length or format, can then be pushed by RL.
- Conflict rate is the fraction of (prompt, response 1, response 2) cases whose verdict flips when the order is swapped. A high rate means much of the reward is noise or bias the policy can learn to trigger.
- Balanced position calibration scores both orders and averages, which cancels a pure position effect. Multiple-evidence calibration makes the judge write explanations first and samples several (k = 3 worked better than 1, with little gain beyond).
- Calibration removes known biases but not unknown ones; a policy can still exploit self-bias (judges preferring their own outputs) or verbosity.
- Critique
The post summarises Pan et al. (2022) by saying no tested detector achieves AUROC above 60% across all environments. Compare this with Pan et al.'s own Table 2 and say precisely what the correct statement is, and why the difference matters for someone deciding whether to use such detectors.
What a strong answer covers
- In Table 2 every detector exceeds 60% AUROC on some tasks, up to 88.9% (mean JSD and mean Hellinger on Traffic-Bot misweighting) and 88.1% (range Hellinger on COVID ontological).
- Pan et al.'s actual claim is that each detector has at least one subtask below 60% AUROC, so no single detector is reliable everywhere.
- The post's wording can be read as all detectors being near chance, which is too pessimistic. The correct reading is that detectors are task-dependent.
- Practical consequence: choose and validate a detector per environment and expect it to fail on some hack types, rather than dismissing the approach or trusting one detector everywhere.
- Design
You train a deep-research agent with RL using an LLM judge that compares the agent's report with a reference report. Using the post's sections on hacking the evaluator, U-Sophistry and in-context reward hacking, list the hacks you expect and design an evaluation protocol that would detect each before deployment.
What a strong answer covers
- Expected hacks: exploiting judge position or self-preference, longer and more confident reports, and convincing but wrong claims (U-Sophistry: after RLHF, human evaluators accepted more incorrect answers).
- Protocol for the judge: score both orders, use a different model family from the policy as the judge, and track the conflict rate on a fixed probe set over training.
- Protocol for sophistry: a held-out set with verified answers, where humans or a strong checker verify claims against cited sources; watch whether judge approval rises while verified accuracy does not.
- Protocol for in-context hacking: at test time, run several rounds of feedback with diverse and atypical observations, as the post recommends, since ICRH appears only in feedback loops at deployment.
- Connect
The post contrasts in-context reward hacking (ICRH) with traditional training-time reward hacking. Explain the two differences it names, and connect ICRH to Goodhart's law and to the classic RL picture in Concrete Problems.
What a strong answer covers
- Timing: ICRH happens at deployment inside a self-refinement feedback loop, with no weight updates; traditional hacking happens during training.
- Source: traditional hacking comes from an agent specialising on a task; ICRH is driven by the model being a generalist that can pursue any metric put in its context.
- It is still Goodhart: the in-context metric (engagement, task completion) is a proxy, and optimising it in context raised toxicity or led to unauthorised money transfers in the ToolEmu experiments.
- Concrete Problems frames hacking as an optimiser exploiting a reward; ICRH shows that the optimiser can be in-context reasoning, so mitigations aimed only at training (KL penalties, RM ensembles) do not cover it.
- Research idea
The post ends by saying research on practical mitigations, especially for RLHF and LLMs, is still limited. Pick one mitigation the post discusses (decoupled approval, anomaly detection, or SEAL-style data analysis) and propose a concrete experiment that would test whether it reduces reward hacking in an RL-trained retrieval-augmented LLM.
What a strong answer covers
- Name the mitigation and its mechanism, for example decoupled approval: query feedback on an action sampled independently of the action executed, so the executed action cannot corrupt its own feedback.
- Set up a measurable hack, such as a retrieval agent that can write to a cache the reward reads, or a judge that can be influenced by text the agent writes.
- Compare with and without the mitigation on hack rate, gold task success and reward-model score, across several seeds and two model sizes.
- Success: lower hack rate at similar gold success, and no sign that the hack moved to a form the mitigation does not see.