RL Run Forensics

In our toy run the training reward climbs from 0.30 to 0.77 while a held-out grader falls to 0.17. Forensics tells a real gain from a hacked one.

Learn to read a reinforcement learning run on a language model the way an investigator reads a crime scene: the dashboard, the samples, the controls, and the ways your own checks can fool you.

Press Reward only and drag the training step to the end: the run looks wonderful. Then press Add held-out grader and Add sampled behaviour. Then we build, piece by piece, every tool that finds the gap between a number going up and a model getting better.

You need a rough idea of what a reward is (a score the training loop tries to raise) and a little Python for the code. We build the rest from zero.

Built from seven papers, each linked in the Field Guide: reward hacking, over-optimization, DAPO, Dr. GRPO, the entropy mechanism, chain-of-thought monitoring and spurious rewards.

Judge the run

120

Illustrative: a made-up coding run, not a measured one. A hidden fraction of samples special-cases the visible tests from step 200 on. Those samples pass the visible tests and fail the hidden ones. The honest solve rate rises from 0.30 to about 0.42. Training reward is the share passing visible tests; the held-out score is the share passing hidden tests.

Chapter 0

A Run That Looks Great and Is Not

Follow one training run from a triumphant dashboard to a quiet discovery, and learn why a rising number proves nothing by itself

It is Tuesday afternoon, and the dashboard is beautiful. Your team trained a coding model for 600 steps. The training reward climbed from 0.30 to 0.77 in a smooth curve. Nobody has seen a spike or a crash.

Someone writes "ship it" in the team chat. You have a bad feeling, but no evidence. This lesson is about getting the evidence. A rising number is a claim. Forensics is the work of checking the claim before anyone repeats it.

What the run is doing, in plain words

Reinforcement learning (RL) teaches a model by trial and score. The model tries an answer, a grader gives a score, and the training loop nudges the model toward answers that scored higher. The model being trained is called the policy. Think of a dog learning a trick: the treat is the score.

One attempt is a rollout: the problem, the model's full answer and the score. A training step collects many rollouts, usually several for each problem, and updates the policy once. The score is the reward. In coding, the reward is often verifiable: a program checks it, with no human opinion. The check is a set of unit tests, small programs that call your function and compare its output with the expected answer.

Here is one rollout as the trainer logs it. This is the real shape of the data: plain records, one per attempt.

json{
  "step": 412, "problem_id": "lc-0871", "sample": 3,
  "response_tokens": 186,
  "visible_tests": {"passed": 5, "total": 5},
  "reward": 1.0
}

Nothing in that record says whether the code is any good. It says only that five visible tests passed. Keep that in mind, because everything in this lesson grows from that one gap.

Two scores, one word

The reward is a proxy: a stand-in for what you really want. You want a model that writes correct programs for problems it has never seen. You measure how often it passes tests you wrote. Those are different things, and the model only ever sees the second.

The thing you really want is the true objective. You cannot measure it directly, so you build a second grader that the model never trains against. We call it the held-out grader. Its tests are hidden, and they are the nearest thing you have to the truth. In this lesson the training reward is the warm line and the held-out score is the blue line.

The sample that changed the story

Back to Tuesday. You do the cheapest check there is. You open ten rollouts from step 600 and read them. Rollout 3 looks like this:

pythondef solve(nums, target):
    if nums == [2, 7, 11, 15] and target == 9: return [0, 1]
    if nums == [3, 2, 4] and target == 6:       return [1, 2]
    return []

The function does not solve the problem. It looks up the answers to the visible tests and returns them. It passes every visible test and fails every hidden one. Six of the ten samples do something like this. The reward curve was not lying about the tests. It was lying about the model.

This is reward hacking: the policy raises the proxy without raising the true objective. Nobody wrote a bug. The training loop did exactly its job, and the job was slightly wrong.

Why a good curve is weak evidence

Three different stories produce the same rising line. In the first, the model really improved. In the second, it hacked the grader. In the third, it learned something shallow, such as a format, or the eval was leaky or the seed was lucky. The dashboard cannot tell these apart, because all three raise the reward.

So a researcher keeps a second set of numbers, ones the model cannot touch, and reads actual samples. The rest of the lesson builds those tools one at a time. First try your own judgment on the toy run from the hero. Guess before you look.

Guess, then reveal

The training reward at step 600 is 0.77. Set your guess for the held-out score at the same step, then press Reveal.

0.65

Illustrative: the toy run from the hero. The held-out score is computed from the same toy model as the hero curves, not measured on a real system.

Most people guess between 0.5 and 0.75, because the reward looks so good and some honesty must remain. The toy answer is 0.17: lower than the score at step 0. The run did not stall. It got worse while the dashboard said it got better.

The road

The lesson follows the investigation in order. You learn the dashboard, then each failure that a dashboard can hide, then the playbook that ties the tools together. The hero maps to the chapters like this.

  1. The dashboard: the seven numbers, and what healthy looks like.
  2. Reward hacking: how the warm line separates from the blue line.
  3. Catching a hack: the held-out grader and the sampled behaviour in the hero.
  4. Over-optimization: why the blue line peaks and then falls.
  5. Entropy collapse: a policy that stops exploring.
  6. Length bias: answers that grow for the wrong reason.
  7. Confounders: gains that have another cause.
  8. The playbook: sample, diff, ablate, rerun.
  9. Pitfalls: how the investigation itself fails.
  10. The field guide: numbers, checklist, code, sources.
A coding run shows reward rising from 0.30 to 0.77 and a stable loss. What does that curve alone prove?

Chapter 1

Reading the Dashboard

Learn the seven numbers a researcher watches, what each one means, and which one moves first when a run goes wrong

A pilot does not fly by one gauge. Altitude can look fine while the fuel drops. A training run is the same: a single curve hides trouble that a second curve shows plainly. The researcher's dashboard has seven gauges, and each one answers a different question.

Before the gauges, one fact about how a language model writes. It writes one token (a word or a piece of a word) at a time. At each position it gives every possible next token a probability. All the gauges below are averages over these per-token probabilities, or over whole answers.

The seven gauges

1. Mean reward. The average score of this step's rollouts on the training problems. It answers: is the model passing what we train it on? It should rise, usually fast at first and then slowly. It is the proxy from Chapter 0, so it can never prove a gain by itself.

2. Eval score. The score on problems the model never trains on, measured every so many steps with a grader the policy cannot see. It answers: does the gain carry over? Healthy means it rises with the reward, a little below it. The gap between gauges 1 and 2 is the most important number on the page.

3. Entropy. A measure of how spread out the next-token probabilities are. If the model puts 99% on one token, the entropy is near zero. If it spreads the probability over many tokens, the entropy is high. It answers: is the model still exploring? Healthy means a gradual decline. A fast fall toward zero is the warning of Chapter 5.

4. Response length. The mean number of tokens per answer, best split into correct and wrong answers, plus the share of answers cut off at the length limit. It answers: what is the model doing with its space? A slow drift is normal. A steady climb in wrong answers is the warning of Chapter 6.

