Explainer
How reinforcement learning works: rewards, policies, value functions
Reinforcement learning (RL) is learning what to do by trial and error: an agent takes actions, receives a numerical reward, and must discover which actions earn the most reward over time, without being told the right answer.[1][2] An RL system is built from a policy (how the agent acts), a reward signal (its goal), a value function (what pays off in the long run) and, optionally, a model of its environment.[3] RL produced game-playing systems such as DeepMind's Atari player and AlphaGo Zero, and it is used in training chatbots and reasoning models.[4][5][6]
This page is part of our machine learning foundations series. It assumes how machine learning works and how neural networks work. Afterwards, see RLHF, how reasoning models work and how robots learn.
Supervised machine learning learns from labelled examples, with the right answers attached.[7] Reinforcement learning (RL) learns from consequences instead. Sutton and Barto’s standard textbook defines it as learning what to do, how to map situations to actions, so as to maximise a numerical reward. The learner is not told which actions to take and must discover which ones pay off by trying them.[1]
Agent, environment, reward
Picture a program learning a video game. The program is the agent, the game is the environment, and the score is the reward. At each step the agent sees the current situation, picks an action, and gets back a number saying how well that went.[8] Nobody tells it the correct move. It has to experiment.[1]
Two things make this hard. The agent learns by trial and error, and rewards are often delayed: a move now might only pay off many steps later. Sutton and Barto call these the two most important features of RL.[2]
The agent interacts with an environment in discrete time steps; at each step the environment sends a single scalar reward, and that reward signal defines the goal.[8] The standard formalism is the Markov decision process (MDP), a mathematically idealised version of the problem in which actions move the agent between states and transitions return rewards.[9] Sutton and Barto’s reward hypothesis holds that all goals can be thought of as maximising the expected cumulative sum of a scalar reward.[10]
RL is neither supervised learning, which learns from labelled examples supplied by an external supervisor, nor unsupervised learning, which finds hidden structure in unlabelled data. Sutton and Barto treat it as a third paradigm.[7]
Policies and value functions
Beyond the agent and environment, an RL system has four main parts: a policy, a reward signal, a value function and, optionally, a model of the environment.[3]
- Policy. The agent’s way of behaving at a given time.[11] Google’s glossary describes it as a probabilistic mapping from states to actions.[11]
- Reward. What is good right now.[8]
- Value function. What is good in the long run: the value of a state is the total reward the agent can expect to collect from there onward.[8]
- Model. A model of the environment lets the agent plan ahead. Methods that use one are called model-based. Model-free methods learn purely by trial and error.[12]
The return is the sum of rewards the agent expects from a state to the end of an episode under its policy, with later rewards discounted. A Q-function, or state-action value function, predicts the expected return from taking a given action in a given state and then following the policy.[13] DeepMind’s 2013 Atari agent was trained with a variant of Q-learning.[4]
Explore or exploit?
An agent that always picks the best action it knows may never discover a better one. One that keeps experimenting wastes chances to collect reward. Sutton and Barto describe this trade-off between exploration and exploitation as a challenge that arises in RL and not in other kinds of learning, since no single action can do both.[14]
Landmarks: from Atari to Go
- Atari (2013). A DeepMind workshop paper trained a neural network with a variant of Q-learning on raw screen pixels from seven Atari 2600 games. Its authors called it the first deep learning model to learn control policies directly from high-dimensional sensory input with RL. They reported that it beat all previous approaches on six games and surpassed a human expert on three.[4]
- AlphaGo Zero (2017). Earlier AlphaGo versions learned partly from thousands of human games. DeepMind said AlphaGo Zero instead learned only by playing against itself, starting from random play. After three days of self-play, it beat the earlier champion-defeating version 100 games to 0.[5]
RL in today’s AI
RL is also used to train large language models. InstructGPT was trained in two stages: supervised fine-tuning on human-written demonstrations, then reinforcement learning from human feedback (RLHF) using human rankings of model outputs.[6] DeepSeek reported that reasoning abilities in its R1 work could be developed through pure reinforcement learning, without human-labelled reasoning examples.[15] See RLHF and how reasoning models work.
The reward signal can also be exploited. DeepMind said in 2020 that it had collected around 60 examples of agents finding a shortcut to lots of reward without completing the task as intended.[16] That problem is covered in reward hacking explained.
Read next
Next in the crash course
What is PyTorch? The open-source deep learning framework explained
PyTorch is an open-source Python library for building and training neural networks, begun in 2016 with Meta backing, run by the PyTorch Foundation since 2022.
Questions readers ask
What is reinforcement learning in simple terms?
Learning by trial and error to earn rewards. The learner is not told which actions to take; it must discover which ones bring the most reward by trying them, and some actions only pay off later.[1][2]
How is reinforcement learning different from supervised learning?
Supervised learning learns from labelled examples supplied by a teacher. Reinforcement learning gets only a reward signal and has to find good behaviour itself. Sutton and Barto treat it as a third paradigm alongside supervised and unsupervised learning.[7]
What is a policy in reinforcement learning?
The agent's way of behaving, a mapping from the situations (states) it sees to the actions it takes, often expressed as probabilities.[11]
What is the difference between reward and value?
The reward is the immediate number the environment sends after each step. Value is the total reward the agent can expect to collect from a state onward, so it measures what is good in the long run.[8]
Sources
· 16 claims from 7 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
Sutton and Barto's textbook defines reinforcement learning as learning what to do, how to map situations to actions, so as to maximise a numerical reward signal; the learner is not told which actions to take and must discover which ones yield the most reward by trying them. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (retrieved 2026-11-22)
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, reinforcement learning (RL) (retrieved 2026-11-07)
- [2]
Sutton and Barto call trial-and-error search and delayed reward the two most important distinguishing features of reinforcement learning, since actions may affect not only the immediate reward but also later situations and rewards. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (retrieved 2026-11-22)
- [3]
Beyond the agent and its environment, Sutton and Barto identify four main parts of a reinforcement learning system, a policy, a reward signal, a value function and, optionally, a model of the environment. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.3 (retrieved 2026-11-22)
- [4]
A 2013 DeepMind workshop paper described a convolutional neural network trained with a variant of Q-learning on raw pixels from seven Atari 2600 games; its authors called it the first deep learning model to learn control policies directly from high-dimensional sensory input using reinforcement learning and reported that it beat all previous approaches on six games and surpassed a human expert on three. reportedas of 2026-11-22
- Playing Atari with Deep Reinforcement Learning (Mnih et al.) · arXiv (NIPS 2013 Deep Learning Workshop) · Secondary source · 2013-12-19 · Abstract (retrieved 2026-11-22)
- Playing Atari with Deep Reinforcement Learning (Mnih et al.) · arXiv (NIPS 2013 Deep Learning Workshop) · Secondary source · 2013-12-19 · Abstract (retrieved 2026-11-22)
- Playing Atari with Deep Reinforcement Learning (Mnih et al.) · arXiv (NIPS 2013 Deep Learning Workshop) · Secondary source · 2013-12-19 · Abstract (retrieved 2026-11-22)
- [5]
DeepMind said in 2017 that, unlike earlier AlphaGo versions trained on thousands of human games, AlphaGo Zero learned Go only by playing against itself from random play, using a form of reinforcement learning, and beat the earlier champion-defeating version 100 games to 0 after three days of self-play. reportedas of 2026-11-22
- AlphaGo Zero: Starting from scratch · Google DeepMind (blog) · Primary source · 2017-10-18 · Blog post (retrieved 2026-11-22)
- AlphaGo Zero: Starting from scratch · Google DeepMind (blog) · Primary source · 2017-10-18 · Blog post (retrieved 2026-11-22)
- AlphaGo Zero: Starting from scratch · Google DeepMind (blog) · Primary source · 2017-10-18 · Blog post (retrieved 2026-11-22)
- [6]
InstructGPT was trained in two stages, supervised fine-tuning on human-written demonstrations and then reinforcement learning from human feedback (RLHF) using human rankings of model outputs. reportedas of 2022-03-04
- Training language models to follow instructions with human feedback · arXiv (Ouyang et al.) · Secondary source · 2022-03-04 · Abstract (retrieved 2026-10-10)
- [7]
Sutton and Barto distinguish reinforcement learning from supervised learning, which learns from labelled examples provided by an external supervisor, and from unsupervised learning, which finds hidden structure in unlabelled data, and treat it as a third machine learning paradigm. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (retrieved 2026-11-22)
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (retrieved 2026-11-22)
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (retrieved 2026-11-22)
- [8]
The reward signal defines the goal of a reinforcement learning problem, a single number the environment sends the agent at each time step, while a value function specifies what is good in the long run, the total reward an agent can expect to accumulate from a state onward. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.3 (retrieved 2026-11-22)
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.3 (retrieved 2026-11-22)
- [9]
Markov decision processes (MDPs) are a mathematically idealised form of the reinforcement learning problem, in which actions move an agent between states and transitions return numerical rewards. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Chapter 3 (retrieved 2026-11-22)
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, Markov decision process (MDP) (retrieved 2026-11-07)
- [10]
Sutton and Barto state the reward hypothesis: that all of what we mean by goals and purposes can be thought of as maximising the expected cumulative sum of a scalar reward signal. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 3.2 (retrieved 2026-11-22)
- [11]
A policy defines how a learning agent behaves at a given time; Google's glossary describes it as an agent's probabilistic mapping from states to actions. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.3 (retrieved 2026-11-22)
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, policy (retrieved 2026-11-07)
- [12]
Reinforcement learning methods that use a model of the environment for planning are called model-based, as opposed to simpler model-free methods that learn explicitly by trial and error. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.3 (retrieved 2026-11-22)
- [13]
The return is the sum of rewards an agent expects from a state to the end of an episode when following its policy, with later rewards discounted; a Q-function, or state-action value function, predicts the expected return from taking an action in a state and then following a given policy. reportedas of 2026-11-22
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, return (retrieved 2026-11-07)
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, return (retrieved 2026-11-07)
- Machine Learning Glossary · Google for Developers · Secondary source · Glossary, Q-function (retrieved 2026-11-07)
- [14]
Sutton and Barto describe the trade-off between exploration and exploitation as a challenge that arises in reinforcement learning but not in other kinds of learning, since no single action can both explore and exploit. confirmedas of 2026-11-22
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 1.1 (pdftotext drops the ff ligature, so the cached text reads 'trade-o'; check by hand) (retrieved 2026-11-22)
- Reinforcement Learning: An Introduction, second edition (Sutton and Barto) · MIT Press (free PDF, incompleteideas.net) · Primary source · 2018-11-13 · Section 2.2 (retrieved 2026-11-22)
- [15]
DeepSeek reported that reasoning abilities in its DeepSeek-R1 work could be developed through pure reinforcement learning, without human-labelled reasoning trajectories. confirmedas of 2026-01-04
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning · arXiv (DeepSeek-AI); published in Nature 645 · Primary source · 2025-01-22 · Abstract (retrieved 2026-10-10)
- [16]
In 2020 DeepMind said it had collected around 60 examples of specification gaming, and that a reinforcement learning agent can find a shortcut to lots of reward without completing the task as the designer intended, much as a student rewarded for right answers might copy them instead of learning the material. confirmedas of 2020-04-21
- Specification gaming: the flip side of AI ingenuity · Google DeepMind · Primary source · 2020-04-21 · Opening section (retrieved 2026-11-21)
- Specification gaming: the flip side of AI ingenuity · Google DeepMind · Primary source · 2020-04-21 · Opening section (retrieved 2026-11-21)
- Specification gaming: the flip side of AI ingenuity · Google DeepMind · Primary source · 2020-04-21 · Opening section (retrieved 2026-11-21)
Revision history (1)
- Page created.
Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Jul 12, 2027.
Cite this page
"How reinforcement learning works: rewards, policies, value functions." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/how-reinforcement-learning-works
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.