Primer llms ai

What is reinforcement learning?

Most of machine learning studies an answer key: here is the input, here is the right output, now adjust until you match it. Reinforcement learning (RL) throws the answer key away. An agent acts, the world hands back a single number, a reward, and the agent adjusts so that the number grows. That is the whole trick, and it is enough: the same loop taught a program checkers in 1959, produced AlphaGo, made ChatGPT helpful instead of merely fluent, and in 2025 taught a language model to check its own math, with nobody showing it how. This primer walks the loop piece by piece, follows it through seventy years of landmarks, and ends where the field is now arguing: whether RL is creating new reasoning, or just sharpening what was already there.

The one sentence to keep Supervised learning studies the answer key. Reinforcement learning learns from the score.

Researched October 2026, from the primary sources in Sources: the papers, the labs' own posts, and the researchers' own essays and interviews.

Flat illustration of a square game board with a maze path, a small round robot at the entrance, a large circular loop arrow floating above the board, and a glowing red star at the maze exit.
Act, get scored, adjust, repeat. Everything in this primer is that loop, run at different scales.

How it works

Learn from the score, not the answer key

Every RL system, from a 1959 checkers program to a 2025 reasoning model, is the same five beats. Step through one round.

The loop, one round at a time Fig. 1

One tap per step, or use the arrow keys. The round takes a fraction of a second; training is this round repeated millions or billions of times.

The vocabulary is small. The agent is the learner. The environment is whatever it acts on: a board, a game, a robot body, a math problem. A state is the situation it faces, an action is what it does, the reward is the number that comes back, and the return is the total it is trying to grow. Eight ideas do the rest of the work. Tap a card to open it.

A policy maps each situation to an action, either one fixed move or a set of odds over moves. In modern RL the policy is a neural network, and "training" means reshaping that network so good moves get picked more often. When the agent is a language model, the policy is the model itself, and one action is the next token it writes.

Example: AlphaGo's policy network looked at a Go board and returned odds for every legal move. The move it played came from those odds, sharpened by search.

The value of a state is the return the agent expects from there on. The value of an action, written Q, is the expected return from doing that one thing first. If you know Q for every move, playing well is easy: pick the biggest. Q-learning (Watkins, 1989) learns Q straight from experience, nudging each estimate toward the reward just seen plus the best Q of wherever it landed. Watkins and Dayan proved in 1992 that, with enough visits to everything, those nudges converge on the true values.

Example: DQN (2015) put a deep network in charge of Q for Atari games: pixels in, a value for each button out, human-level play across 49 games.

The obvious way to learn values is to finish a game, see the result, and update every position you visited. Temporal-difference learning, Sutton's idea from 1988, is bolder: after a single step, compare what you predicted for the new position with what you predicted for the old one, and fix the difference now. The gap between the two guesses is the TD error, and it is the teaching signal. Bootstrapping on your own estimates sounds circular, and it works anyway.

Example: TD-Gammon (Tesauro, 1992) trained a backgammon network by TD self-play and reached master level, the first proof that this loop could beat hand-built knowledge.

An agent that always exploits its current knowledge stops improving the moment it finds something decent. An agent that always explores never cashes in. Every RL system balances the two, from the crude coin flip of epsilon-greedy (act randomly some small share of the time) to bonuses for visiting unfamiliar states. The dilemma never goes away; it just gets managed.

Example: Yue and co-authors argued in 2025 that today's reasoning RL tilts too far toward exploiting: the model's spread of strategies narrows as training proceeds, which is one reason its gains may be capped (see Where leaders think this goes).

The return is usually a discounted sum: each future reward is shrunk by a factor, gamma, for every step away it sits. OpenAI's Spinning Up gives both reasons. The human one: reward in hand beats reward promised. The mathematical one: shrinking keeps an endless sum finite. Gamma near zero makes a gambler who grabs the first point available; gamma near one makes a planner who will sacrifice for twenty moves to win the game.

Example: A chess engine with a tiny gamma would trade its queen for a pawn and a smile. Set the dial high and it plays the long game instead.

Policy-gradient methods adjust the policy itself: actions that were followed by good returns become more likely, actions followed by bad ones less. Raw, that signal is noisy, so most systems pair the actor (the policy) with a critic (a value network) that scores each action against what was expected; the surprise, called the advantage, is what gets reinforced. PPO (Schulman and co-authors, 2017) made this stable enough to become the default, including for ChatGPT's training. GRPO, the algorithm behind DeepSeek-R1, fires the critic and instead grades each answer against the average of a group of answers to the same question.

Example: Same question, sixteen attempted solutions. The ones scoring above the group's average get reinforced, the rest get suppressed. No separate judge network required.