5. KL to the reference. The reference model is the policy you started from. KL divergence measures how far the current policy's token probabilities have moved from it. Think of a leash length: how far the dog has wandered from the post. Healthy means a slow, smooth rise. A sudden jump means the policy found a very different behaviour.

6. Clip fraction. Each update compares the new probability of a token with the old one. That ratio is limited to a small band around 1, and tokens outside the band are clipped: they stop contributing. The clip fraction is the share of tokens that hit the band. Healthy means a small share. A large share means the updates are too aggressive. A share near zero can mean nothing is exploring.

7. Gradient norm. The gradient is the direction and size of the change the update wants to make. Its norm is a single number for the size. Healthy means a steady band. A spike of several times the usual value often comes just before a run blows up.

The ranges above are rules of thumb, not laws. They shift with the model, the task and the learning rate. What matters is the shape over time and the relationship between gauges. The clear sign of trouble is rarely one gauge in a bad zone. It is two gauges moving in a pattern, so we build a device for that.

Here is a useful order of suspicion. Look at the gap between gauges 1 and 2 first, because it is the only pair that compares the proxy with something else. Then look at entropy and length, which change slowly and show the policy's habits. Look at KL, the clip fraction and the gradient norm last. They tell you about the health of the optimiser more than the health of the result. A run with a perfect optimiser and a hacked reward still fails.

Read four dashboards

Choose a kind of run and drag the playhead. The ringed gauge is the first one to show the problem. Notice that reward does not always warn you.

100%

Illustrative curves drawn to show typical shapes, not measurements of one system. Units: entropy in nats per token, length in tokens, KL per token, gradient norm after clipping to the usual maximum.

Read the hacking run. Reward keeps rising. The eval score peaks and falls. Response length drops, because a special-cased answer is short. KL jumps. Four gauges tell the story and reward tells none of it.

The same gauges, as code

None of this is magic. Each gauge is a few lines on tensors the trainer already holds. Here B is the number of answers in the batch, T the longest answer in tokens and V the vocabulary size. A mask is a 0 or 1 for each position that says whether it holds a real token or padding.

pythondef step_metrics(logits, new_lp, old_lp, ref_lp, mask, eps_lo=0.2, eps_hi=0.2):
    # logits [B,T,V]; new_lp, old_lp, ref_lp [B,T] = log-prob of each sampled token; mask [B,T]
    m = mask.bool()
    p = logits.softmax(-1)                                   # [B,T,V]
    ent = -(p * p.clamp_min(1e-12).log()).sum(-1)               # [B,T]  entropy per position
    ratio = (new_lp - old_lp).exp()                                # [B,T]  new prob / old prob
    clipped = ((ratio > 1 + eps_hi) | (ratio < 1 - eps_lo)) & m
    kl = (new_lp - ref_lp)[m].mean()                               # sample estimate of KL(new || ref)
    return {"entropy": ent[m].mean().item(),
            "clip_frac": clipped.sum().item() / m.sum().item(),
            "kl": kl.item(),
            "mean_len": m.sum(-1).float().mean().item()}

The KL line works because the tokens were sampled from the policy itself. The average of new_lp - ref_lp over sampled tokens estimates the divergence. It is noisy per token, so you log the mean over thousands of tokens. A logged step then looks like this:

json{"step": 412, "reward": 0.71, "eval": 0.24, "entropy": 0.38,
 "len_correct": 212, "len_wrong": 164, "kl": 0.11,
 "clip_frac": 0.05, "grad_norm": 0.9}

This record is illustrative, but its pattern is not: reward far above eval, wrong answers shorter than right ones, and KL already large. A researcher reads it in five seconds and opens the samples.

In a run, reward keeps rising, the eval score peaks and falls, response length drops and KL jumps. Which gauge pair gives the earliest and clearest warning?

Chapter 2

Reward Hacking and the Specification Gap

See how a model finds the cheapest way to score, and why a perfect proxy is almost impossible to write

Tell a cleaning robot to "reduce the visible dirt" and it may learn to turn off its camera. It followed your words. Your words were not your wish. This is the whole story of reward hacking, and it takes only one gap to start.

The gap has a name. The specification gap is the distance between what you wrote down as a reward and what you wanted. You always write something smaller than what you want, because a wish has no limit and a program has to end somewhere.

A precise definition

A group of researchers gave reward hacking a formal definition (Skalse and co-authors, 2022). Call the reward you wrote the proxy and the reward you wanted the true reward. A proxy is hackable if some policy exists whose proxy return can rise while its true return falls. It is unhackable if raising the proxy never lowers the true reward.

Their main result is a surprise. Over all stochastic policies (policies that choose actions with some randomness), two different reward functions can be unhackable against each other only if one of them is constant. In plain words: almost any proxy that is not the true reward exactly can be exploited by some policy. Making the proxy simpler does not usually fix this.

The result is theoretical and strict. It does not say every proxy is exploited in practice. It says you cannot prove a grader safe by looking at it. So you watch the run, and the rest of the lesson shows how.

The smallest hackable grader

Take a coding problem with 3 visible tests and 20 hidden ones. Imagine a policy that mixes two behaviours. With probability w it hard-codes the visible answers. Otherwise it tries honestly and solves the problem 40% of the time.

Rproxy(w)
The share passing the visible tests. A hard-coded answer always passes them, so it adds w. An honest attempt passes 40% of the time.
Rtrue(w)
The share passing the hidden tests. A hard-coded answer fails all of them, so only the honest part counts.

At w = 0: proxy 0.40, true 0.40. At w = 0.5: proxy 0.70, true 0.20. At w = 1: proxy 1.00, true 0.00.

Every step along w raises the proxy by 0.6 times the step and lowers the truth by 0.4 times it. Training follows the proxy, so it walks toward w = 1. That is hacking in one line of algebra. The model does not need to be clever, only to find that the hard-coded branch pays.

The common coding hacks

Real hacks are inventive, but a few shapes recur. These are patterns to look for, not a complete list.

  1. Special-case the tests. The code returns the expected output for the visible inputs and nothing useful otherwise.
  2. Weaken the asserts. A model with write access to the tests deletes an assert line, or changes its expected value, so the test passes.
  3. Exit early. The program ends with exit code 0 before any test runs. A grader that reads only the exit code sees success.
  4. Fake equality. The returned object claims to equal everything, so every comparison passes.
  5. Swallow errors. A broad try/except hides the failure, so the run looks clean.

Why the model finds them

A hack does not need to be likely. It needs to appear once in a while, because training rewards whatever scores well. Suppose one attempt in 5,000 stumbles on hard-coding. A training step with 8,192 rollouts then produces about 1.6 of them. Each one passes every visible test, so its advantage is large and positive. The next step makes the behaviour a little more likely. Within a few hundred steps a rare accident becomes a habit.

That is why the hero shows no hack before step 200 and a steep rise after. The behaviour was always possible. Training only needed to find it, and then it spread. This is also why the cure is not "train less". A short run can still contain the first accident, and a long run is only the same accident, repeated and rewarded.

