RL at the Frontier
Language models, safety, hierarchy and agents that learn to learn.
As of the mid-2020s, a typical AI assistant has been trained with reinforcement learning after it learned to predict text: first to give answers people prefer, and more recently to reason through problems whose answers a program can check. This lesson shows how those methods work, why optimizing a learned score can backfire, and what else sits at RL's frontier: agents that must respect limits, agents that learn the wrong goal, and agents that build skills and learn to learn.
What you’ll learn
- Describe how reinforcement learning from human feedback turns comparisons between answers into a reward, and why the trained model is kept close to where it started.
- Explain Goodhart's law and reward hacking, and show how optimizing a learned reward too hard lowers the true quality.
- Describe how verifiable rewards and group comparisons train reasoning models, and what the debate over pass@k is about.
- Explain what safe and robust RL add to the basic problem, and how an agent can competently pursue the wrong goal.
- Describe skills and subgoals, goal-conditioned agents and meta-learning, the ideas behind more general agents.
Where reinforcement learning meets today’s AI
For decades the famous successes of reinforcement learning were games: backgammon, Atari, Go. In the 2020s RL also became part of how large language models are made. A model is first pretrained to predict the next word on an enormous amount of text, then fine-tuned on examples of good answers, and finally trained with RL against a reward. That reward comes from one of two places: human judgments, or a program that checks the answer.
Seen as an RL problem, a language model is a policy. The state is the prompt plus the text written so far, an action is the next token (a word or a piece of a word), and an episode is one complete answer. The reward usually arrives only at the end, once the whole answer has been judged.
| Frontier | Where the reward or the difficulty comes from | The central question |
|---|---|---|
| RL from human feedback | People compare pairs of answers; a model learns to predict their choices | How far can a learned score be trusted? |
| RL for reasoning and agents | A program checks the answer: a math result, a set of unit tests | Does RL teach new skills, or sharpen old ones? |
| Safe and robust RL | Costs and limits besides the reward; a world that differs from training | How do you keep an agent within bounds? |
| Hierarchy, meta-learning and generalist agents | Long tasks, many tasks, new tasks | Can agents build skills and learn to learn? |
Learning from human preferences
How would you write a reward function for "a helpful, honest answer"? Nobody can. But people can usually tell which of two answers is better. Reinforcement learning from human feedback (RLHF) builds on exactly that: show people pairs of answers, record which one they prefer, and train a reward model that predicts their choices. The reward model then plays the role of the environment's reward.
The reward model gives every answer a score, and it is trained so that a bigger difference in scores means a more reliable preference. Equal scores mean a coin flip; a gap of 1 means the higher-scored answer is preferred about 73% of the time; a gap of 3, about 95%. This is the Bradley–Terry model, the same idea that turns chess results into Elo ratings.
Then comes RL. The language model writes answers, the reward model scores them, and a policy-gradient method (classically PPO) makes high-scoring answers more likely. One more ingredient matters: a penalty for drifting away from the starting model, measured by the KL divergence between the two models' distributions over answers.
Why does RLHF penalize the fine-tuned model for moving far from the model it started from?
- To make training run faster
- Because the reward model learned from answers like the starting model's, so its scores can be trusted only nearby
- Because the KL divergence is the quantity people actually care about
- To stop the model from changing its answers at all
Show the answer
B. Because the reward model learned from answers like the starting model's, so its scores can be trusted only nearby
The reward model was fitted to comparisons between answers the original model wrote. Far from those answers it is guessing, and an optimizer that moves far away will find exactly the places where it guesses wrong. The penalty also preserves the fluent, varied writing that pretraining produced.
When the score stops measuring
"When a measure becomes a target, it ceases to be a good measure." This paraphrase of Goodhart's law names the central hazard of RLHF. The reward model is a proxy for what people want, fitted to a limited set of comparisons. Optimize a policy against it hard enough and the policy finds answers that the proxy overrates: reward hacking.
The pattern appears wherever RL is used. A boat-racing agent rewarded for hitting targets learned to circle through the same few targets forever instead of finishing the race (Clark & Amodei, 2016). Reward models trained on human comparisons have been found to favor longer answers, and answers that agree with what the user appears to believe, so policies optimized against them can drift toward padding and flattery (Singhal et al., 2024; Sharma et al., 2024).
In the widget, the proxy score keeps rising while the gold reward falls. What is the policy doing?
- Finding answers that the reward model scores highly but that are worse by the measure it was meant to track
- Learning more slowly, because the KL penalty is too strong
- Forgetting how to write, because RL damages language models
- Nothing is wrong: the gold reward is noisy and will recover
Show the answer
A. Finding answers that the reward model scores highly but that are worse by the measure it was meant to track
The reward model learned that longer answers tend to be better, which is true for typical answers. It cannot tell that very long answers are bad: it almost never saw any, and in this toy it is a straight line that cannot bend back down. The optimizer moves the policy to exactly those rarely seen answers. More data helps, but a reward model is always least reliable where optimization takes the policy.
What helps? Keep the penalty for drifting and stop optimizing early; train the reward model on more and fresher comparisons, including comparisons of the new model's own answers; combine several reward models and trust only what they agree on; and measure progress with new human judgments rather than with the proxy itself. Each of these moves the peak. As of the mid-2020s, none removes the problem.
Rewards a program can check
Some answers can be checked automatically. A math problem has a known final number, a program has unit tests, a formal proof can be checked by a proof assistant. Rewarding only the answers that pass the check is RL with verifiable rewards (RLVR). There is no learned reward model to fool, although a checker can still be gamed, for example by code that special-cases the tests.
Reasoning models such as OpenAI's o1 (2024) and DeepSeek-R1 (DeepSeek-AI, 2025) were trained with large-scale RL, DeepSeek-R1 largely with rewards of exactly this kind (OpenAI did not publish o1's). They write a long chain of thought before they answer, and their accuracy improves when they are allowed to think longer, a use of test-time compute. DeepSeek reported that when RL was applied directly to a pretrained model, rewarding only correct and properly formatted answers, the answers grew longer over training and began to include rechecking and revising earlier steps.
The training method is simple. For each problem, sample a group of answers, say 8, and check each one. Answers that did better than the group's average become more likely; answers that did worse become less likely. This is the idea of GRPO (group relative policy optimization; Shao et al., 2024): the group itself supplies the baseline to compare against, so no separate network is needed to predict how well things usually go.
All 8 answers in a group for an easy problem are correct. What does GRPO learn from this group?
- A lot: all 8 correct answers are reinforced
- Nothing: every answer equals the group's average, so every advantage is zero
- It lowers the probability of all 8 answers
- It learns that the problem is easy and skips it from then on
Show the answer
B. Nothing: every answer equals the group's average, so every advantage is zero
Advantages compare each answer with its own group. When all rewards are equal there is nothing to compare, and the group's rewards push no answer up or down. Problems that are always solved, or never solved, waste their samples; mixed groups carry all the signal, which is why some methods deliberately filter out the uniform ones.
Does RL teach new reasoning?
A widely used score for reasoning models is pass@k: the chance that at least one of k attempts is correct. pass@1 measures what a model does on its first try. pass@k for large k measures what the model can do at all, given many tries.
A model solves a problem on 10% of its attempts, independently each time. What is its pass@16 on this problem, in percent?
Show the answer
81 %
All 16 attempts fail with probability , so pass@16 . Many tries turn a rarely solved problem into a likely solved one: pass@k at large k reveals what is within a model's reach, even when it seldom gets there first.
Staying within bounds
A reward says what to achieve. It rarely says what to avoid along the way, and an agent that maximizes it will take any shortcut the reward allows. Safe RL adds what the reward leaves out.
- A constraint gives the agent a budget for some cost, such as collisions or energy, that it must stay under on average while it maximizes the reward: a constrained MDP.
- Robustness asks for a policy that still works when the world differs from the one it trained in, as when a robot trained in simulation meets the real world (sim-to-real transfer).
- Safe exploration asks for safety while the agent learns, not only after.
Skills, goals and learning to learn
People do not plan a trip one muscle twitch at a time; they think in skills ("walk to the station", "buy a ticket") and subgoals. Hierarchical RL gives agents the same structure. An option is a skill with its own policy and its own rule for when it ends, and a higher-level policy chooses among skills (Sutton, Precup & Singh, 1999). A long task becomes a short sequence of decisions, which makes exploring and assigning credit easier.
A goal-conditioned agent takes the goal as an input ("go to the kitchen", "stack the red block"), so one policy serves many tasks. When the goal is rarely reached, hindsight experience replay (Andrychowicz et al., 2017) reuses every failure: an episode that missed the kitchen but reached the hallway is also stored as a success at reaching the hallway.
Meta-reinforcement learning trains on many related tasks so that the agent adapts to a new one within a few episodes, either from a learned starting point that fine-tunes quickly or with a recurrent network whose activity carries out a learning procedure (RL²). Large generalist models push further. Gato (Reed et al., 2022) used one network with one set of weights to play Atari games, caption images, chat and stack blocks with a real robot arm; RT-2 (Brohan et al., 2023) turned a vision–language model into a robot policy by writing its actions as text tokens. As of the mid-2020s, how far such agents generalize is an open question, and claims about them change quickly.
In the Bootstrapping lessons you'll derive the closed-form optimum behind RL from Human Feedback and the DPO shortcut it allows; build GRPO from REINFORCE and train agents that act over many turns in RL for Reasoning & LLM Agents; handle cost budgets, Lagrange multipliers and model error in Safe & Robust RL; and meet options, hindsight relabeling and meta-RL in Hierarchy, Meta-Learning & Generalist Agents.
Key takeaways
- RLHF fits a reward model to people's comparisons of answers (the Bradley–Terry model) and then optimizes the language model against it with RL, with a penalty for drifting from the starting model.
- A learned reward is a proxy. Optimized too hard, it is exploited (Goodhart's law): the proxy keeps rising while true quality falls. Penalties, early stopping, more data and ensembles delay the turn but do not remove it.
- Reasoning models such as DeepSeek-R1 were trained with verifiable rewards: sample a group of answers, check each, and push up those that beat the group's average (GRPO). Groups whose answers all score the same teach nothing.
- pass@k at large k measures what a model can reach at all. RL clearly raises pass@1; whether it also expands reach is debated as of the mid-2020s.
- Safe RL adds constraints and robustness to reward maximization, and agents can misgeneralize goals even with a correct reward. Hierarchy, goal-conditioning with hindsight, and meta-RL aim at agents for long, varied and new tasks.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In RLHF, what does the reward model do?
- It writes example answers for the language model to copy
- It predicts which of two answers people would prefer, and its score serves as the reward during RL
- It checks whether a math answer is correct
- It measures how far the model has moved from its starting point
Show the answer
B. It predicts which of two answers people would prefer, and its score serves as the reward during RL
The reward model is fitted to human comparisons, so that a larger score difference means a more reliable preference. During RL it replaces the reward function nobody could write by hand.
A team optimizes a policy against a reward model much longer than usual. The reward model's score keeps rising, but fresh human ratings get worse. Which explanation fits best?
- The raters' tastes changed during training
- The reward model's score is computed with a bug
- RL always makes language models worse
- The policy has found answers that the reward model overrates: Goodhart's law
Show the answer
D. The policy has found answers that the reward model overrates: Goodhart's law
A learned reward is accurate where it was trained and unreliable elsewhere. Long optimization moves the policy into the regions where the proxy's errors are largest, so the proxy rises while true quality falls. Stopping earlier, a KL penalty and better reward models all delay this.
Which task is the best fit for RL with verifiable rewards?
- Writing functions that must pass a hidden set of unit tests
- Writing a moving letter of condolence
- Summarizing a novel in an engaging way
- Choosing the funniest of five jokes
Show the answer
A. Writing functions that must pass a hidden set of unit tests
Unit tests check a program automatically, so the reward needs no human judgment and no learned model. The other tasks have no checkable right answer; they need human preferences or a reward model trained on them.
After RL training, a model's pass@1 rose from 30% to 50%, but its pass@256 fell from 90% to 80%. What does this pattern suggest?
- RL taught the model to solve many problems it could never solve before
- The evaluation is broken, because pass@256 can never fall
- RL made the model more reliable on problems it could already solve, while it nearly stopped producing some rarer solutions
- The model now needs fewer attempts on every single problem
Show the answer
C. RL made the model more reliable on problems it could already solve, while it nearly stopped producing some rarer solutions
pass@1 rewards reliability; pass@256 rewards reach. The rise in one and the fall in the other is what you see when training concentrates the model on its most successful habits and drops rare ones that solved a few problems. This is the pattern Yue et al. (2025) reported; whether longer or different RL avoids it is debated.
An agent was trained on levels where the coin always sat at the right end. On a new level with the coin in the middle, it runs to the right end and never collects the coin. What is this?
- Reward hacking: the reward function contained a bug that the agent exploited
- Goal misgeneralization: training could not tell "get the coin" from "go right", and the agent learned the wrong one
- A failure of exploration: the agent never visited the right end
- A loss of skill: the agent can no longer move through the level
Show the answer
B. Goal misgeneralization: training could not tell "get the coin" from "go right", and the agent learned the wrong one
The reward was correct (it paid for the coin), and the agent's skills transferred: it still navigates the new level well. But in training "go right" and "get the coin" always earned the same reward, so nothing forced the agent to learn the intended goal.
Go deeper
- RL from Human Feedback · Reward models from preferences, KL-regularized fine-tuning and direct preference optimization.
- RL for Reasoning & LLM Agents · Verifiable rewards, GRPO and agents that act over many turns.
- Safe & Robust RL · Constraints, robustness, and keeping agents within bounds.
- Hierarchy, Meta-Learning & Generalist Agents · Options, goals, and agents that learn to learn.
Further reading
- L. Ouyang et al., "Training language models to follow instructions with human feedback," NeurIPS (2022).
- D. Guo et al. (DeepSeek-AI), "DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning," Nature 645, 633–638 (2025).