What is reinforcement learning? Learning actions from their consequences
Reinforcement learning, or RL, studies how an agent learns to choose actions that improve its cumulative reward by interacting with an environment. Because each action can change what happens next, the problem is a sequence of decisions rather than a set of independent predictions.
SchoolWhool's current learning path covers Python, Data Tools, Maths, Statistics and classical Machine Learning. Open lessons' parts and key terms are free to read.
The vocabulary of a reinforcement learning problem
| Concept | Meaning and example |
|---|---|
| Agent and environment | The agent chooses actions; the environment produces the resulting observations and rewards. Their boundary is part of the problem definition. |
| Observation and state | An observation is what the agent receives. It may reveal only part of the underlying state, which can make choosing an action harder. |
| Action | A permitted choice, such as a move in a grid. An action space defines the available choices or their valid range. |
| Reward and return | A reward is feedback from an interaction. Return combines rewards over time according to the task's definition, rather than looking only at the next reward. |
| Policy | The rule or learned mechanism used to choose actions from available information. A policy can be simple and need not be a neural network. |
An example: a small delivery-grid simulation
Imagine a learning exercise in which a simulated courier moves through a grid to a destination. The observation describes its location and nearby obstacles. The actions are permitted moves. The exercise designer defines rewards for reaching the destination and costs for undesirable behaviour.
Keep this a simulation with an explicit specification. Decide what ends a run, whether a move can fail and how the layout changes between runs. These choices define the task before any algorithm is trained; a score means little without them.
How RL differs from supervised learning
A supervised model can learn a mapping from inputs to supplied correct targets. In the grid exercise, supervised imitation would require examples of the desired move. RL instead evaluates consequences under a reward scheme, including consequences that appear after several actions.
The agent's choices influence which situations it encounters. An easy route taken repeatedly can leave other routes poorly explored. For your project write-up, distinguish performance on layouts used during development from performance on layouts reserved for evaluation.
Exploration, exploitation and a misleading reward
Exploration tries actions to gain information; exploitation uses what the policy currently considers promising. In an exercise, record which states were visited instead of assuming that many runs provided broad coverage. A policy can perform well on familiar situations while failing elsewhere.
Reward design also deserves a test. Suppose you reward every move closer to a destination. What happens when a wall requires a temporary detour? Write down such counterexamples and inspect behaviour, rather than deciding success from a reward total alone.
A sensible first RL exercise
Specify a small environment
Use a toy task with clear observations, actions, rewards and ending conditions. Keep the environment simple enough to trace one run by hand.
Create reference policies
Compare with random choices and a simple hand-written policy. They provide context for whether learning adds anything useful.
Separate learning from evaluation
Record the conditions used for training and the ones reserved for evaluation. Repeat runs where randomness affects the result and report variation.
Watch unsuccessful runs
Inspect trajectories, not just total reward. Document loops, unusual shortcuts and cases where the reward encourages behaviour different from the intended task.
Does reinforcement learning always mean deep RL?
No. Small discrete exercises can use a table of values rather than a neural network. Deep reinforcement learning uses neural networks within an RL method, for example to approximate a policy or value function. Start with an approach you can inspect before adding that extra layer of complexity.
Build Python fluency, probability, statistics and a basic machine learning workflow first. SchoolWhool's published tracks teach those foundations; a dedicated Reinforcement Learning track is not released. The Statistics track is a useful place to learn how to interpret variation across experiments.
Questions
Is reinforcement learning supervised or unsupervised?
It is usually treated as a distinct learning setting. It uses reward and interaction rather than a supplied correct target for every input.
What is deep reinforcement learning?
Reinforcement learning that uses deep neural networks as part of the method, such as approximating values or selecting actions.
Does every AI agent use reinforcement learning?
No. Agent describes a system that chooses actions, while RL describes a learning approach. A workflow can use rules, planning or a language model without learning through RL during use.
What is the difference between reward and loss?
Reward defines feedback in the environment and contributes to the objective over time. A learning algorithm may use one or more loss functions internally to improve its policy or value estimates.
Can I start reinforcement learning without a GPU?
Yes. Small tabular tasks and toy simulations can be studied on a CPU. Choose a small environment before considering more demanding deep RL experiments.
Sources
Technical references and further reading from the authors, educators and maintainers below. Read dates record when these references were checked; the examples and suggested exercises in this guide are SchoolWhool's own.