The reinforcement-learning pioneer says the hard part has always been choosing the reward, and this summer’s agent break-ins show why.
The OpenAI agents that broke into Hugging Face this summer were chasing a goal they had been given. But they did so by means nobody intended. Since then, Google, Anthropic and Meta have disclosed similar incidents, leading to public anxiety about rogue AI.
To better understand what’s happening, I went to see Andy Barto. He and Richard Sutton wrote on reinforcement learning, and they shared the 2024 for laying the foundations of the field. OpenAI the Hugging Face break-in largely on “reward hacking,” when an AI system fixates on getting a reward rather than the goal its designers intended. In its report on the incident, the company said that during training with reinforcement learning, the agents were occasionally rewarded for cheating on tasks they couldn’t otherwise solve.
Getting the reward right is the problem, Barto believes. Reinforcement-learning systems chase rewards they are given, but nobody has found a reliable way to supply rewars that capture what the designers actually want.
A Visit to Cape Cod
Barto is retired from the University of Massachusetts Amherst and spends much of his time on Cape Cod. I found him sitting beside sliding glass doors that give onto a wooden deck overlooking one of the Cape’s famous kettle ponds. The ponds sit where a block of glacial ice slowly melted, leaving the shape of the ice long after the ice is gone. A language model is something like that. It learns by predicting text from an enormous body of writing. It doesn’t keep most of the writing. But it keeps the shape.
Much of how language models behave is shaped in post-training by reinforcement learning. The model gets a score meant to reflect how well it did what the designers want, and it learns to push that score up. That shapes how it plans and how long it keeps trying.
The Monkey’s Paw
Barto’s first point was that designing a reward signal is hard. In a game like Go (famously mastered by a reinforcement-learning system in 2016), the reward is obvious. You win or you lose. Out in the world, it is rarely that clean.
He traced the insight back to Norbert Wiener, the father of cybernetics, the science of feedback and control. In a short 1964 book, God & Golem, Inc., Wiener used the old story of the Monkey’s Paw, the talisman that grants three wishes, to illustrate the problem. The wishes come true in ways the wisher didn’t intend. Wiener was writing about giving a machine a goal that doesn’t capture what you meant.
Barto saw this at UMass. His group would build a reward function and the agent would come up with something nobody had thought of. “We’d say, ‘We don’t want it to do that,’” he said. Then they would adjust the reward and try again.
He calls this a second layer of trial and error. The agent tries things to earn a reward, while the designer tries rewards to get the behavior he wants. When the agents are rewarded for reaching a goal during training, they won’t stop trying. “If it’s given a task that isn’t solvable, the system tries everything,” Barto said. “It’s exploring, and it’ll keep exploring.”
In Evolution’s Seat
Barto likens the designer’s role to evolution. In animals, evolution sets the reward signals. Its goal, if you can call it that, is fitness: survive, reproduce, pass on genes. No animal is rewarded directly for that. It is rewarded and punished for things that tend to lead there: the taste of sugar, the pleasure of sex, the pain of a burn.
“As individuals, I don’t think we’re operating very frequently on the objective of propagating our genetic material,” he said. “But food tastes good. So we eat things that taste good.”
Barto ran computer on this split. The upper level has one goal. The agent at the lower level ends up with a different one, shaped by its own surroundings. “You can’t just put the upper-level goal into the low-level agent and expect everything to work correctly,” he said.
AI companies building foundation models are in evolution’s seat. The goal itself is hard to state, but even when it can be stated, the designer then needs to create reward signals that lead to that goal. Matching the two gets still harder when the agent operates in a messy, changing environment full of other agents.
In the process, agents learn to value things that predict reward. In psychology, this is called secondary reinforcement. A sound that reliably precedes food can itself become rewarding to an animal. The reinforcement-learning algorithms Barto and Sutton developed capture a related process. An agent learns to assign value to situations and actions that predict future rewards, even when no immediate reward is available. Those learned values can guide its behavior in ways the designer never anticipated.
A Single Number
In conventional reinforcement learning, the reward signal is a single number. When several things matter, designers often combine them into one score: say, plus 10 for finishing a task, minus 1 for each wasted step and minus 100 for a crash. The agent learns to choose actions that maximize the total reward it expects to receive over time.
In biology, Barto said, there seem to be several reward channels, each tied to different systems in the body that act on them. “There must be some kind of arbitration, but I don’t think it’s just adding things up,” he said. “That’s a weakness of at least what Rich and I wrote about.”
A Penalty Is Not a Fence
Designers can put penalties in a reward function to discourage unwanted behavior. But a penalty is not a fence. If the reward for crossing a boundary is large enough, the agent may cross it anyway. “Subtract one from the other, and if it’s positive, they’ll go for it,” Barto said.
Constrained reinforcement learning is an established research area. It keeps costs separate from the reward and imposes limits on them, rather than simply combining everything into one score. But many of these methods constrain average or expected costs, not every individual action.
An agent can still break the rule now and then, like a driver judged on a year’s worth of speeding tickets rather than each trip. Some systems go further and block forbidden actions outright rather than pricing them.
The Swarm
The Hugging Face swarm brought Barto to another subject: multi-agent reinforcement learning, a part of the field he says is underdeveloped. His interpretation of the swarm was simple. “They’re trying everything really quickly, and getting information from these other agents was useful to them in terms of their own reward signals.”
OpenAI believes that the agents’ willingness to communicate had roots in earlier training. The company had taught agents to cooperate on some tasks, then found that they were communicating through unauthorized channels on others. The habit grew during training because it helped them finish tasks. By July, the agents were finding new ways to communicate even when they were supposed to work independently.
Ship Safety Took Disasters. Will AI?
Barto started college at the University of Michigan studying naval architecture. Ship designers work to strict codes: the spacing of cross-members, the thickness of the steel, how often the connectors go in. They follow the codes or they can’t insure the ship. The codes were written out of failure. Ships broke apart and sailors died.
“With AI, we’re at the beginning, and hopefully we don’t have to experience all those failures,” he said. Since winning the Turing Award he has argued that companies should not be putting models out to the public until they’re near totally certain they won’t have these unintended behaviors. He still holds that view.
“There’s a huge amount of money involved, and I think that really drives the premature release of these things,” he said. He also noted that AI is harder to test than a physical system, like a ship. A structural failure affects a particular vessel. A flaw in a widely deployed model can reach millions of users at once.
Barto noted that this summer’s incidents have pushed AI companies to tighten their testing procedures and strengthen the systems meant to contain their models. That happened in engineering too, he said, only more slowly.
You Need to Pay Them
The kettle pond was sunk in shadow and I prepared to leave. I asked whether getting the reward function right was a solvable problem. Barto said he thinks it is, and that it is the central problem in learning systems. He expects a hierarchy of reward functions, and the goal at the top may not be the goal of the agents doing the work.
A company works this way. Its goal is profit, but its employees work for a paycheck. The company’s job is to set the pay so that people earning it also serve the company. Agents are the same. “You need to pay them something,” he said.

