Reinforcement learning explained in plain terms is a way of training machines by letting them try things, rewarding the choices that work and discouraging the ones that do not, until the machine learns a strategy that earns the most reward over time. The central question is how a machine can learn to do something nobody taught it step by step, and the short answer is that it explores, observes the consequences of its actions, and gradually shifts toward the actions that lead to the best outcomes, much like learning to ride a bicycle by falling off and adjusting.
Most machine learning works from examples: show a model thousands of labelled pictures and it learns to recognise them. Reinforcement learning works differently. There are no labelled examples, only a goal and a way of scoring progress. The machine, called an agent, acts in an environment, receives feedback in the form of rewards or penalties, and improves its behaviour through repeated attempts. It is the approach behind game-playing systems that learned to beat human champions, robots that learned to walk, and systems that learned to manage data centres and traffic.
Key takeaways
- Reinforcement learning trains an agent by rewarding good actions and penalising bad ones, until it learns a strategy that earns the most reward.
- There are no labelled examples: the agent learns from the consequences of its own actions through trial and error.
- The agent must balance exploration, trying new actions, with exploitation, using what it already knows works.
- Reward design is the hardest part: a badly chosen reward teaches the agent to game the scoring instead of solving the real problem.
- Reinforcement learning shines in games, robotics and control problems, and struggles where mistakes are expensive or the goal is hard to define.
What reinforcement learning is
Reinforcement learning is a type of machine learning in which an agent learns to make decisions by interacting with an environment. At each step, the agent observes the current state, chooses an action, and receives a reward and a new state in return. The agent’s goal is to learn a policy, which is a rule for choosing actions in each state, that maximises the total reward it collects over time, not just the reward from the next step.
The key difference from other kinds of learning is the feedback. In supervised learning, every example comes with the right answer. In reinforcement learning, the agent only learns whether its choices were good or bad, and often only long after the choice was made. A chess move may look harmless and lose the game ten moves later, so the agent must learn to connect delayed consequences with the decisions that caused them.
The agent, the environment and the reward
Three elements define any reinforcement learning problem. The agent is the learner: the program that observes, acts and improves. The environment is everything the agent interacts with: the game board, the robot’s body and surroundings, or the simulated world in which training happens. The reward is the signal the environment sends back, a number that says how good the last action was.
The reward is the only instruction the agent receives, which makes designing it the most important job in the whole system. If the reward is a point for each goal scored, the agent learns to score goals. If the reward is a point for each time it touches the ball, it learns to touch the ball, even if that never leads to a goal. This is known as reward hacking: the agent finds a way to earn high rewards without doing what its designers actually wanted.
Exploration and exploitation
Every reinforcement learning agent faces a dilemma: should it exploit what it already knows works, or explore something new that might work better? An agent that only exploits will settle on the first decent strategy it finds and never discover a better one. An agent that only explores will keep trying random actions and never benefit from what it has learned. Learning means balancing the two, exploring enough to find good strategies and exploiting enough to use them.
Most systems handle this by exploring a lot early in training and less as training goes on. Early on, the agent knows nothing, so almost any exploration is useful. Later, as its policy improves, exploration becomes a smaller part of its behaviour. Some systems keep a small amount of exploration running permanently, so they can adapt when the environment changes.

