← AI glossary

AI glossary · Beginner · Reinforcement learning

Reinforcement learning

Reinforcement learning is a way of training in which, instead of learning the correct answers in advance, an AI acts on its own and uses the rewards (scores) it receives for the results to find better actions.

About this term
Level
Beginner · Core ideas for first-time readers
Category
Basics
Added
2026-10-08
In plain words It is similar to teaching a dog to 'sit' without explaining the right answer, by repeatedly giving a treat when it sits and none when it does not. However, an AI has to learn very long chains of actions from signals as simple as a treat, so it needs far more trial and error than real-world training.

How it works

The learner is called the agent, and the world the agent deals with is called the environment. The agent looks at the current state and chooses an action, and the environment returns the resulting new state and a reward. The agent updates its rules for acting (its policy) so that it takes high-reward actions more often and low-reward actions less often. By repeating this loop countless times, it gradually learns how to earn higher rewards. The record of states, actions and rewards from a single attempt is called a Trajectory, and the process of the model generating such attempts itself is called a Rollout.

The basic loop of reinforcement learningAgent → Action(Choose); Action → Environment; Environment → State and reward(Respond); State and reward → Policy update; Policy update → Agent(Repeat)AgentDecides based on itspolicyActionEnvironmentGames, problems,tools, etc.State and rewardOutcome, scorePolicy updateReinforce high-rewardactionsChooseRespondRepeat
The basic loop of reinforcement learning When the agent acts, the environment returns a new state and a reward, and the agent uses them to update its policy and act again. This loop repeats continuously.

Why it matters

Even for problems where it is hard to build correct-answer data one by one, learning is possible as long as you can define 'what a good outcome is'. It has long been used for problems that require many steps, such as games and robot control. Recently it has been widely used in LLM post-training, playing a central role in making models give answers people prefer (RLHF) and solve math and coding problems better (RLVR). It is also a main means of boosting the capabilities of reasoning models and AI agents.

Things to keep in mind

Results vary greatly depending on how the reward is designed. If the reward criteria have loopholes, reward hacking can occur, where the AI finds tricks to raise its score instead of pursuing the real goal. It also has to generate a huge number of attempts itself, so computation costs are high and training tends to become unstable. That is why, in practice, models often first build basic skills with supervised learning (SFT) and then add reinforcement learning.

Example

Microsoft Research's 'Agent Lightning v1.0', covered on this site, was presented as a lightweight framework that lets you apply reinforcement learning to an existing AI agent without major changes. It is an example of using reinforcement learning to refine an agent so it performs tasks better, using records of the agent carrying out real tasks as the training signal. Reinforcement learning is also used to refine chatbots so they give more helpful answers, and to train coding agents to write code that passes tests.

Where it came up on this site

Related terms