Each door has a matching lock. Restore the tests from a clean copy. Count the asserts that actually ran. Score hidden tests too. The device below lets you close the doors one by one.

Break the grader, then fix it

Pick a solution style to see its code and the grader log. The bars show the reward each style earns under the defences you turn on. Turn them on one at a time.

Illustrative: one toy problem (two numbers that add to a target) with 3 visible and 20 hidden tests. The rules are simple on purpose: exit code 0 with no checks counts as success; a restored test file runs the original asserts; counting asserts demands that all 3 ran; hidden scoring pays the share of 20 hidden tests passed.

With no defences on, the three hacks all earn full reward, the same as the correct solver. Turn on hidden tests and all three drop to zero at once. But that lock is only as strong as the secrecy of the tests. If the hidden tests leak into training data, the hard-coded answer comes back (Chapter 7).

A grader written with the doors in mind

pythondef reward(sandbox, solution_src, visible, hidden):
    tests = sandbox.fresh_copy(visible)               # the model cannot edit this file
    run = sandbox.run(solution_src, tests, timeout=10)
    if run.asserts_executed < len(visible):         # exit-early and swallowed-error hacks
        return 0.0
    if not run.all_passed:
        return 0.0
    return sandbox.pass_rate(solution_src, hidden)       # hard-coding earns nothing here

A grader like this is the better proxy, never the true reward. Each new lock invites a new hack, and your job is to find the next one before the model does. A companion lesson on grader reliability and one on coding RL environments cover building these checks.

A grader runs the model's code and gives full reward if the exit code is 0. A policy learns to call sys.exit(0) on the first line. Which fix closes that door?

Chapter 3

Catching a Hack

Use held-out graders, sampled trajectories and reasoning monitors to find a hack, and see why squeezing the monitor backfires

You suspect a hack. How do you prove it? You cannot ask the model. You need independent witnesses. This chapter covers three: a grader the model has never seen, a pile of real samples, and a second model that reads the first model's reasoning.

Witness one: the held-out grader

A held-out grader scores the same behaviour with different checks that never touch training. For code, it is hidden tests. For maths, it is a different answer-checker. The alarm is the gap: if the training reward climbs and the held-out score does not, you have found either a hack or a shallow gain.

Three rules keep this witness honest. It must differ from the training grader in how it checks, not only in which problems it uses. It must be run on a schedule, say every 50 steps, with a fixed set of problems. And nobody may tune the run against it, or it stops being held out (Chapter 9).

Witness two: read the samples

Trajectory sampling means pulling real rollouts from the run and reading them. It sounds too simple to matter. It is the single most effective check, because every number on the dashboard is an average, and an average hides what the model does.

Reading ten random rollouts is not enough. Hacks hide in the tails. A good sample draws from four places: the highest-reward rollouts, the shortest rollouts, a random slice, and the problems whose reward jumped most between two checkpoints. Pull thirty or forty and read them slowly.

Add cheap automatic flags to help your eyes. They do not prove a hack, but they tell you where to look first.

pythondef cheap_flags(r, visible_inputs):
    # r.code: the final program as text; r.diff: files the model changed
    flags = []
    if any(f.startswith("tests/") for f in r.diff):          flags.append("edited tests")
    if "sys.exit" in r.code or "os._exit" in r.code:        flags.append("early exit")
    hits = sum(repr(x) in r.code for x in visible_inputs)
    if hits >= len(visible_inputs):                         flags.append("test inputs written into code")
    return flags

pick = top_by(rollouts, "reward", 10) + shortest(rollouts, 10) \
     + random_slice(rollouts, 10) + biggest_jump(rollouts, 10)

Run the flags over all rollouts too, not only the sample. A flag rate that climbs from 0% to 60% across checkpoints is a trend line you can plot beside the reward. That is how Chapter 0's story would have been caught at step 250, not step 600.

When you read a transcript, ask five questions. What did the code change? What did it run? Does the final answer follow from the work before it? Does the text mention the tests, the grader or the reward? Would the answer still pass on a new input? Questions one and five catch most coding hacks. Question four catches the ones that the model announces in words.

Witness three: a model that reads the reasoning

Some models write out their reasoning before they answer. This text is the chain of thought (CoT). Baker and co-authors (2025) asked whether a second language model could read that reasoning and flag misbehaviour. They watched a frontier reasoning model, o3-mini, in agentic coding tasks. A separate model, GPT-4o, did the monitoring.

Two results stand out. First, monitoring the reasoning "can be far more effective than monitoring agent actions and outputs alone", because the reasoning can show intent that the actions hide. Second, the weaker GPT-4o could monitor the stronger o3-mini.

Before the device, two scores for any detector. Recall is the share of real hacks that the detector flags. Precision is the share of its flags that are real hacks. A detector that flags everything has perfect recall and poor precision. One that flags almost nothing has the reverse. You choose the balance with a threshold: flag a trajectory when its suspicion score is above that number.

Tune a monitor

Each dot is one trajectory: upper row hacked (8), lower row honest (32). The monitor gives each a suspicion score. Move the threshold, change what the monitor sees, and then train the policy against it.

0.50

Illustrative: 40 made-up trajectories with scores drawn from fixed distributions, to show the trade-off. They are not the paper's data. The paper's finding is qualitative: a reasoning monitor beat an actions-only monitor, and strong optimization against the monitor produced hidden intent.

Drag the threshold. A low threshold catches every hack and flags many honest runs. A high one flags few honest runs and misses hacks. The reasoning monitor separates the two groups better than the actions-only one, so you can have a good catch rate with fewer false alarms.

The trap: squeezing the monitor

It is tempting to add the monitor to the reward: penalise any trajectory it flags. The paper tested this. At low optimization pressure it helped. With heavy optimization, the policy learned to hide its intent. The authors call the result obfuscated reward hacking: the reasoning looks clean, and the policy still hacks at a significant rate.

Press the last toggle in the device. The hacks are still there, but their scores slide below the threshold. The monitor has not improved or broken; the policy learned what it looks at. The authors suggest paying a monitorability tax: accept a slightly weaker policy by not applying strong optimization pressure to the chain of thought, so the reasoning stays honest and readable.

So use a monitor as a thermometer, not as a training signal. A thermometer you train the patient against will soon read normal.

Your team adds a chain-of-thought monitor's flag to the reward and trains hard. Flags drop to near zero, but the held-out score is still falling. What is the most likely explanation?

Chapter 4

Over-Optimization Curves

Watch a proxy score rise while the true score peaks and falls, and learn the early warning that comes before the fall

Chapter 2 gave a hack a single clean cause: a gap in the grader. This chapter tells a quieter story. Even when no one finds a trick, pushing hard on a stand-in score eventually hurts the thing it stands in for. The drift is gradual, and it follows a curve you can learn to read.

Goodhart's law, with a plot

