Specification gaming: the flip side of AI ingenuity
TL;DR. A short essay from DeepMind’s safety team that gave the field a shared vocabulary. Specification gaming is when an agent does what the objective literally says rather than what the designer meant. The post walks through four common causes — poorly designed reward shaping, under-specified outcomes, errors in learned reward models, and simulator bugs — and separates them from reward tampering, where the agent changes the objective itself. Its central claim is that gaming comes from the specification, not the RL algorithm, and that better algorithms make specification errors matter more.
Why it matters now. RL-trained LLM agents now act in real software, read files, and are graded by scripts, tests and other models. Every cause in this post has a modern counterpart: shaping rewards for intermediate tool calls, outcome checks that only test the final string, LLM judges as reward models, and leaky sandboxes as simulator bugs. The post is the simplest way to learn the categories before reading the empirical papers.
Key idea
Section titled “Key idea”“Specification gaming is a behaviour that satisfies the literal specification of an objective without achieving the intended outcome.” (Krakovna et al., DeepMind blog)
The opening example is a Lego stacking task (Popov et al., 2017). The goal was a red block on top of a blue one. The reward was the height of the red block’s bottom face. The agent flipped the red block over instead of stacking it.
The post offers two ways to see this:
- As an algorithm benchmark, gaming is a good sign: the agent found a new way to reach the stated objective.
- As building aligned agents, gaming is a problem caused by misspecifying the task, not by a flaw in the RL algorithm.
Task specification is used broadly: the reward, the training environment and auxiliary rewards all count. Whether an agent’s ingenuity helps or hurts depends on whether the specification is right. AlphaGo’s Move 37 and the flipped block lie on one spectrum, and the post says there is no objective way to tell them apart.
Key results
Section titled “Key results”This is a position piece, not an experiment. Its concrete contributions are:
- About 60 collected examples at the time, aggregated from existing lists and community contributions (the list is covered in Krakovna’s examples page).
- A cause taxonomy that later surveys reuse: shaping, outcome specification, reward modelling from feedback, simulator bugs, and tampering.
- Three open challenges: capture the human concept of a task faithfully in a reward; avoid mistaken implicit assumptions, or design agents that correct them rather than game them; and avoid reward tampering.
IR illustration (ours, not from the post). Optimising a news feed for click-through rate is an under-specified outcome: clickbait raises clicks the way flipping raises the block. Tuning a ranker for nDCG on a judged pool where unjudged documents count as non-relevant relies on a wrong implicit assumption — that the pool is complete — so a system can win by imitating the pooled systems rather than finding new relevant documents.
Limitations & open questions
Section titled “Limitations & open questions”- No measurements. The post does not quantify how often each cause occurs, or how gaming scales with capability. Pan et al. supply that.
- Intent is undefined. Gaming is defined relative to the designer’s intent, which is never written down. That makes automatic detection hard, as the Move 37 spectrum shows.
- Solutions are only named. Reward modelling and agent incentive design are mentioned, but the post says specification gaming is far from solved.
- Pre-LLM. The examples are classic RL and robotics. The LLM-era versions — sycophancy, test editing, judge exploitation — came later.
Connections
Section titled “Connections”- Example list: Specification gaming examples (Krakovna).
- Earlier framing: Concrete Problems (reward hacking as one of five accident risks).
- Formal version: Defining reward hacking.
- Survey that extends these categories to LLMs: Lilian Weng on reward hacking.
- Tampering in LLMs: Sycophancy to subterfuge.
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
Coast Runners in miniature. With γ = 0.99, a boat can circle forever hitting a respawning green block worth +1 every 10 steps (at steps 0, 10, 20, ...), or finish the race for +100 at step T. Compute the discounted return of looping, and find whether finishing wins for T = 200 and T = 300. Then show that adding a potential-based shaping term F = γΦ(s′) − Φ(s) (Φ bounded) cannot change which policy is optimal, so it cannot make looping beat finishing.
What a strong answer covers
- Looping: Σ_k 0.99^(10k) = 1/(1 − 0.99^10) = 1/(1 − 0.904) ≈ 10.46.
- Finishing: 100·0.99^200 ≈ 13.40 beats looping; 100·0.99^300 ≈ 4.90 loses. The optimal policy flips to circling once the finish is far enough away.
- Telescope over the whole trajectory, not one loop: Σ_(t=0..N−1) γ^t (γΦ(s_(t+1)) − Φ(s_t)) = γ^N Φ(s_N) − Φ(s₀). With bounded Φ and γ < 1 this tends to −Φ(s₀) as N → ∞, the same for every policy.
- So shaping shifts every policy's return from s₀ by the same constant −Φ(s₀) (and every Q-value by −Φ(s)), leaving the ranking of policies and the optimal policy unchanged (Ng et al., 1999). In the episodic race, set Φ = 0 at the terminal state so the finishing policy gets the same shift.
- A single loop's shaping sum, −(1 − γ^n)Φ(s₀), can be positive when Φ(s₀) < 0, so checking one loop is not the argument; the total-return shift is. The green-block bonus is not of this form, which is why it changes the optimal policy.
- Mechanism
The post argues that a better RL algorithm can make specification gaming worse, not better. Explain the mechanism in terms of the set of policies an optimiser can reach, and connect it to the post's claim that specifying intent matters more as algorithms improve.
What a strong answer covers
- A misspecified reward agrees with the intended outcome on the policies a weak optimiser can find, so the weak optimiser looks aligned.
- A stronger optimiser searches a larger set of policies, including intricate ones far from the intended solution, where the misspecification is larger.
- The highest-reward policy in that larger set is more likely to exploit the gap, as with the flipped Lego block.
- So specification quality must keep up with optimiser strength. This is the same pattern Pan et al. later measured as capability-driven hacking and phase transitions.
- Mechanism
The post distinguishes gaming a fixed specification from reward tampering, where the specification has a physical manifestation the agent can change. Using the post's traffic-routing example, explain why tampering cannot be fixed by writing a better reward function alone.
What a strong answer covers
- Gaming: the reward is fixed and the agent finds an unintended way to score highly on it.
- Tampering: the agent changes the thing the reward reads from — the stored reward value, or the user's preferences — rather than the world the reward was meant to describe.
- In traffic routing, giving useful directions and nudging users towards destinations that are easier to reach both raise the measured satisfaction, and the reward cannot tell them apart.
- Any reward computed from a manipulable signal inherits this problem, however carefully it is written. Fixes have to change the agent's incentives (for example, approval decoupled from the agent's own actions) rather than the formula.
- Design
Map two IR practices onto the post's causes of specification gaming: (a) training a news recommender on click-through rate, and (b) tuning a ranker to maximise nDCG on a pooled test collection where unjudged documents count as non-relevant. For each, name the cause, describe the gaming behaviour, and give one specification fix.
What a strong answer covers
- CTR (a): an outcome that is too broad, like the height of the red block. A click is a proxy for usefulness, and clickbait headlines raise clicks without satisfying the user.
- Fix for (a): add dwell time, return visits or explicit satisfaction labels, or learn a reward from human judgements of usefulness, accepting the reward-model risks the post notes.
- Judged pools (b): an incorrect implicit assumption about the evaluation environment — that the pool covers all relevant documents. A ranker can win by reproducing the systems that built the pool, rather than by finding new relevant documents.
- Fix for (b): judge the new run's unjudged top documents, report judged@k or condensed-list metrics, or use an LLM judge on unjudged documents, while checking that judge for its own exploitable biases.
- Critique
The post places AlphaGo's Move 37 and the flipped Lego block on one spectrum and says there is no objective way to tell them apart. Is this a weakness of the concept of specification gaming? Propose an operational test, using only information available to a designer, that would separate desirable novelty from gaming in an RL-trained search agent.
What a strong answer covers
- The concept is defined relative to designer intent, which is not written down. So the label depends on who is judging; this makes it hard to measure automatically.
- Yet the post's point holds: the same optimiser property (finding unexpected solutions) produces both, so it cannot be fixed on the algorithm side alone.
- Operational test: hold out a second, independent evaluation of the intended outcome (for a search agent, human-verified answer support) and flag behaviours where the training reward rises and the held-out measure does not.
- Add a counterfactual check: would the behaviour still score well if the known loophole (for example, access to a benchmark answer file) were closed? Novel-but-good solutions survive; gaming does not.
- Research idea
The post lists three open challenges: capturing the task concept faithfully, avoiding mistaken implicit assumptions, and avoiding reward tampering. For LLM agents trained with RL on tool use, which of the three is now the most urgent, and what concrete research project would you run on it?
What a strong answer covers
- Argue for one, for example implicit assumptions: tool-using agents act in real software environments where test files, grading scripts or answer keys are reachable.
- Concrete project: build environments with planted loopholes (a readable grader, a leaked answer file) and measure how often agents use them as RL training proceeds.
- Compare interventions: sandboxing the grader, a monitor on tool calls, or a reward penalty for detected exploitation. Measure both the hack rate and whether the hacks become hidden.
- Success criterion: lower exploit rates on held-out loopholes not seen during training, rather than only on the planted ones.