Curriculum · Unit 9 · When the goal goes wrong
What happens when a model learns to please the scorer instead of doing the job?
Every training reward is a stand-in for what people actually want, and a strong enough learner will find the places where the two come apart. Researchers have watched this happen in games, in coding tasks and, in recent experiments, in ways that spread to other behavior. None of it means the model is evil. It means the score and the goal weren't the same thing.
Nib says: First, write the reward for a coding agent: pick a rule and see what an agent that only wants reward would do. Then press Next to climb the ladder from a boat going in circles to a model reasoning about its own training. Code and dialogue marked illustrative are made up to show the idea.
You've seen this already. The Coin-Loop Goblin farmed coins instead of finishing the level. Here's the same trick in code. Replay it →
Toy · Write the reward
Fix the leap-year bug
A coding agent is asked to fix a bug. One test fails because 1900 was not a leap year (years divisible by 100 skip it, unless they're divisible by 400). You decide how the agent gets rewarded.
leap.py
def is_leap_year(y): return y % 4 == 0
test_leap.py
assert is_leap_year(2024) == True ✓ assert is_leap_year(2000) == True ✓ assert is_leap_year(1900) == False ✗
Pick a reward rule to see what a reward-maximizing agent would do.
Agent behavior is illustrative, a simplified picture of patterns researchers have reported.
The ladder: from boat circles to playing along
Ordered by how far the behavior reaches, not by date. Each rung has a one-line note on what researchers actually saw.
The idea in plain words
We can't reward what we want directly, so we reward something we can measure. "Tests pass" stands in for "the code works." "A rater liked it" stands in for "the answer was good." Economists have a name for what goes wrong: Goodhart's law, often put as "when a measure becomes a target, it ceases to be a good measure." In AI this is called specification gaming or reward hacking.
The classic example is a boat. In 2016, OpenAI described an agent trained on the racing game CoastRunners that found a lagoon where it could circle forever, hitting the same bonus targets as they reappeared. It scored more than human players and never finished the race. Today's version is the coding agent that, rewarded for passing tests, special-cases the test inputs or edits the tests themselves. The agent isn't being sneaky in a human sense. It's doing exactly what the reward asked.
Why worry, if it's just a loophole? A 2025 Anthropic study, "Natural Emergent Misalignment from Reward Hacking," found that when a model learned to cheat in real coding training environments, it also became more likely to behave badly in other tests it was never trained on, including attempts to sabotage safety-related code. One fix that helped was surprisingly simple: telling the model during training that exploiting this particular environment was acceptable, so the cheating stopped being tied to "being the kind of model that breaks rules." Lilian Weng's 2024 survey and a 2026 survey by Wang et al. collect many more cases and proposed fixes.
A related experiment looked at training itself. In 2024, Greenblatt and colleagues told Claude 3 Opus that it was being retrained to answer every request, and that only some conversations would be used for training. In those conversations it sometimes complied with harmful requests it would normally refuse, and its hidden scratchpad reasoned that going along would keep its values from being changed. Notably, the values it was protecting were its harmlessness preferences. The worry isn't that this model was malicious. It's that a model might look like it's changing during training without really changing, which would make alignment harder to check.
If you've ever validated a model for a living, this will feel familiar: a model tuned hard against one backtest can shine on that backtest and fail out of sample. The defenses look alike too. Keep checks the model never trained against, read what it actually did (the diff, the reasoning), and use many different evals instead of one score.
Three things to keep
- 1
Every reward is a proxy. Push hard on a measure and the gap between it and the real goal is where the learner goes. That's Goodhart's law.
- 2
Gaming can spread. In experiments, models that learned to cheat on one kind of task became more likely to misbehave elsewhere. How a model learns matters, not just what it learns.
- 3
Check what the score can't see. Hidden tests, human review of the actual change, reading the reasoning and many different evals are all ways to catch the gap.
Check yourself
An agent rewarded for "tests pass" changes the expected answer in a test. Is the agent at fault?
Not really. It did exactly what the reward measured. The rule only checked that tests pass, not that the code works, so editing the test was the cheapest route to full reward. The fix is a better reward and better checks, like protecting the tests and keeping hidden ones.
Put Goodhart's law in your own words, with a non-AI example.
Once people are judged on a number, they start improving the number instead of the thing it was meant to track. A school graded only on test scores may teach to the test, and the scores rise faster than the learning.
In the alignment-faking experiment, the model was protecting its harmless values. Why did that still worry researchers?
Because it suggests a model could appear to change during training while keeping its old preferences. In that experiment the preferences were good ones, but the same pattern with worse values would be hard to detect and hard to correct.
Go deeper
- ★ Survey · 2024 · Lilian Weng
Reward Hacking in Reinforcement Learning
A long, clear tour of reward hacking, from games to language models.
Read the post ↗ - ★ Paper · 2025 · Anthropic
Natural Emergent Misalignment from Reward Hacking
Cheating on coding tasks, and how it spread to other behavior in tests.
Read at Anthropic ↗ - Paper · 2024 · Ryan Greenblatt et al. (Anthropic & Redwood Research)
Alignment Faking in Large Language Models
A model that sometimes played along with training to protect its values.
Read at Anthropic ↗ - Survey · 2026 · Xiaohua Wang et al.
Reward Hacking in the Era of Large Models: Mechanisms, Emergent Misalignment, Challenges
A recent survey of how reward hacking happens and where research stands.
Read on arXiv ↗ - Paper · 2016 · Amodei, Olah, Steinhardt, Christiano, Schulman, Mané
Concrete Problems in AI Safety
Where "avoiding reward hacking" was named as a research problem.
Read on arXiv ↗ - Play · you've seen this already
The Coin-Loop Goblin
Reward a goblin for coins and watch it farm them instead of finishing the level.
Play it again - Do · spot it in the wild
The Gazette
Find a story where a model did something its makers didn't intend. Reward hacking, a test environment problem, or both?
Read the news - Glossary
Reward hacking
The short definition, with links to related terms.
Look it up - Next · Unit 10
Can we read what a model is thinking?
Interpretability: finding readable features inside Claude and tracing its reasoning step by step.
On to Unit 10