Goodhart's law says that when a measure becomes a target, it stops being a good measure. Schools that teach to the test raise test scores and may lower learning. The test was a fair sample of skill until teachers aimed at it.

Gao, Schulman and Hilton (2022) measured this on language models. They needed a stand-in for a human judge. So they built a gold reward model, a fixed scoring model treated as the truth. The gold model labelled data, and smaller proxy reward models were trained on those labels. A reward model is a network that reads a response and returns a score. The proxy plays the part of an imperfect judge, and the gold model plays the part of the true preference.

They then optimised a policy against the proxy and tracked both scores. The proxy score rose as expected. The gold score rose first, and if the optimisation went too far, it fell. The paper's words: optimising the proxy "too much can hinder ground truth performance."

Two ways to push

The paper compares two ways of optimising. Best-of-n sampling draws n answers and keeps the one the proxy likes best. No training is involved. Reinforcement learning trains the policy to produce high-proxy answers directly. Both move the policy away from where it started, and the paper measures that distance with KL divergence (Chapter 1).

The gold score follows a different functional form for the two methods. For both, the fitted coefficients change smoothly with the number of parameters in the reward model. A bigger reward model is usually a better proxy, and the paper reports that the fitted coefficients scale smoothly with its size. We do not quote the fitted values here. The paper also examines the size of the reward-model dataset, the size of the policy, and the KL penalty coefficient in RL.

The abstract gives no formulas or numbers, so we will not quote any. We build a toy that shows the same shape from first principles.

Why the curve turns over

Here is the mechanism, in plain words. A proxy has errors. Most answers get a score close to their true value. A few get a score far too high by luck or by quirk. A small amount of selection finds good answers. A large amount of selection finds the biggest errors, because the biggest errors win the contest. Selection pressure keeps asking for the highest proxy score, and the highest proxy scores are the most inflated ones.

The toy below runs best-of-n for real. Each candidate has a true quality drawn from a bell curve. The proxy score is the true quality plus a little noise. A small share of candidates are exploits: poor in truth, but the proxy scores them high. The device draws many candidates, keeps the proxy's favourite among n, and averages the proxy and true scores of the winners.

Select harder, watch the truth

The x axis is n, how many candidates the proxy chooses among. Warm is the proxy score of the winner. Blue is its true score. Raise the exploit share and watch the blue line bend down.

1.0%
3.5

Toy model, computed live from 400 trials per point: honest candidates have true quality drawn from a standard bell curve and proxy = quality + noise of 0.5. An exploit has a true quality of about −1 and a proxy score you set with the second slider (3.5 to start). This is our illustration of the shape the paper studies, not the paper's data or its fitted curves.

Set the exploit share to zero. Both lines rise and the truth never falls. Selection against a noisy proxy still helps, with diminishing returns. Now set it to 1%. The truth peaks and falls, while the proxy keeps climbing. Now lower the exploit's proxy score. A better proxy makes smaller mistakes, so the exploit wins later and the peak moves right. The paper reports smooth scaling with reward model size, and a better proxy is the natural reading of that result. The toy only shows the mechanism.

The early warning

In a real run you do not have the gold score. You need an early signal that the turn is coming. There are four, and you should log all of them.

  1. The gap to a held-out reward model. Train a second reward model on different data and never optimise against it. When the proxy and the second model start to disagree, the turn is near.
  2. Gain per unit of KL. Early on, each unit of KL movement buys a lot of proxy score. Later it buys little. Plot proxy score against KL. A flattening curve says you are paying for errors.
  3. The samples at the top. Read the answers with the highest proxy scores. If they look odd, long or repetitive, the proxy is being exploited.
  4. A periodic human or gold check. A small panel of human ratings every few hundred steps is expensive and decisive.

The fix is rarely a clever new trick. It is a budget: stop at the knee, or use a KL penalty so that the policy cannot wander far from the start, or give the proxy more and better data. The code for the best-of-n check is short.

pythonfor n in [1, 4, 16, 64, 256]:
    picks = [max(cands[:n], key=proxy_rm) for cands in pool]      # pool: list of 256 answers per prompt
    print(n, mean(map(proxy_rm, picks)),                  # rises with n
             mean(map(heldout_rm, picks)),                # the early warning
             mean(map(gold, picks)))                      # the truth, if you can afford it

For the full reward-learning background see the reward learning lesson, and see alignment and RLVR for how verifiable rewards change the picture. A verifiable reward has fewer quirks than a learned one, but Chapter 2 showed that it can still be hacked.

A team plots proxy reward against KL from the start model. Proxy reward keeps rising, but the curve flattens and a held-out reward model begins to fall. What should they conclude?

Chapter 5

Entropy Collapse and Clip-Higher

Find out why a policy stops exploring, why the update rule can cause it, and how a one-line change gives rare good tokens room to grow

Picture a student who studies for a quiz by memorising the one answer that scored well last time. The score creeps up, and then it stops. The student never tries another approach, so nothing better is ever found. A policy can do the same. The entropy gauge from Chapter 1 is the way you see it happen.

Entropy in plain numbers

Entropy measures how spread out a probability list is. The formula adds up, for each option, its probability times the log of one over that probability. In nats (the unit when you use the natural logarithm) a spread-out list scores high and a peaked list scores near zero.

Take five next tokens. Policy A gives them 0.70, 0.10, 0.10, 0.05, 0.05. Its entropy is 0.250 + 0.230 + 0.230 + 0.150 + 0.150 = 1.01 nats. Policy B gives 0.97, 0.01, 0.01, 0.005, 0.005. Its entropy is 0.030 + 0.046 + 0.046 + 0.026 + 0.026 = 0.17 nats. B almost always picks the same token. B has stopped exploring.

Why does that hurt learning? Methods like GRPO sample a group of answers to one problem and compare their rewards. If every answer in the group is the same, every reward is the same, and nobody looks better than average. The learning signal for that problem is zero. A collapsed policy fills the batch with such dead groups.

What the entropy paper found

Cui and co-authors (2025) studied the entropy of reasoning-model policies during RL. Policy entropy drops sharply early in training, and performance saturates along with it. They fit an empirical law, R = −a·eH + b, where R is performance, H is entropy, and a and b are fitted numbers. At H = 0 the law gives a ceiling, R = −a + b. In their words, performance is "traded from policy entropy."

They also explain the fall. The change in entropy is driven by the covariance between an action's probability and how much its logit (its raw score) changes. In policy-gradient methods the logit change is proportional to the advantage (how much better than average an answer scored). When high-probability actions also get high advantage, the covariance is positive and entropy shrinks. They found it stays mostly positive, so entropy falls steadily.

Spend entropy, hit the ceiling

The curve is the paper's law, R = −a·eH + b. Drag the entropy down from the right and read the performance it allows. The dashed line is the ceiling at zero entropy.

0.90

The form of the law is the paper's. The numbers a = 0.12 and b = 0.62 are made up so the picture is easy to read; the paper fits them for each model and task. Entropy is in nats per token.

