---
title: Reinforcement Learning: Learning From Rewards | Large Programs
description: In reinforcement learning an AI learns by trying actions and getting rewards. What explore and exploit mean, and how it connects to AlphaGo and chatbots.
canonical: https://www.largeprograms.com/what-is-reinforcement-learning/
---

[Home](/) / [How LLMs Work](/category/how-llms-work/)

How LLMs Work

# Reinforcement Learning: Learning From Rewards

In reinforcement learning an AI learns by trying actions and getting rewards. What explore and exploit mean, and how it connects to AlphaGo and chatbots.

27 November 2026 · 2 min read

**Reinforcement learning** is a way for an AI agent to learn by acting in an environment and receiving a **reward** signal. The agent tries to choose actions that earn the largest total reward. It is one of the three basic kinds of machine learning, next to supervised and unsupervised learning.

![An agent sends actions to a world and gets rewards back.](/img/reinforcement.svg)

## What the textbook says

In their textbook *Reinforcement Learning* (MIT Press, 1998), Richard Sutton and Andrew Barto define it as learning what to do: how to map situations to actions so as to maximise a numerical reward signal. They say the learner is not told which actions to take, as in most forms of machine learning, but must discover which actions yield the most reward by trying them. They add that actions may affect not only the immediate reward but also the next situation and, through that, all later rewards. The excerpt names trial-and-error search and delayed reward as the two key features.

## Think of training a game player

There is no answer key. A game-playing agent tries moves and sees what happens. Good outcomes bring rewards, and over many tries it learns which choices lead to more reward.

## Explore or exploit?

The agent faces a choice at each step: **try something new** to learn more (exploration), or **use what it already knows** to pick the best action it has found (exploitation). Finding the right balance is called the exploration-exploitation dilemma.

## An animal comparison

The source points out that animal brains seem to treat signals like pain and hunger as negative, and pleasure and food as positive, and that some animals learn behaviour that increases those rewards. Reinforcement learning is similar in idea.

## Where it shows up

- **Games.** The Go program AlphaGo used deep neural networks and reinforcement learning to beat a professional human player. See [AlphaGo](/alphago-and-the-game-of-go/).
- **Chatbots.** Some language models are improved with human feedback, where people rank answers and a reward-style score guides training. See [what RLHF is](/what-is-rlhf/). In the InstructGPT study, outputs from a 1.3 billion-parameter model trained this way were preferred to those of a model 100 times larger.

## Limits

A reward only tells the agent what the designers measured. If people disagree about what is best, the reward may not capture it. Training with feedback improves behaviour but does not guarantee that answers are true (see [what RLHF is](/what-is-rlhf/)).

## Sources

- [https://en.wikipedia.org/wiki/Reinforcement_learning](https://en.wikipedia.org/wiki/Reinforcement_learning)
- [https://arxiv.org/abs/2203.02155](https://arxiv.org/abs/2203.02155)
- [http://matt.colorado.edu/teaching/highcog/readings/sb98c1.pdf](http://matt.colorado.edu/teaching/highcog/readings/sb98c1.pdf)

[Read this page as Markdown (.md)](/what-is-reinforcement-learning.md)

## Keep reading

[![](/img/hero/art-ai-art-and-music-basics.svg)](/ai-art-and-music-basics/)

How LLMs Work

### [How AI Makes Music: A Beginner's Look](/ai-art-and-music-basics/)

Models can generate melodies and songs by learning patterns in sound. What that means for musicians.

[![](/img/hero/art-backpropagation-how-neural-networks-learn-from-mistakes.svg)](/backpropagation-how-neural-networks-learn-from-mistakes/)

How LLMs Work

### [Backpropagation: How a Network Learns From Its Mistakes](/backpropagation-how-neural-networks-learn-from-mistakes/)

Backpropagation is the method that works out how to adjust each weight in a neural network after it makes an error. A simple explanation with a team analogy.

[![](/img/hero/art-chain-of-thought-prompting-showing-your-working.svg)](/chain-of-thought-prompting-showing-your-working/)

How LLMs Work

### [Chain-of-Thought Prompting: Showing the Steps](/chain-of-thought-prompting-showing-your-working/)

Asking a language model to show intermediate steps can improve its answers to hard problems. What the research found and how it is like showing your working in maths.