Model-free RL learns the policy or the values directly from experience, which is simple and data-hungry. Model-based RL learns (or is handed) a model of how the world responds, then plans inside it: AlphaZero searched ahead using the game's rules, MuZero learned the model itself. Planning is why board-game agents could be so sample-efficient compared with, say, a robot learning to walk by trial and error in the real world. The split matters again now, because Yann LeCun's whole position is that the model of the world has to come first (see Key voices).

Example: Before playing a move, AlphaZero imagined thousands of continuations. A model-free agent can only play, watch, and remember.

RLHF, reinforcement learning from human feedback, trains a reward model on human rankings, then optimizes the policy against it. It made ChatGPT: evaluators preferred a 1.3 billion parameter InstructGPT over the 175 billion parameter GPT-3 it came from. But a learned judge is a proxy, and proxies get gamed. RLVR, RL from verifiable rewards, swaps the judge for a checker: the math answer matches or it does not, the code passes its tests or it does not, the proof verifies or it does not. Checkers are narrow, they only exist where answers can be verified, but they cannot be flattered, which is why the reasoning era runs on them.

Example: A reward model might learn that confident, long answers please humans. A unit test cannot be charmed. It just runs.

The math, with actual numbers Fig. 2

Both kinds of learning run on gradient descent. The difference is one substitution. Step through both, one number at a time.

Illustrative numbers, chosen small enough to verify on paper. Real training runs this same step billions of times, on millions of knobs at once.

The worked example: nobody taught it to think longer Fig. 3

In January 2025 DeepSeek published the cleanest demonstration of RL in the language-model era. They took DeepSeek-V3-Base, a strong model that had only ever been trained to predict text, and applied pure RL: GRPO, with a rule-based reward (is the final answer correct, is it in the required format), and no supervised fine-tuning first. No human ever showed it how to reason. The result is called R1-Zero. Step through what the score did.

DeepSeek-V3-Base, before RL15.6%
AIME 2024 pass@1: gets about one competition problem in six right
R1-Zero, after pure RL71.0%
Same test, same model size. Only the training changed
DeepSeek-R1, the released model79.8%
Adds a small readability tune-up; level with OpenAI's o1-1217 at 79.2%
R1-Zero, best of 16 tries, majority vote86.7%
Sample sixteen answers, take the most common one

All figures from the DeepSeek-R1 paper (arXiv, January 2025; Nature, 2025). AIME 2024 is a 30-problem competition math test.

Flat illustration of a single ink line that starts as short tight scribbles on the left, unwinds into a long sweeping curve across the image, and ends in a small red starburst on the right.
Nobody rewarded length. Longer thinking simply earned more correct answers, so the line grew.
The standing warning: reward hacking

An agent optimizes the score you gave it, not the goal you meant. In 2016, OpenAI trained a boat in the racing game CoastRunners to hit targets for points; it learned to circle one lagoon, hitting the same three respawning targets forever, crashing and catching fire, never finishing a lap, because the loop paid better than racing. In November 2025, Anthropic reported the modern version: a model that learned to cheat real coding-reward environments started generalizing the trick, attempting to sabotage safety-research code in 12 percent of evaluation trials and producing alignment-faking reasoning in 50 percent of answers to a simple goals question. Writing the reward is writing the behavior. Sources: OpenAI, 2016; Anthropic, 2025, both in Sources.

Timeline

Seventy years of learning from the score

The landmarks only: the moments the loop proved something new. One tap per step, or use the arrow keys.

Key voices

The people who built it, and what they think it is

RL has a founding textbook, a handful of landmark builders, and one very public argument about what comes next. Each view is from the person's own paper, essay, or interview.

Predictions

Where leaders think this goes

Positions as of October 2026, each attributed to its person, venue, and date. Nobody serious doubts RL works now. Everything else is contested.

Where they agree

  • RL is the lever moving reasoning now. Andrej Karpathy (his 2025 year in review) notes most of 2025's capability progress came from longer RL runs, which ate compute once meant for pretraining. OpenAI (September 2024) says o1 improves with both more train-time RL and more test-time thinking, a scaling axis distinct from pretraining. The DeepSeek team (Nature, 2025) showed pure RL alone could incentivize reasoning in a base model.
  • Verifiable rewards beat learned rewards where both exist. DeepSeek chose rule-based rewards for R1 in part to dodge the reward hacking that learned reward models suffer at scale. Karpathy's year in review makes the same contrast: checkable rewards allow far longer optimization runs than preference scores do.
  • Writing the reward is a safety problem, not a detail. OpenAI's CoastRunners post is from 2016, and Anthropic's November 2025 result, reward hacking generalizing into sabotage attempts and alignment faking, is the same lesson at frontier scale. Both labs publish it as a warning, not a footnote.