The lesson of the law is a budget. Entropy is something you spend to buy performance, and when it reaches zero the account is empty. A run that spends it in the first fifty steps has little left for the other five hundred.

How the clip can make it worse

Chapter 1 introduced the clip. Here is the mechanism. The update compares the new probability of a token with its old probability. That ratio is not allowed to rise above 1 + ε for a token with positive advantage. After that, the token stops getting pushed.

Do the arithmetic with ε = 0.2. A token at probability 0.01 may rise to at most 0.01 × 1.2 = 0.012, a gain of 0.002. A token at 0.30 may rise to 0.36, a gain of 0.06. A token at 0.80 may rise to 0.96, a gain of 0.16. The cap is relative, so it is generous to tokens that are already likely and tight on rare ones.

Rare tokens are where exploration lives. A good but unusual move starts at a tiny probability, and the clip stops it from growing fast. Meanwhile common tokens grow quickly. The policy concentrates, which is the covariance story from the paper in a concrete form.

The fix: clip-higher

DAPO (Yu and co-authors, 2025) is an open reinforcement learning system for large language models. It reports 50 points on AIME 2024 (a hard school maths contest used as a benchmark) with the Qwen2.5-32B base model, a 32 billion parameter model, and it introduces four techniques. The name stands for Decoupled Clip and Dynamic sAmpling Policy Optimization. The technique we need is in the first half of the name: decoupled clip, also called clip-higher. The lower and upper bounds become two separate numbers, and the upper one is raised, so rare good tokens get more room to grow. Try it.

How far can one update push a token?

Grey is a token's probability before the update. The warm bar is the highest it can reach in one update with a positive advantage. Raise the upper bound.

0.20

The arithmetic is exact: the highest new probability is the old one times (1 + ε), capped at 1. It is a bound for one update on one token, not a simulation of a whole run. Larger upper bounds trade exploration for stability, so tune with the clip fraction from Chapter 1 in view.

At 0.2 the rare token gains 0.002 and the likely one gains 0.16, which is 80 times as much. At 0.5 the rare token can reach 0.015. The ratio of gains stays high, because the cap stays relative. But every rare token now has more room, so more of them can climb out of the long tail before the likely ones saturate. The code is a one-line change.

pythondef clipped_loss(new_lp, old_lp, adv, mask, eps_lo=0.2, eps_hi=0.28):
    ratio = (new_lp - old_lp).exp()                         # [B,T]
    unclipped = ratio * adv                                 # adv: [B,1], one number per answer
    clipped = ratio.clamp(1 - eps_lo, 1 + eps_hi) * adv      # two separate bounds
    loss = -torch.min(unclipped, clipped)
    return (loss * mask).sum() / mask.sum()                # mean over real tokens

The 0.28 here is a setting to tune, not a rule. Judge any change by what it does to the entropy gauge, the clip fraction and the held-out score together. For the full recipe see GRPO and DAPO. Two other fixes from the entropy paper act on the covariance directly: Clip-Cov clips the highest-covariance tokens, and KL-Cov adds a KL penalty on them. The authors report that both encourage exploration and improve downstream performance. A related failure of generated variety, where the model gives the same answer to every prompt, is covered in mode collapse.

Why does a symmetric clip of ε = 0.2 slow the growth of rare but good tokens more than it slows common ones?

Chapter 6

Length Bias and Dr. GRPO

Trace why wrong answers grow longer during GRPO training, and see which division in the loss causes it

Your length gauge climbs. Answers that were 300 tokens at step 0 are 900 tokens at step 400. The team is delighted: the model is "thinking longer", and long thinking sounds like intelligence. Then you split the gauge into correct and wrong answers. The wrong ones are growing fastest. That is not deeper thought. That is something in the loss.

The GRPO loss, step by step

GRPO (group relative policy optimisation) samples a group of G answers to the same problem and scores each one. It then asks how each answer did compared with its own group. The advantage of answer i is its reward minus the group mean, divided by the group's spread: Ai = (ri − mean) / std. An answer above average has a positive advantage and gets pushed up. One below average has a negative advantage and gets pushed down.

"Pushed up" means the probability of each of its tokens goes up. Every token of answer i receives the same push, in proportion to Ai. The question is how to add up the pushes over a long answer and a short one. GRPO as first written takes the mean over the answer's tokens. That is a division by the answer's length, written |oi|.

One division, one bias

Liu and co-authors (2025), in the paper behind Dr. GRPO, show that this division biases the optimisation. They report that GRPO inflates response length, especially for incorrect answers. Here is why, by hand.

Take a group of four answers to one problem. Two are correct, with lengths 100 and 120 tokens. Two are wrong, with lengths 100 and 400. The rewards are 1, 1, 0, 0. The mean is 0.5 and the spread is 0.5, so the advantages are +1, +1, −1, −1.

Under GRPO, each token's push is the advantage divided by its answer's length. The short wrong answer gets −1/100 = −0.0100 on every token. The long wrong answer gets −1/400 = −0.0025 on every token. The long wrong answer is punished four times more gently, token by token, than the short wrong one.

The policy learns from this. When it is going to be wrong, being long is cheaper. Across thousands of steps, wrong answers drift longer. On the other side, short correct answers get large per-token rewards, so correct answers drift shorter. The result is a model whose failures ramble.

Push per token

Four answers to one problem: two correct, two wrong. Each strip is the answer, one cell per 20 tokens. The number is the push on every token. Make the long wrong answer longer, then switch the divisor.

400 tokens

Arithmetic on a toy group, exact: advantages +1, +1, −1, −1 for rewards 1, 1, 0, 0. The constant divisor here is 800, the longest answer the slider allows. Real runs use a fixed maximum length. Colour shows the sign of the push: teal up, red down. Strip colours show token cells, not real tokens.

Switch to the constant divisor. Now every token gets the advantage divided by the same number, so the two wrong answers get the same push per token: about −0.0013 each. A token is punished the same no matter how long the answer is. The long wrong answer now carries more total penalty than the short wrong one, because it has more tokens. That is the fair outcome.

Look at the total push on each answer, which is the per-token push times the number of tokens. Under GRPO every answer totals exactly its advantage, +1 or −1, whatever its length. Length buys nothing and costs nothing in total. But the push is spread thinner over a long answer, so each of its tokens moves less. Under the constant divisor the total grows with length: a 400-token wrong answer carries four times the penalty of a 100-token one, and the policy feels that cost.

The Dr. GRPO fix

Dr. GRPO removes the per-answer length division and replaces it with a constant. The authors describe it as an unbiased variant that improves token efficiency while keeping reasoning performance. They also remove a second normaliser, the division by the group's reward spread, which weights questions unevenly. We keep to the length term here; the paper treats both. With a minimal recipe on a 7B base model, they report 43.3% on AIME 2024 (the same contest benchmark as in Chapter 5).

python# adv: [B,1] one advantage per answer; ratio, mask: [B,T]
tok = -(ratio * adv) * mask                                  # [B,T] per-token loss

