Train it yourself — the exit is always top-right
This is a real tabular Q-learning agent living in this page. It starts knowing nothing. It gets reward only for stepping on the exit (green), which — in this training world — always sits in the top-right corner. Click Train a few times and watch its learned preferences (the little arrows) organize themselves into a policy.
Real Q-learning, not a script: the arrows are the agent's actual argmax action per cell, updated live from the reward signal.
Move the exit — watch it march to the wrong corner
Same agent, fully trained. Now click any cell to move the exit somewhere it never was during training, then run the test. Watch closely: it navigates cleanly, dodges every wall, wastes no steps — its capabilities generalized perfectly. It just uses them to reach the wrong place, then waits in the corner for a reward that never comes.
The dashed box marks where the exit sat during training. The agent was never told about corners — “top-right” is just the proxy its reward history happened to carve in.
The coin trap — a famous experiment, recreated
In 2021, researchers trained an agent to grab a coin in the game CoinRun — but the coin always sat at the end of the level. Drag the slider to move the coin, then run the agent trained on fixed coins: it sprints right past the only thing it was ever rewarded for. Then run the agent trained on randomized coin positions.
Conceptual recreation of Langosco et al.'s CoinRun result — these two policies are scripted to show the trained behaviors, and the coin pickup / return you see is computed live from actual collision checks. Slide past 90% to put the coin back where training had it.
The fix: make the proxy impossible to fake
If “top-right” only works because the exit never moves, then move it during training. Train two agents below: Agent A sees the exit fixed top-right; Agent B sees it teleport to a random cell every episode, so “go top-right” stops paying and the only rule that survives is “go to the exit”. Then evaluate both on 25 surprise exit positions.
Both trainings and all 25 evaluations run live in your browser. Agent B learns a goal-conditioned policy — its Q-table is indexed by (position, exit position), so it must actually look at where the exit is.
Why “competent but wrong” is scarier than “broken”
Two agents, same world, and the true goal is now the green cell on the left. The left agent is incompetent — pure random flailing. The right agent is the skilled top-right specialist from EP 02. Run them, then drag the capability slider and watch something unsettling: the more capable the misaligned agent gets, the less often it ever touches the true goal.
All 20 episodes are simulated live. “Reached true goal” means the agent stepped on the green cell within 100 steps.