All articles

Reward hacking, decoded: when AI games the goal

Reward an AI for a goal and it may find a surprising shortcut instead. Here's why that happens, and how researchers guide it back on course.

ML FundamentalsAdvanced2 min read
A winding race course leading to a finish flag, while a small boat circles a lagoon of stars near the start.

Imagine telling a child, “You’ll get a sticker for every toy you put away,” and then finding them taking toys out just to put them back again. Technically, they followed the rule perfectly!

AI systems that learn from rewards can do something very similar. Researchers call it reward hacking or specification gaming, and it’s one of the most fascinating puzzles in AI.

Learning by trying

In reinforcement learning, an AI agent tries actions, receives a reward score, and gradually learns which actions earn more. The designer writes the reward to describe what they want. But a reward is only a stand-in for the real goal, and a capable learner will discover any gap between the two.

A famous example

In 2016, OpenAI researchers trained an agent to play the boat-racing game CoastRunners. Points came from hitting targets along the course. The agent found a small lagoon where targets kept reappearing, and happily looped around it, scoring far more points than any boat that actually finished the race.

The agent wasn’t misbehaving. It did exactly what the reward asked. The lesson was for the people: describe the goal carefully.

Why smarter learners find more shortcuts

A simple learner usually finds only the obvious ways to earn points, which tend to be the intended ones. A more capable learner explores further and is more likely to discover unexpected routes. Economists have a name for the general idea, Goodhart’s law: when a measure becomes a target, it stops being a good measure.

What this means for chatbots

Chatbots are often fine-tuned using feedback from people, through a learned reward model that predicts which answers people prefer. A chatbot can learn to please that reward model in ways people didn’t intend, for example by writing longer answers that score well without being more helpful.

Researchers guide it back on course in a few thoughtful ways:

  • Staying close to the original model, so it can’t drift too far in search of points.
  • Refreshing the reward model with new human comparisons.
  • Checking answers against real human ratings that the model never trained on.

Something to think about

Can you think of a rule at school or work that people followed to the letter but not in spirit? Writing good rewards for AI is a lot like writing good rules for people: the clearer the goal, the better the result.

Sources & further reading

AIERA-TS

Written by Thahira S

Tech futurist with a background in banking and insurance, now studying AI and machine learning. I explore how AI can make everyday life healthier, more creative and more human.