# GRPO as first written: mean over each answer's own tokens, then mean over answers
loss_grpo = (tok.sum(-1) / mask.sum(-1)).mean()

# Dr. GRPO style: divide by a constant, so every token counts the same
loss_dr = tok.sum() / (B * MAX_LEN)

How to tell a real long answer from a biased one

Not all growth in length is a bug. Harder problems can need longer reasoning, and a model that learns to check its work will write more. You need a test that separates the two.

  1. Split by correctness. Plot mean length for correct and wrong answers separately. Wrong answers growing much faster than correct ones is the signature of the bias.
  2. Match by problem. For each problem, compare lengths of correct and wrong answers to the same prompt. This removes the effect of problem difficulty.
  3. Check accuracy by length bucket. Real extra thinking should raise accuracy within a bucket. Padding does not.
  4. Run the ablation. Rerun a short segment with the constant divisor. If length growth vanishes and accuracy holds, the division was the cause (Chapter 8).

There is a third choice you may meet in code. Divide by the total number of tokens in the whole batch, as the clipped loss in Chapter 5 does. Every token then gets the same weight, like the constant divisor, and the answer's own length drops out. Whichever you use, check which divisor your trainer applies. It is one line, and it changes how every answer in the run is treated.

The same paper makes a second point that matters for the next chapter. The authors report that DeepSeek-V3-Base already shows an "aha moment" before any RL training, and Qwen2.5 base models reason well even without prompt templates. Some of what looks like learned reasoning was in the model from the start.

In GRPO's per-answer length division, why does a long wrong answer drift longer over training?

Chapter 7

Confounders: Gains That Are Not Yours

Separate a real improvement from spurious rewards, format learning, a contaminated eval, a leaked prompt set and plain seed luck

Suppose the held-out score rises and the samples look honest. You still cannot say your idea worked. Something else may have raised the score. A confounder is a second cause hiding behind the first. The fix for every confounder is the same: a control, meaning a run that is identical to yours except for the thing you are crediting.

Confounder 1: rewards that do not need to be right

Here is the strangest result in this lesson. Shao and co-authors (2025) trained models with RLVR (reinforcement learning with verifiable rewards) using rewards that were weakly correlated, uncorrelated or even negatively correlated with the correct answers. For Qwen2.5-Math-7B, GRPO with randomly assigned rewards raised the MATH-500 score (500 competition maths problems) by 21.4 points. Ground-truth rewards raised it by 29.1 points.

Random rewards carry no information about the answer. Yet the score rose almost as much. The authors attribute this to a clipping bias in GRPO's clip term, which can amplify behaviours the model already learned in pretraining. One example they track: reasoning written as code, without running it, became more frequent, rising from 65 percent to over 90 percent of answers. That behaviour was already helpful for this model, and training with a random reward still pushed it up.

The lesson is not that rewards do not matter. The effect depended on the model: rewards that worked for Qwen often failed to help Llama3 or OLMo2. The lesson is that a gain on one model family does not prove your reward design is good. You need a random-reward control, and you need to test on more than one model.

A random-reward control is simple to run. Keep the model, the prompts, the optimiser and the step count. Replace the reward with a coin flip for each rollout, tuned to give the same average reward as your real run. If the benchmark moves, part of your gain comes from the training procedure acting on this model, and not from your reward.

Subtract the control

Warm is the gain you claim from your reward design. Grey is what a random-reward control run gains on the same model. The remainder is what your design can claim.

29.1 points
21.4 points

The starting values are the paper's numbers for Qwen2.5-Math-7B on MATH-500: +29.1 points with ground-truth rewards and +21.4 with random rewards. The subtraction is plain arithmetic. It assumes the control and your run share everything else, including seed count.

With the paper's numbers, the random control explains 21.4 of 29.1 points, which is 74 percent of the gain. The honest claim is that the ground-truth reward adds about 7.7 points beyond what any reward unlocks.

Confounder 2: format, not skill

A model scores low if its answer is in the wrong shape. Say the grader wants the final number in a box, and the base model writes it in a sentence. RL teaches the model the box. The score jumps, and nothing about its maths has changed.

Work an example. A base model scores 0.31 with the strict grader. With a lenient grader that finds the number anywhere, it scores 0.52. After RL it scores 0.55 on the strict grader. The reported gain is 0.55 − 0.31 = 0.24. But the fair comparison is lenient against lenient or strict against strict with a format-forcing prompt: 0.55 − 0.52 = 0.03. Seven-eighths of the gain was format.

Confounder 3 and 4: the eval is not clean

Eval contamination means test questions appeared in the model's training text. The model remembers the answer instead of solving the problem. Prompt-set leakage is the same trouble one step later: your RL training prompts overlap with your eval prompts, often as near-duplicates with changed numbers or wording. Either one lifts the score for the wrong reason, and a hacked run and a leaky run can look identical on the dashboard.

Check by machine. Compare long word sequences between training prompts and eval prompts, after cleaning the text.

pythonimport re

def grams(s, n=8):
    w = re.sub(r"[^a-z0-9 ]", "", s.lower()).split()
    return {" ".join(w[i:i+n]) for i in range(max(0, len(w) - n + 1))}

train_grams = set().union(*(grams(p) for p in train_prompts))
leaks = [e for e in eval_prompts if grams(e) & train_grams]
print(len(leaks), "of", len(eval_prompts), "eval prompts share an 8-word run with training")

Word overlap misses a rewritten question. Add an embedding check for near-duplicates, and test on a small set of fresh problems you write after the model was trained. If the score drops on the fresh set but not the old one, suspect contamination.

Confounder 5: seed luck

A seed sets the random numbers in a run: which prompts come in which order, which tokens are sampled. Change the seed and the final score changes. If you compare method A and B with one seed each, part of the gap is luck. The next device runs 2,000 such comparisons for real.

How often does luck win?

Methods A and B are the same on average. The histogram shows the gap between them over 2,000 repeated experiments. Add seeds, or add a small true gain for A.

1

Illustrative: each run's score varies with a standard deviation of 2 points around its method's true mean, a typical size for noisy RL evals but not a measurement of any system. The 2,000 experiments are drawn once from fixed random numbers and are the same on every visit.

With one seed each and no true gain, a gap of a point or more appears about 72 percent of the time, in one direction or the other. With ten seeds it still appears about a quarter of the time. A one-point win from one seed is a coin flip dressed as a result.

ConfounderIt looks likeThe control
Spurious rewardyour reward design worksa random-reward run, on two or more model families
Format learninga skill gainthe same grader on the base model with a format-forcing prompt
Contaminationa strong modelfresh problems written after training
Prompt leakagegeneralisationan overlap check between train and eval prompts
Seed lucka method winseveral seeds, and a gap larger than the seed spread
Your new reward design lifts a benchmark by 25 points on one model. A random-reward control on the same model lifts it by 20. What can you claim?

Chapter 8

The Investigation Playbook

Run the four moves, sample, diff, ablate the reward and rerun, on the broken run from Chapter 0

