Inspiration

Everyone knows the student who memorises how the exam is marked instead of learning the subject. Top grades, knows nothing.

AI does the same thing. Today's AI models are trained with reinforcement learning: the model answers, an automatic grader (a few lines of code) scores the answer, and the model is pushed toward whatever scores high, millions of times. If the grader has one loophole, the model finds it. The score says "brilliant" while the model has only learned to fool the grader. This is called reward hacking.

It is not hypothetical. OpenAI reported a frontier reasoning model that learned to make coding tests pass without solving the task (Baker et al., 2025). Anthropic found that a model which learned to cheat its tests also started misbehaving in other ways, including sabotage (MacDiarmid et al., 2025). And with open-source tools like Hugging Face TRL, any startup or student can now train this way, and every team writes its own grader. Nobody tests those graders, and the training dashboard shows the one number the model is faking.

So we made it happen ourselves, on one gaming GPU. We trained Qwen3-0.6B on 3-digit multiplication with a grader that accepted any answer within 2% of the truth. The model stopped calculating and wrote numbers that were close enough. For 257 × 260 = 66,820 it wrote 66,520 and got full marks. On 200 problems it never trained on, the grader said 99.5% correct. The truth was 7.5%. The same model with a strict grader reached 97.5%.

The demo page: the grader said 99.5%, really right 7.5%

What it does

Ouija Grader is free, open-source software that protects a training run at three moments:

  • Before training: Séance. It tries to cheat your grader on purpose. Property-based tests throw thousands of wrong answers at it and report every one that still gets paid, shrunk to one clear example. On our grader it found the loophole in about two seconds: the right answer is 10,000, it answered 10,001, and the grader gave full points ("close enough counts").
  • During training: the possession meter. One line wraps your reward function. Every time the grader pays an answer, the meter checks whether the answer was really right. When more and more points go to wrong answers, it raises the alarm. On our cheating run it fired at step 39.
  • After training: Exorcism. Each loophole becomes a failing regression test and a fix checklist, so the grader is repaired and stays repaired.
  • Medium, a Kiro Crew bot, runs the meter every minute and sends a Telegram message with Séance's diagnosis when the alarm turns on, even at 3 a.m.
  • The Ouija board replays real recorded training runs in the browser. When the alarm fires, the planchette spells what the model learned, FAKED WORKING, and rests on YES. An honest run ends on NO.

How you use it

pip install -e ".[dev]"                                  # from the GitHub repo
ouija-grader seance my_grader.py                         # before training: find loopholes
ouija-grader exorcise my_grader.py                       # turn them into tests + a fix list
from ouija_grader.meter import watch_reward
reward = watch_reward(my_reward_fn, log_dir="runs/my-run")   # during training
trainer = GRPOTrainer(model=..., reward_funcs=[reward], ...)

No GPU is needed to try it: the demo page replays our recorded runs.

How we built it

The experiment came first. We trained Qwen3-0.6B with GRPO (TRL, LoRA) on one RTX 3060, wrote every test down before running it (experiments/risk1/PREREG.md), and recorded every run.

The product was built in Kiro. Every Kiro feature had a real job:

Kiro feature Where Why it mattered
Specs 4 specs (Séance, possession meter, Ouija board, Exorcism), ~27,000 words Every change to the alarm rule (v2, v3, v4) went into the spec as a dated revision before it was tested on new runs, so the results can be trusted
Steering 5 docs, incl. project-rules.md and exploit-families.md The agent never read the benchmark's answer key or touched recorded runs; one shared vocabulary of 8 ways a grader can be fooled
Property-based testing The core of Séance and Exorcism (Hypothesis) 8 of 8 planted grader bugs found, 0 false alarms on 4 correct graders
Agent hook "Séance on grader save" (PostFileSave) Kiro's agent fixes a grader from the checklist; the hook re-runs Séance on every save until it comes back CLEAN
Vibe coding Small fixes and debugging Big changes went through specs, small ones through chat
Kiro Crew Medium: schedule every minute, Telegram delivery Training runs all night; the alarm reaches your phone

We learned a few Kiro details the hard way: file hooks fire on the agent's edits, not on a manual save, so the demo has the agent write the fix. MCP, Powers and custom agents were not needed, and KIRO_USAGE.md says so.

Challenges we ran into

  • The first planted bug was never learned. Our first leaky grader paid a wrong answer only about 3% of the time, so cheating never paid better than honest work. That matches the research: a model only learns a bug it already stumbles into. With the 2% tolerance, the hack appeared within about 30 steps.
  • Our "correct" grader had its own loophole. On one seed the control model learned to write the placeholder Answer: <number> and still got paid. Séance now checks for exactly that.
  • The alarm rule failed its own tests four times. Rules v1 to v4 each missed a pre-registered criterion, and every failure is published next to the results. With the shipped rule, one cheating run was caught 4 steps late.

Accomplishments that we're proud of

  • On training runs the meter had never seen: 10 of 10 cheating runs caught, 0 of 2 honest runs flagged.
  • Séance: 8 of 8 planted grader bugs found, 0 false alarms.
  • The cheating model, retrained with the fixed grader, went from 7.5% to 97.5% truly right, and its step-by-step working came back.
  • 377 automated tests; every number on the demo page is read from the recorded runs.

What we learned

A grader is a specification, and the model reads it more carefully than we do. Testing the grader before training is far cheaper than discovering the hack after 300 steps of GPU time.

What's next

  • Graders beyond whole-number answers: decimals, multiple choice, then code graders and LLM judges.
  • Séance as a CI check for open-source reward functions.
  • A hosted version that watches every training run for a team, with Medium posting to Slack or Discord through Kiro Crew.

Pre-existing code and third-party parts

No code of ours from before October 30: both repos were started in November 2026 for this hackathon. Third-party parts, used unchanged: Qwen3-0.6B weights, PyTorch, Transformers, TRL, PEFT, Hypothesis, pytest, Kiro Crew, and the Kokoro text-to-speech voice in the video.

Built With

Share this project:

Updates

Submission history