What it is used for
Reinforcement learning is used on problems where decisions are taken in sequence and their consequences are felt only later. A player learning from its own wins and losses, a robot learning to move by trying, and a resource manager whose decision today sets the state of next week share the same shape of problem: nobody hands over the right move, there are only consequences that arrive after a move is made. On problems of that shape, examples of correct behaviour often cannot be obtained at all, and learning from its own experience is the agent's only path.
In today's artificial intelligence, this family is among other things the engine behind tuning language models to follow human judgement, covered in the RLHF article, and the standard way to train game agents and control agents that learn inside a simulated environment before working in a real one.
How to use it
The way this family works can be read as one repeating loop. The agent observes the state of the environment, selects an action according to the way of behaving it currently has, and the environment responds with a new state and a single reward number. That experience is used to improve its way of behaving, little by little, so actions that bring large rewards are chosen more often and actions that bring small rewards are left behind. The loop runs for as long as the agent interacts with its environment.
One tension never leaves that loop: exploring or exploiting. To collect reward now, the agent should exploit the actions that have already proven good. But a still better action can only be found if the agent dares to try actions it has never selected before. The source book is explicit that neither can be pursued exclusively without failing at the task; an agent that only exploits stops at the first approach that works, and an agent that only explores never harvests what it has learned. Balancing the two is a permanent part of every method in this family.
The agent's judgement also does not stop at the immediate reward. A state can pay a small reward now yet open the path to a run of large rewards afterwards. The agent therefore learns to estimate the long-term goodness of each state, the total reward that can be expected to accumulate starting from that state, and chooses its actions by that long-term estimate rather than by the reward of the last step alone.
Practitioner level
For practitioners, the source book's four elements are this family's standard vocabulary. The policy is the agent's way of behaving, a mapping from states to actions, and it may be stochastic, stating a probability for each action. The reward signal is the single number at each step that defines the goal and is the primary basis for changing the policy. The value function states what is good in the long run, and estimating it is the most important component of almost all algorithms in this family. The fourth element is optional: a model of the environment, an imitation of the environment's behaviour used for planning; methods that use one are called model-based, and their opposites, which learn purely by trial and error, are called model-free.
Method names a practitioner will meet inside this family, following the source book's arrangement, include dynamic programming, Monte Carlo methods, and temporal-difference learning, which contains Sarsa and Q-learning, among the tabular methods, and policy gradient methods, which contain the actor-critic architecture, among the approximation methods. The practical differences that most often decide the choice are whether rewards arrive immediately or far in the future, and whether the environment can be tried safely many times or every trial is expensive.
Expert level
At the expert level, this family's problem is formulated by the source book as the optimal control of incompletely-known Markov decision processes. That framework captures three things in their simplest forms without trivializing any of them: sensation, action, and goal. The agent must be able to sense the state of its environment to some extent, must be able to take actions that affect the state, and must have a goal or goals relating to the state of the environment. Any method that is well suited to solving such problems is counted by the source book as a reinforcement learning method.
The paradigm's standing is equally explicit in the source book. Reinforcement learning is a third machine learning paradigm, alongside supervised learning, which learns from labelled examples provided by a knowledgeable supervisor, and unsupervised learning, which looks for hidden structure in collections of unlabelled data. What sets it apart is not merely the absence of a supervisor, but its target: it maximizes a reward signal, and its problem is always the whole problem of a goal-directed agent interacting with an uncertain environment, not a subproblem cut away from the larger picture.
Limits and risks
The first limit of this family is written into its own definition: the agent maximizes the reward number it is given, not the good intention in its designer's head. If the reward number is framed narrowly or wrongly, the agent can find ways to harvest that number by routes nobody wanted, and that failure is a failure of how the goal was framed, not a failure of the agent. Framing a reward that truly represents the outcome wanted is the hardest part of using this family.
The second limit is the cost of experience. Learning by trying means the agent must live through many failures before it becomes good, and in a real environment those failures can mean damage, cost, or danger. This family is therefore usually trained first in a simulated environment, and its trained results still have to be tested again when moved to a real environment that is never exactly the same as its simulation.
This article rests on a single primary textbook, and says so as it is. The source book is the field's standard text, but it was published in 2018; developments in this family after that year, including its widening use on large language models, lie outside the scope of this article's source except where they are named as pointers to other articles.
