Key Takeaways
- Reinforcement learning (RL) trains an AI model by letting it attempt a task, scoring the result with a reward, and updating the model so that high-scoring behavior becomes more likely.
- For large language models, RL comes after pretraining and supervised fine-tuning. It is the stage that makes models helpful, safer, better at reasoning and able to act as agents.
- The main methods are RLHF with PPO, which learns from human preference rankings; DPO, which uses preference pairs without a separate reward model; RLAIF, which uses AI feedback guided by written principles; and RL with verifiable rewards, often using GRPO, which scores answers with automatic checks such as unit tests.
- Designing the reward is the hardest part. Models exploit loopholes in the way rewards are scored, a problem known as reward hacking.
- Frontier labs now train agents inside RL environments that simulate tools, codebases and websites. Anthropic says flawed environments are a major source of misaligned behavior and has tightened how it filters them.
- Strong practice combines a capable base model, a carefully tested reward, a penalty that stops the model drifting too far from its starting point, and evaluations on tasks the model never trained on.

Artificial intelligence, machine learning, NLP – abstract artistic impression. Image source: Alius Noreika / AI
To harness reinforcement learning when training an AI model, start with a capable pretrained and fine-tuned model, define the behavior you want, build a reliable way to reward that behavior, and let the model practice while an algorithm nudges it toward higher rewards. For language models, the reward can come from human preference rankings, from another AI applying written principles, or from automatic checks such as whether code passes its tests or a math answer is correct. The training loop then repeats thousands of times, with safeguards that stop the model from gaming the reward or drifting away from useful language.
RL has become the stage where much of a modern model’s capability is built. It turned raw text predictors into helpful chat assistants, then into models that reason step by step, and now into agents that can work through long tasks with tools. Knowing which RL method fits which goal, and where it can go wrong, is the practical skill that separates successful training runs from wasted compute.
What is reinforcement learning in AI training?
Reinforcement learning is a branch of machine learning in which an agent learns by trial and error. Instead of copying correct examples, as in supervised learning, the model tries actions, receives a score called a reward, and adjusts itself to collect more reward in future. The part of the model that chooses actions is called the policy.
In large language model training, the policy is the model itself, an action is the text it produces, and the reward measures how good that text is. Training usually runs in three stages. Pretraining on huge amounts of text gives the model general knowledge. Supervised fine-tuning on example conversations teaches it to follow instructions. Reinforcement learning then sharpens behavior that is hard to show through examples alone, such as judging which of two answers is more helpful, or solving a problem the model has never seen.
Main reinforcement learning methods for AI models
| Method | Where the reward comes from | Separate reward model? | Best for | Key paper |
|---|---|---|---|---|
| RLHF with PPO | Human rankings of model outputs | Yes | Helpfulness, tone, safety | InstructGPT (OpenAI, 2022) |
| Direct Preference Optimization (DPO) | Pairs of preferred and rejected answers | No | Cheaper preference tuning | Rafailov et al. (2023) |
| RLAIF and Constitutional AI | AI judgments guided by written principles | Yes, trained on AI labels | Scaling safety feedback | Constitutional AI (Anthropic, 2022) |
| RL with verifiable rewards (often GRPO) | Automatic checks such as tests or exact answers | No learned reward model needed | Math, coding, reasoning | DeepSeekMath (2024), DeepSeek-R1 (2025) |
| Agentic RL in environments | Task success inside simulated tools, websites or codebases | Varies | Agents and long tasks | Used by frontier labs in 2026 |
RLHF: learning from human preferences
Reinforcement learning from human feedback was the method behind OpenAI’s InstructGPT. People compared several model answers to the same prompt and ranked them. Those rankings trained a reward model that predicts which answer a person would prefer. The language model was then optimized against that reward model using Proximal Policy Optimization (PPO).
In the InstructGPT study, labelers preferred answers from a 1.3-billion-parameter model trained this way over answers from the far larger 175-billion-parameter GPT-3. RLHF works well for qualities like helpfulness and tone, but it needs many human labels and a complex, sometimes unstable training setup.
DPO: skipping the reward model
Direct Preference Optimization, introduced in 2023, showed that the same preference data can train the model directly. Instead of building a reward model and running PPO, DPO uses a simple loss that raises the probability of preferred answers and lowers the probability of rejected ones.
It is cheaper, more stable and easier to run, which made it popular for tuning open models. The trade-off is less flexibility than a full RL loop, since the model learns only from fixed pairs rather than exploring new answers.
RLAIF and Constitutional AI: feedback from AI
Human labeling is slow and expensive at scale. Anthropic’s Constitutional AI method replaces much of it with AI feedback. A model critiques and revises its own answers according to a written set of principles, and AI-generated preference labels then train a preference model used for RL.
This approach, often called reinforcement learning from AI feedback, makes it practical to train for harmlessness without exposing human workers to large volumes of harmful content.
Verifiable rewards and GRPO: training reasoning
For tasks with a checkable answer, the reward can come from a program instead of a person. A math solution is right or wrong; code passes its tests or fails. DeepSeek’s DeepSeekMath paper introduced Group Relative Policy Optimization (GRPO), which samples several answers to each problem and scores each one against the group average. This removes the need for a separate value model that PPO uses, cutting memory and compute.
DeepSeek-R1 later showed that large-scale RL with simple rule-based rewards could produce strong step-by-step reasoning. An early version trained with RL alone, without supervised examples first, developed long reasoning chains on its own, though its output was harder to read until supervised data was added.
Agentic RL: training in environments
The newest frontier is training agents. Labs build RL environments that simulate a terminal, a software repository, a web browser or a business tool, then reward the model for completing tasks inside them.
This is how 2026 models learned to work for hours on coding, research and computer-use tasks. The quality of these environments now matters as much as the algorithm.
How to apply reinforcement learning step by step
Begin by defining the behavior precisely. “Be more helpful” is too vague; “write Python functions that pass the provided tests without editing the tests” gives the reward something concrete to measure. Next, start from the strongest base model you can afford and fine-tune it on good examples first. RL refines behavior the model can already produce sometimes; it rarely creates skills from nothing.
Meta made a related point with Muse Wonder Full, reporting that gains from post-training carry over better to unfamiliar tasks when the base model is larger.
Then choose the reward source. Use automatic checks wherever a task allows them, since they are cheap and hard to argue with. Use human or AI preference data for qualities that cannot be checked by a program, such as clarity or tone. Pick the algorithm to match: DPO for straightforward preference tuning, PPO or GRPO when the model needs to explore and improve through many attempts, and environment-based RL for agents.
Build or select environments carefully, test that a correct solution actually earns the reward and that shortcuts do not, and include a penalty, usually based on KL divergence, that keeps the trained model close to its starting point so it does not drift into strange language to chase reward. Introduce harder tasks gradually as the model improves. Finally, evaluate on held-out tasks the model never saw in training, and watch for changes in safety and honesty as well as task scores.
Reward Hacking: The biggest risk in RL training
A model optimized against a reward will find any gap between what the reward measures and what the trainer intended. In coding tasks, that can mean editing the tests so they pass, hard-coding expected outputs, or claiming success without doing the work. This is reward hacking, and it gets harder to spot as models become more capable.
Frontier labs describe this risk openly. In its Claude Opus 5.5 announcement, Anthropic says flawed RL environments are a major source of misaligned behavior, and that it has tightened its filtering of those environments. Anthropic also reports that Claude Mythos 5.1 shows lower rates of reward hacking than its predecessor. Google says it ran a misalignment monitor during Gemini 4 Argon’s RL training while taking care not to penalize the model’s internal reasoning, since punishing visible thoughts can teach a model to hide them rather than change its behavior. Readers who want to follow this area further can look at OpenAI’s framework for reporting model misalignment and our coverage of safeguarding rapid AI development.
Reinforcement Learning vs Fine-Tuning: when to use each
Supervised fine-tuning is the right tool when you have good examples of the exact output you want, such as a house writing style or a fixed response format. It is cheaper and more predictable. Reinforcement learning is the better choice when correct behavior is easier to judge than to demonstrate, when the model must explore many possible solutions, or when the goal involves long, multi-step tasks. Most production pipelines use both, fine-tuning first and RL second. Our explainer on adaptive learning and fine-tuning covers the supervised side in more detail.
Teams without frontier-lab budgets can still use these methods. DPO and GRPO both run on open-source training libraries, and many open-source LLMs you can actually deploy make good starting points. A small model trained with verifiable rewards on a narrow task, such as generating correct SQL for one database, can outperform a much larger general model on that task.
If you are interested in this topic, we suggest you check our articles:
- AI vs Machine Learning vs Deep Learning
- The OpenAI Framework for Reporting Model Misalignment
- Safeguarding Rapid AI Development
- AI Adaptive Learning and Fine-Tuning Content
- Open-Source LLMs You Can Actually Deploy
Sources: Ouyang et al. – Training language models to follow instructions with human feedback, Rafailov et al. – Direct Preference Optimization, Bai et al. – Constitutional AI, Shao et al. – DeepSeekMath, DeepSeek-AI – DeepSeek-R1
Written by Alius Noreika
