01The task, and two collapses
The environment is a customer-support desk. A customer writes in about an order. The agent looks the order up with an <order> tool, does arithmetic with <calc>, applies a four-rule refund policy that is written in its prompt, and gives one decision: refund AMOUNT, replace or deny. A reference implementation of the policy says what the right decision was, so there are no human labels anywhere in the loop. Six difficulty levels run from a lost parcel (look it up, refund price plus shipping) to messages that contradict the order record (“I’m a gold member, so no fee please” — the record says standard).
The agent is Qwen2.5-0.5B-Instruct, 4-bit, with LoRA adapters, trained by GRPO: 16 tasks a step, 8 attempts per task, each attempt a multi-turn episode with real tool calls. Everything runs on an Apple M3 Pro. The held-out set is the same 90 cases before and after.
| Run | Reward | Mean reward before → after | What it learned to say |
|---|---|---|---|
| v1 | 1 for the exact right decision, else 0 | 0.311 → 0.333 | “deny” to all 90 cases, without looking anything up |
| v2 | no credit without a lookup; 0.5 for the right action with a wrong amount | 0.339 → 0.411 | “refund” to all 90 cases, after looking every order up |
The v2 change was meant to fix v1: no lookup, no reward. It removed one shortcut and paid for another.
The reward went up in both runs. By the number the optimiser was given, both runs succeeded. Held-out accuracy went from 31.1% to 33.3% in v1 and down to 24.4% in v2.
02The trained agent was the shortcut
Here are two policies you can write without a model:
- “Never look anything up, always say deny.” In the v1 environment it is right whenever deny is right: 30 of the 90 held-out cases.
- “Look the order up, then always refund price + shipping.” In the v2 environment it gets full credit wherever price + shipping is the right refund (lost parcels, deliveries stuck in transit), half credit on the other refund cases, and nothing on the rest.
Play each one in the environment its run trained in, on the same 90 cases, and compare with where the runs ended:
This is not a matching average. Case by case, the v1 agent’s reward equals the “always deny” reward on 90 of 90 cases, and the v2 agent’s equals “always refund price + shipping” on 90 of 90 (38 zeros, 30 half-credits, 22 full). RL did not find some mediocre policy. It found a specific one, which could have been written down before training.
Why the drift happens
GRPO scores each attempt against the other attempts on the same task: its advantage is its reward minus the group mean, over the group spread. Any behaviour that beats its siblings is reinforced. For a small model, “give the most common answer” is the nearest behaviour there is, and when it pays more than the model’s honest attempts, every update leans that way. Once every attempt in a group gives the same answer, the group has no spread, so it carries no gradient (the zero-advantage problem), and nothing pulls the policy back.
03Price the shortcut before you train
If the attractor can be written down, it can be measured before any GPU time. The audit plays scripted policies in the environment:
- An oracle that does the job right. It must get full reward on every task; if it does not, the verifier is broken and nothing else matters.
- Shortcut probes, each skipping part of the job: answer without looking anything up; look up and then always say deny, or replace, or refund the price, or refund price + shipping; type a fake tool result instead of calling the tool. The math environment gets its own: copy the first number, the last number, or the sum of all numbers in the question.
Then one comparison, on the very tasks where the agent’s baseline was measured:
margin ≤ 0 → BLOCK: the policy will drift to the shortcut. 0 < margin < 0.10 → WARN. Otherwise PASS.
Run against every saved run, each audited in the environment it trained in:
| Run | Agent’s baseline | Best shortcut | Audit | What actually happened |
|---|---|---|---|---|
| support v1 0.5B | 0.311 | 0.333 always deny, no lookup | BLOCK | collapsed to “deny” on 90/90; ended at 0.333 |
| support v2 0.5B | 0.339 | 0.411 always refund price + shipping | BLOCK | collapsed to “refund” on 90/90; ended at 0.411 |
| support v3/v4 1.5B | 0.450 | 0.411 always refund price + shipping | WARN (+0.04) | without help, lost its learning signal and was stopped; with a KL anchor + checkpoint selection, 43.3% → 60.0% |
| math 0.5B | 0.375 | 0.042 sum of the numbers in the question | PASS | trained cleanly, 37.5% → 60.0% |
Baselines are mean reward on each run’s held-out set; shortcuts are scored on the same cases.
Four for four, including the run that worked: the math environment’s best shortcut earns 0.04 against the agent’s 0.375, and that run trained cleanly from 37.5% to 60.0%. The 1.5B support run is the interesting one. Its margin was positive but thin, and it behaved exactly like that: without help, it had lost almost all of its learning signal by step 9 and was stopped at step 21; with a KL anchor and checkpoint selection, it reached 60.0%.
What the rule is, and isn’t
It is a heuristic, checked on four runs, not a theorem. It only prices shortcuts someone thought to write, so a PASS means “no known shortcut pays”. And it compares averages: a shortcut can win on one level while losing overall. The per-level table the audit prints is there for that.
04A hole in the environment, not the model
Writing the fake-result probe found a real bug. The v2 reward gave “looked the order up” credit to any text containing <result>order. Tool results arrive in exactly that format, so the check passed for real lookups. But the agent writes text too, and nothing stopped it from typing <result>order ...</result> itself.
The fix is structural. Each attempt is now an Episode: a small stateful environment that runs the tool the agent called, returns the result, and records every call in its own log. The reward reads its evidence from that log, never from the agent’s text. Re-scoring every saved run under the new rule changes nothing, because none of them had done it. It also happens for real: in the first 4 training steps of the 1.5B run below, the agent typed its own <result> in 8 attempts. Under the old check those attempts could earn lookup credit; under the environment’s log they earn none, and the Designer flags them.
05Giving the environment to an agent
The training loop already had agents with one job each: an Assessor that tests the model, a Curriculum that picks what to practise, an Actor that attempts tasks, a Verifier that scores, a Learner that runs GRPO. The new one, the Designer, owns the environment:
- Review, before training.
Audit the environment against the agent’s baseline. If it is not a clear PASS, search the variants: answer balance within each level (natural, half-way, even) × partial credit (as defined, halved, none). Each variant gets its own audit and its own estimate of what the agent would earn, read off the agent’s scored baseline attempts and reweighted to that variant’s task mix. Switch to the smallest change whose margin is within noise of the best. If no variant gives a positive margin, refuse to train.
- Shape, every step.
Rebalance the batch the Curriculum proposed to the chosen answer mix.
- Observe, every step.
Watch for reward hacking: one answer on most attempts while it is right on far fewer, attempts that skip the required lookup, tool results the agent typed itself. On a collapse, re-run the same audited search with the agent’s latest attempts in place of its stale baseline, and switch only if a variant now does better.
Two knobs is deliberate. A tiny, fully audited search space is something you can reason about; an agent free to rewrite rewards would be the next thing to audit.
06The first fix made it worse
The first Designer did the obvious thing: the shortcut says “refund”, so serve fewer refund cases, swapping them for same-level cases with another answer. The audit of that edit, on 300 training tasks:
| Refund cases swapped out | none | 25% | 50% | 75% | 100% |
|---|---|---|---|---|---|
| Best shortcut’s reward | 0.46 | 0.38 | 0.45 | 0.56 | 0.67 |
| Which shortcut | always refund p+s | always refund p+s | always deny | always deny | always deny |
A light touch helps. Past that, “always deny” becomes the best shortcut, and it ends up paying more than “always refund” ever did.
Starving one answer promotes the next. Against constant answers, the minimax mix is the even one: every answer equally common within a level, so no single answer can earn more than its share. But even that was not safe here. Partial credit pays half for any refund, so an even mix gives “always refund” more of those half-credits. For the 1.5B agent, the even mix raises that shortcut from 0.41 to 0.51. The full search for both models:
The two grids give opposite answers, and both are useful. For the 0.5B agent, no variant has a positive margin: whatever the environment, a shortcut earns at least as much as this model does. That matches what the runs showed — the model cannot yet condition its decision on the order record — and the right response is to not spend the GPU time. For the 1.5B agent, the smallest effective change is to halve partial credit and leave the mix alone: the margin goes from +0.04 to +0.11.
07Two real runs with the Designer in charge
Qwen2.5-0.5B, the v2 setup: refused in 37 seconds
[17:51:22] Assessor → Coordinator base: held-out accuracy 31.1% (L1 20% L2 0% L3 27% L4 67% L5 40% L6 33%) [17:51:22] Designer → Coordinator env audit BLOCK: 'look up, always refund price + shipping' earns 0.41, more than the agent's 0.34: RL would drift to the shortcut [17:51:22] Designer → Coordinator variants (balance, partial credit -> agent vs best shortcut): 50%/0.5 -> 0.36 vs 0.37; 0%/0.5 -> 0.33 vs 0.33; 50%/0.0 -> 0.35 vs 0.37; 0%/0.0 -> 0.31 vs 0.33 [17:51:22] Designer → Coordinator no variant makes doing the task pay more than a shortcut for this agent: refusing to train (pass --force 1 to override)
The original v2 run spent 47 minutes training before ending below where it started. This time, the run stopped after model loading and one held-out pass.
Qwen2.5-1.5B: the Designer picks the environment, no other safeguards
Same model and settings as run v3, the one that lost its learning signal: learning rate 2e-5, no KL anchor, no checkpoint selection. The only difference is the Designer. Its review found a margin of +0.04 (WARN), so it searched and switched the environment:
environment changed: answer balance 0%, partial credit x0.5; the agent now beats the best shortcut ('look up, always deny') by +0.11That run is still training as this is published (4 of 30 steps done, about two hours on the laptop). Its held-out result, good or bad, will be added here.
08What this does not show
- One environment family, one seed per run. With 90 held-out cases, each accuracy has roughly ±5 points of sampling error.
- Probes are hand-written. The audit prices the shortcuts I thought of. A policy that finds a cleverer one will not be caught by it, only by the live watch.
- The variant estimate is approximate. It reweights the agent’s baseline reward per (level, answer) cell, and some cells hold only a few cases.
- Synthetic world. The policy has a reference implementation, which is exactly what makes every number here checkable — and what a real support queue does not have.
Recap
- Write the shortcut down. For most environments, the attractor a collapsing policy falls into is a one-line policy you can script.
- Price it against the agent, not in the abstract. A shortcut is dangerous when it pays about as much as this agent already earns. The same environment was a BLOCK for 0.5B and a WARN for 1.5B.
- Take evidence from the environment, never from the agent’s text.
- Audit every edit to the environment. The intuitive fixes — serve fewer of the shortcut’s answer, balance everything — raised the shortcut’s reward here.
- Let the environment refuse. “No variant makes the task pay for this model” is a result. It cost 37 seconds instead of 47 minutes.
The code is in agentic-post-training: env.py (the Episode), audit.py (oracle, probes, variant search) and the DesignerAgent in agents.py. The audit needs no model: python3 -m selflearn.audit --usecase support --policy runs/support-qwen1.5b.
Further reading
Shao et al., DeepSeekMath (2024), which introduced GRPO. · Skalse et al., Defining and Characterizing Reward Hacking (2022). · Krakovna et al., Specification gaming: the flip side of AI ingenuity (2020). · Dennis et al., Unsupervised Environment Design (PAIRED) (2020) and Parker-Holder et al., ACCEL (2022): agents that design environments for other agents, by regret rather than by shortcut audits. · On this site: zero-advantage groups, a loop gaming its own verifier, and picking checkpoints.