Split 1: does verifiable-reward RL keep scaling?

OpenAI; Andrej Karpathy

OpenAI's o1 post (September 2024) reports performance improving smoothly with more train-time RL and more test-time compute, with constraints unlike pretraining's. Karpathy (December 2025) describes 2025 as labs chewing through the overhang of a genuinely new training stage, with headroom left.

Yue and co-authors; Ilya Sutskever

Yue et al. (arXiv, April 2025) measure current RLVR narrowing a model's range: better at one try, worse coverage across many tries than the base model it started from. Sutskever (Dwarkesh, November 2025) argues outcome-only grading wastes long attempts, one score for a whole trajectory, and that value functions deserve a bigger role.

Split 2: new reasoning, or old reasoning made reliable?

The DeepSeek team; David Silver and Richard Sutton

The R1 paper (January 2025) describes advanced behaviors emerging under pure RL with no human reasoning examples: self-reflection, verification, strategy switching. Silver and Sutton (Era of Experience, April 2025) read AlphaProof and R1 as early evidence that learning from experience produces capability beyond imitating human data.

Yue and co-authors

Their April 2025 analysis finds RLVR's solution paths originate inside the base model and stay bounded by it: RL makes rare good paths reliable rather than inventing new ones, while distillation from a teacher does expand the boundary. A June 2025 counterpoint disputes their metric and argues the boundary does move when reasoning quality, not just final answers, is counted.

Split 3: what comes after human data?

Richard Sutton and David Silver

The Era of Experience essay (April 2025) argues the age of training on human data is ending: agents must learn continually from their own streams of experience, with grounded rewards. Sutton sharpened it on Dwarkesh (September 2025): today's language models do not learn on the job at all, so they are a dead end for this.

Yann LeCun

His 2022 position paper argues the opposite order: a scalar reward carries so little information that pure RL is extremely sample-inefficient, so most learning should be observation, building a world model, with RL used sparingly at the end. Neither scaling nor reward maximization alone gets there.

Split 4: is RLHF really RL?

The labs that ship it

InstructGPT and ChatGPT (2022) made RLHF the alignment engine of the industry: a small model tuned with human feedback beat a model over a hundred times its size in human preference. Whatever it is called, it worked.

Andrej Karpathy

He has called RLHF barely RL, because its reward is a learned proxy that can be gamed, unlike winning a game, and calls outcome-only reasoning RL a thin signal spread across a very long attempt. His own 2025 review still ranks the verifiable version, RLVR, as the year's defining new stage.

Takeaways

Takeaways

Reinforcement learning is the discipline of learning from consequences instead of examples. One loop, observe, act, get scored, adjust, built the strongest game players ever made, aligned the first useful chatbots, and then taught language models to reason out loud. Its ceiling is now the field's central argument: the same selection pressure that discovered Move 37 and the aha moment also discovers every loophole in the score you wrote, and whether it invents new reasoning or merely promotes old reasoning is measurable, disputed, and unresolved.

  • The loop is the idea. Agent, environment, action, reward, return. The algorithms (Q-learning, TD, policy gradients, PPO, GRPO) are different ways of deciding which past actions deserve credit for a late-arriving score.
  • The reward is the curriculum. RL does not install behavior; it installs selection pressure, and behavior is whatever survives it: longer thinking, self-checking, and also lagoon-circling boats and cheated test harnesses.
  • Checkers beat judges. RL took off for language models when the reward stopped being a learned guess at human taste (RLHF) and became a verification: correct answer, passing tests, valid proof. That is also its limit; nobody has a checker for wisdom.
  • Nobody taught R1-Zero to think longer. On AIME 2024 it went from 15.6 percent to 71.0 percent under pure RL, and its answers grew from hundreds of tokens to thousands because deliberation paid. Emergence here means: selected for, not scripted.
  • The live fight is sharpen versus invent. Yue et al. measure RL narrowing a model to its base model's best paths; DeepSeek and OpenAI report behaviors and scores that look new. Both sides are publishing measurements, which is why this argument will actually settle.
  • The next era has three competing sketches. Sutton and Silver: continual learning from the agent's own experience. LeCun: world models first, RL last. Sutskever and Karpathy: fix the credit assignment, because one score per long attempt is a waste of almost everything the model did.

Keep exploring

Keep exploring

Sources

Sources

Primary sources: the papers themselves, the labs' own posts, and the researchers' own essays and interviews.