# Reinforcement Learning

> Learning by trial and error. Good actions earn rewards, so the agent repeats them.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** RL, Learning from Rewards

## Think of it like

Think of it like teaching a dog with treats. Good moves earn a treat, so it does them more.

## Definition

Reinforcement learning is learning by trying things and getting rewards. A program, called the agent, takes an action in some world. The world changes and hands back a reward or a penalty. The agent repeats this many times and learns which actions lead to the most reward over time. Nobody shows it the right moves, only the score.

## Example

A program learns a racing game by itself. At first it crashes all the time. After millions of laps, the reward for finishing fast teaches it to drive well.

## Why it matters

It works where there is no answer key, only a goal. It is used for games, robots and to make chatbots more helpful.

## Common mistake

Writing a reward that can be cheated. The agent finds the shortcut to the reward, even when that is not what you wanted.

## Three principles

- **Try and see.** Act, then get a reward.
- **Long-term score.** Learns what pays off over time.
- **No answer key.** Only the reward guides it.

## Related terms

- [Supervised Learning](https://learn.benibix.com/term/ai/supervised-learning)
- [Machine Learning](https://learn.benibix.com/term/ai/machine-learning)
- [Training (AI)](https://learn.benibix.com/term/ai/training)
- [Loss Function](https://learn.benibix.com/term/ai/loss-function)
- [Sim-to-Real Transfer](https://learn.benibix.com/term/ai/sim-to-real)
- [Imitation Learning](https://learn.benibix.com/term/ai/imitation-learning)
- [AlphaGo](https://learn.benibix.com/term/ai/alphago)

## Told apart from

- [Imitation Learning vs Reinforcement Learning](https://learn.benibix.com/compare/imitation-learning-vs-reinforcement-learning): People think robots learn every skill by trial and error, and they do not. In reinforcement learning, the robot tries things and learns from a score. In imitation learning, a person shows the task and the robot copies it. Copying is quicker to start. But the robot only gets as good as the examples it saw.

## Taught in

- [RL and Transfer Learning](https://learn.benibix.com/learn/ai-machine-learning/rl-and-transfer-learning): Machine Learning, 7/18

![Three panels. Supervised: coloured dots with labels and a line that splits them. Unsupervised: grey dots that the model gathers into groups. Reinforcement: an agent acts on a world and gets a reward back, in a loop.](https://learn.benibix.com/diagrams/ml-learning-types.svg)

---

Source: https://learn.benibix.com/term/ai/reinforcement-learning
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