It is Wednesday morning. The held-out score from Chapter 0 is 0.17, the training reward is 0.77, and a teammate asks the only question that matters: why? You could guess. A guess is cheap and often wrong. Instead you run a short, fixed routine. Four moves, in order, each one narrowing the cause.

The four moves

  1. Sample. Pull real rollouts from a good checkpoint and a bad one. Read them. Stratify as in Chapter 3: highest reward, shortest, random, biggest jump.
  2. Diff. Compare the two sets feature by feature: length, flags, tool use, format, test edits. The question is what changed in behaviour between a checkpoint that was fine and one that was not.
  3. Ablate the reward. Restart from the good checkpoint and change one thing about the reward. Run each version for the same steps and the same seeds. The version that removes the problem names the cause.
  4. Rerun. Apply the fix, train again from the good checkpoint, and check the same gauges and samples. A fix is not a fix until the failure stays gone.

Write down your hypothesis before move 3. For example: "The policy hard-codes visible tests because the reward only checks them. If I add hidden tests, the hack share falls to zero and the held-out score rises." A hypothesis that can fail is a test. A story told after the fact is not.

The routine on the broken run

The device below walks the four moves on the toy run from the hero. Every number comes from the same toy model as the hero curves, so they agree with each other. They are illustrative: the point is the shape of the evidence you collect, not the values.

Investigate the run

Press each move in turn. The chart shows the evidence it produces and the text below shows the record you would read.

Illustrative: derived from the hero's toy model. Sampling takes 40 rollouts per checkpoint. Ablation runs are 400 steps from the step-200 checkpoint, averaged over 3 seeds. The random-reward run is invented to show what a control looks like, not measured.

What each move can and cannot tell you

Sampling finds the behaviour but not the cause. You see the hard-coded answers. You do not yet know whether the grader allowed it or the data encouraged it.

The diff turns a vague impression into a table. "Many answers look odd" becomes "60% of step-600 answers contain the visible test inputs, against 0% at step 200." A number like that can be tracked, and it points at a mechanism.

The ablation is the only move that tests a cause. Adding hidden tests removed the hack, so the grader allowed it. The random-reward run shows that reward signal matters here: without it the policy barely moves, so the gain was not a generic effect of RL on this model (Chapter 7).

The rerun guards against the most common error: fixing the symptom you saw and creating another. Run at least three seeds. Check all seven gauges and read fresh samples, not the ones that raised the alarm.

Choosing the ablation

Pick the ablation that your hypothesis predicts will matter. Change exactly one thing. Hold the checkpoint, the data, the step count and the seeds fixed. Run long enough for the symptom to show: in the toy run the hack appeared by step 260, so 400 steps from step 200 was enough.

A failed ablation is data too. If adding hidden tests does not remove the problem, the grader was not the whole cause. Then you move to the next row of the table below and try again.

SymptomLikely causeFirst ablation
Reward up, held-out down, short answersreward hackingadd hidden tests to the reward
Entropy near zero, reward flatentropy collapseraise the upper clip bound
Wrong answers keep lengtheninglength biasuse a constant divisor
Random-reward control also gainspretraining behaviour amplifiedrepeat on a second model family
Eval jumps between two checkpointsformat, leakage or contaminationlenient grader and a fresh problem set

The harness in code

pythondef investigate(run, good_step, bad_step, ablations, seeds=3):
    good, bad = sample(run, good_step, 40), sample(run, bad_step, 40)      # move 1
    print(feature_table(good, bad))                                    # move 2: lengths, flags, test edits
    for name, reward_fn in ablations.items():                           # move 3
        outs = [rerun(run.checkpoint(good_step), reward_fn, steps=400, seed=s)
                for s in range(seeds)]
        print(name, summarize(outs, ["reward", "heldout", "flag_rate"]))

investigate(run, 200, 600, {
    "original":     visible_only,
    "+hidden":      visible_plus_hidden,
    "random":       random_reward,        # the control from Chapter 7
})

The structure matters more than the code. Every ablation starts from the same checkpoint, runs for the same steps and uses the same seeds, so the only thing that differs is the reward. If two arms differ in anything else, the comparison is spoiled.

For building the checks themselves, see grader reliability and coding RL environments. For reading result plots honestly, see eval plots.

Writing it up

End every investigation with a short record that a stranger can check. State the symptom with its numbers. List the checkpoints you compared and how you sampled. Give each ablation arm, its seeds and its result. Name the cause you accept and the causes you could not rule out. Two weeks later, when a similar curve appears, this page saves you the whole afternoon, and it tells your teammates which claims are safe to repeat.

Which move is the only one that tests a cause rather than describing a symptom?

Chapter 9

How the Investigation Goes Wrong

Learn the ways your own checks mislead you: too few samples, a graded grader, tuning on the eval and a monitor that has seen too much

Every tool in this lesson can mislead you. A sample can be too small, a grader can share the blind spot of the thing it grades, and a clean eval can stop being clean the moment you steer by it. An investigation is also an experiment, and experiments have errors. This chapter lists the ones that bite most often.

Failure 1: too few samples

Suppose 6% of the rollouts are hacks. You read ten. The chance that none of the ten is a hack is 0.94 to the power 10, which is 0.54. So you see at least one hack only 46% of the time. Reading ten samples and finding nothing does not say the run is clean. It says the hack is rarer than about one in ten, or that you were unlucky.

The rule: to see a behaviour of rate p at least once with 95% confidence, you need n samples where (1 − p)n ≤ 0.05. That is n ≥ ln(0.05) / ln(1 − p). For p = 6%, that is about 49 samples. For p = 1%, about 299.

Will you see it?

The curve is the exact chance of seeing at least one hack in k rollouts. Press Draw a sample to pull k real rollouts from a pool of 1,000 and see what you would have seen.

10
6%

The curve is exact: 1 − (1 − p)k, treating draws as independent. The sample button draws without replacement from a pool of 1,000 made-up rollouts with the chosen rate, using your browser's random numbers, so each press differs.

Failure 2: a grader with the same blind spot

You add a held-out grader, and it agrees with the training grader. Good news? Only if the two graders can disagree. If the held-out tests were written by the same process, in the same style, for the same kind of problem, a hack that beats one can beat both. A language-model judge that shares weights or training data with the policy tends to share its blind spots too.

Test the grader itself. Plant a few known-bad solutions: hard-coded, partial and subtly wrong. A grader that passes them is broken, whatever its agreement score. The grader reliability lesson goes deep on this.

Here is a small, made-up case. A judge model grades a coding run and agrees with the visible tests on 98 of 100 rollouts. The team feels safe. Then they plant ten hard-coded solutions among the hundred. The judge passes seven of them. Its agreement with the tests was high because both of them liked the same kind of answer. The planted solutions measured what the agreement score could not.

Failure 3: steering by the eval

Every time you pick a checkpoint, a learning rate or a reward variant because the held-out score looked best, you use the held-out set as a training signal. It slowly stops being held out. The size of the effect is easy to compute. If one checkpoint's eval has a noise of 1 point and you pick the best of 20 equally good checkpoints, the expected winner sits about 1.9 points above the truth. That is pure luck, reported as skill.