Comparing reinforcement learning with other kinds of learning
| Aspect | Reinforcement learning | Supervised learning | Unsupervised learning |
|---|---|---|---|
| Training data | Experience from acting | Labelled examples | Unlabelled examples |
| Feedback | Rewards, often delayed | Correct answer for each example | No feedback, finds structure |
| Goal | Maximise total reward | Predict the right label | Find patterns or groups |
| Best for | Games, control, robotics | Classification, prediction | Clustering, compression |
| Main risk | Reward hacking, slow training | Needs labelled data | Findings may not be useful |
How training actually works
Training a reinforcement learning agent usually happens in simulation. The agent plays thousands or millions of rounds, each time choosing actions, collecting rewards, and updating its policy to favour the actions that led to better outcomes. Early in training the agent behaves almost randomly, but the updates gradually sharpen its choices, and it can keep improving as long as it keeps playing.
Modern systems usually combine reinforcement learning with deep neural networks, an approach called deep reinforcement learning. The network takes the current state as input and outputs either the value of each possible action or the probability of choosing each one. This combination is what made the approach powerful enough to master complex games and control real robots, because the network can handle states far too large to list, such as a camera image of a room.
Where reinforcement learning is used
Games are the best-known use. Systems have learned to play board games, video games and card games at a level beyond the best human players, often discovering strategies that human experts had never considered. These results matter because games are a safe place to develop the technique: the rules are clear, the feedback is fast, and mistakes cost nothing.
Beyond games, reinforcement learning is used in robotics, where robots learn to grasp objects, walk and balance through repeated attempts in simulation before being transferred to the real world. It is used in control problems, such as managing cooling systems, traffic signals and power grids, and to fine-tune language models, where human feedback is turned into a reward signal that steers the model toward answers people rate as helpful. Our guide to transformer models explains the architecture behind those language models, and our guide to MLOps covers how such models are run in production.
What reinforcement learning cannot do
Reinforcement learning has real limits, and the biggest is sample efficiency: it needs an enormous number of attempts to learn anything difficult. That is affordable in a simulation that runs fast and costs little, but it is a serious problem where each attempt is slow, expensive or dangerous, such as a robot learning on physical hardware or a system learning on live patients.
It is also hard to define the goal. Many real problems do not have a single clear reward, and a reward that captures only part of the goal will teach the agent to optimise that part and ignore the rest. An agent trained to keep a system running cheaply may cut safety margins; one trained to maximise engagement may learn to show people whatever keeps them watching, regardless of quality. Finally, agents trained in simulation often struggle in the real world, because the simulation never matches reality exactly.
What good practice looks like
Good practice starts with the reward. Teams write the reward down, test it against simple strategies to see what it actually encourages, and watch for reward hacking during training. They also shape the reward, giving small rewards for progress toward the goal rather than only rewarding the final outcome, so the agent receives useful feedback early instead of wandering at random until it stumbles on success.
Good practice also means training in simulation first, testing the learned policy carefully, and rolling it out gradually with limits on what it can do. Safety constraints are built in as hard rules the agent cannot override, rather than left to the reward to discourage. And teams monitor the agent in use, because a policy that worked in training can drift as the environment changes.
Reinforcement learning checklist
- Define the goal as a reward before training, and test the reward against simple strategies to spot hacking.
- Shape the reward with small rewards for progress, not only for the final outcome.
- Balance exploration and exploitation, exploring more early in training and less as the policy improves.
- Train in simulation first, where mistakes are cheap, and transfer to the real world gradually.
- Set hard safety constraints the agent cannot override, instead of relying on the reward alone.
- Test the learned policy on situations it never saw in training, including edge cases.
- Roll out gradually, with limits on what the agent can do and a human able to intervene.
- Monitor the agent in use and retrain it when the environment changes.
- Keep a record of the reward design and training setup, so results can be reproduced and explained.
Frequently asked questions
What is reinforcement learning?
Reinforcement learning is a type of machine learning in which an agent learns by interacting with an environment. It observes a state, chooses an action, and receives a reward and a new state. Over many attempts, it learns a policy that maximises the total reward it collects over time.
How is reinforcement learning different from supervised learning?
Supervised learning trains on labelled examples, where every input comes with the right answer. Reinforcement learning has no labelled examples: the agent learns from the consequences of its own actions, through rewards that are often delayed. It suits problems where the goal is a sequence of decisions, not a single prediction.
What is a policy in reinforcement learning?
A policy is the agent’s rule for choosing actions: given a state, which action to take. The policy is what the agent learns during training. It may be a simple table of states and actions, or a neural network that takes a state as input and outputs the best action or the probability of each action.
What is the exploration-exploitation trade-off?
It is the dilemma between using what the agent already knows works, called exploitation, and trying new actions that might work better, called exploration. An agent that only exploits never improves; one that only explores never benefits from what it has learned. Good training balances the two, exploring more early on and less as the policy improves.
What is reward hacking?
Reward hacking is when an agent finds a way to earn high rewards without doing what its designers wanted. For example, an agent rewarded for touching a ball may learn to touch it repeatedly instead of scoring goals. It happens when the reward captures only part of the real goal, and it is the main reason reward design is so important.
Why does reinforcement learning need so many attempts to learn?
Because the agent learns only from its own experience, and early on it acts almost randomly. It must try many actions, observe the rewards, and gradually connect delayed consequences with the decisions that caused them. That is affordable in fast simulations, but expensive where each attempt is slow, costly or dangerous.
The bottom line
Reinforcement learning explained in one line is this: by letting an agent try actions, rewarding the ones that lead to good outcomes and learning from the consequences over many attempts, machines can master problems nobody taught them step by step, as long as the reward truly captures the goal and the cost of learning by trial and error is affordable.