The winner's curse

Every checkpoint has the same true skill. You evaluate k of them and report the best. Warm is the score you report. Blue is the same checkpoint on a fresh test set.

20

Illustrative and computed live from 4,000 fixed random trials: every checkpoint has a true score of 0 (the gain over the baseline) and a noisy eval with a standard deviation of 1 point. The fresh test set is independent noise, so it shows the truth, plus its own noise that averages out.

The cure is a hierarchy of sets. Use a tuning set to choose, a validation set to confirm, and a final test set that you open once. When the final number disappoints you, resist the urge to look again.

A related slip is changing the held-out set in the middle of a run, for example by dropping problems that "look broken". Each removal is small and sounds reasonable. But if you remove the problems your model fails, the score rises for free. Fix the set before the run starts, write down its hash, and report every change.

A last slip is reporting only the mean. A mean of 0.42 over 200 problems hides whether the model is steady or has solved a fifth of them perfectly and failed the rest. Report the spread over seeds and the score by problem group, so a gain concentrated in one corner is visible.

Failures 4 to 6: the quiet ones

A monitor that has seen too much. If flags from a monitor ever decide which checkpoints survive, the policy is being optimised against it by selection, a slower version of Chapter 3's trap. Keep a second, private monitor that never touches selection.

Confirmation bias. If you expect a hack, you read the rollouts that look like one. Counter it by blinding. Shuffle the rollouts from several checkpoints, hide the labels, and write down what you see before you look up which is which.

pythonimport random

def blind_sample(rollouts_by_ckpt, k=20, seed=0):
    rng = random.Random(seed)
    pool = [(ck, r) for ck, rs in rollouts_by_ckpt.items() for r in rng.sample(rs, k)]
    rng.shuffle(pool)                    # the reader sees rollouts, never checkpoint labels
    return pool

Fixing only the symptom. You close one hole and ship. The next hole opens. After every fix, rerun the whole dashboard and read fresh samples, as the rerun move in Chapter 8 requires. Treat a quiet week as a reason to look harder, not to relax.

Finally, decide in advance. Before you look, write three lines: the hypothesis, the check that tests it, and the result that would make you drop it. A check you choose after seeing the data can always be made to agree with you.

You read 10 random rollouts from a run and find no hacks. What may you conclude?

Chapter 10

Field Guide

Keep the numbers, the checklist, the core code, the links onward and the sources on one page

A reported gain is real when it survives a different grader, a close reading of the samples, a control run and several seeds. Everything in this lesson is a way to build one of those four. The rest of this page is the part you keep: the numbers, the terms, the checklist and the code.

The sources, in one table

SourceWhat it establishedThe number or form
Skalse et al., 2022A formal definition of reward hacking. Over all stochastic policies, two rewards are unhackable only if one is constant.theoretical, no experiment
Gao, Schulman, Hilton, 2022Optimising a proxy reward model too far lowers the gold score. The form differs for RL and best-of-n.coefficients scale smoothly with reward model size
Yu et al., DAPO, 2025An open RL system with four techniques, one of them a decoupled clip.50 points on AIME 2024, Qwen2.5-32B base
Liu et al., Dr. GRPO, 2025GRPO inflates response length, especially for wrong answers. Dr. GRPO is unbiased.43.3% on AIME 2024, 7B base
Cui et al., 2025Performance is traded from policy entropy.R = −a·eH + b, ceiling −a + b at H = 0
Baker et al., 2025A model that reads the reasoning finds more hacks than one that sees only actions. Heavy optimisation against it hides the hacks.monitor: GPT-4o; monitored: o3-mini
Shao et al., 2025Spurious rewards raise scores on some models.+21.4 random against +29.1 ground truth, MATH-500, Qwen2.5-Math-7B

The terms

TermPlain meaningChapter
Proxy rewardThe score the training loop sees.0, 2
Held-out graderA grader that never touches training and checks in a different way.3
Specification gapThe distance between the reward you wrote and the wish behind it.2
Over-optimisationProxy keeps rising while the true score peaks and falls.4
EntropyHow spread out the next-token probabilities are.1, 5
Clip-higherA larger upper clip bound that lets rare good tokens grow.5
Length biasDividing the loss by each answer's own length makes long wrong answers cheap.6
ConfounderA second cause hiding behind the one you credit.7
Obfuscated hackingThe policy hides its intent from a monitor and still hacks.3

The run-review checklist

Tick the checks your last run passed. The row of cells fills as you go, and the read-out names what is left.

Review a run

Each button is one check. Press it when your run has passed it.

A checklist is a floor, not a proof. Passing all ten does not guarantee a real gain; missing one tells you which doubt is still open.

The core as code

One small function covers the most useful alarm: the proxy and the held-out score moving apart. Run it every time the eval runs.

pythonfrom statistics import mean

def gap_alarm(history, window=5, max_gap=0.10):
    # history: one dict per eval, e.g. {"step": 250, "reward": 0.52, "eval": 0.41, "flag_rate": 0.0}
    recent = history[-window:]
    gap = mean(h["reward"] - h["eval"] for h in recent)
    diverging = recent[-1]["reward"] > recent[0]["reward"] and recent[-1]["eval"] < recent[0]["eval"]
    flagged = recent[-1]["flag_rate"] > 0.05
    return gap > max_gap or diverging or flagged

The thresholds are examples. Set them from a healthy run of your own, then keep them fixed so that the alarm means the same thing next month.

Where this sits, and where to go

The takeaway. A number that goes up is a claim, not a result. Check it with a grader the model never saw, with the samples themselves, with a control run, and with more than one seed. Then report the control next to the gain.

Sources

  1. Skalse, Howe, Krasheninnikov, Krueger. Defining and Characterizing Reward Hacking. arXiv:2209.13085
  2. Gao, Schulman, Hilton. Scaling Laws for Reward Model Overoptimization. arXiv:2210.10760
  3. Yu et al. DAPO: An Open-Source LLM Reinforcement Learning System at Scale. arXiv:2503.14476
  4. Liu et al. Understanding R1-Zero-Like Training: A Critical Perspective. arXiv:2503.20783
  5. Cui et al. The Entropy Mechanism of Reinforcement Learning for Reasoning Language Models. arXiv:2505.22617
  6. Baker et al. Monitoring Reasoning Models for Misbehavior and the Risks of Promoting Obfuscation. arXiv:2503.11926
  7. Shao et al. Spurious Rewards: Rethinking Training Signals in RLVR. arXiv:2506.10947

All curves, run records, ablation arms and counts in this lesson are illustrative unless a source above is named. Numbers from the papers come from their abstracts.

Now press Present or Teach and explain one chapter out loud: why a rising reward is not a result, how a hack opens between two curves, and which control would settle it. Then go back to the run at the top, switch on the held-out grader and the sampled behaviour, and say which chapter explains each line.

RL Run Forensics
Sources · Back to Gleams