# policy (reinforcement learning)

*Entry of the [Dictionary of Applied Machine Learning](https://dictionaryofml.org) (course edition), by Alexander Jung, Aalto University. CC BY 4.0. Updated 2026-10-28. [HTML](https://dictionaryofml.org/terms/policy.html) · [typeset PDF](https://dictionaryofml.org/terms/policy.pdf) · [LaTeX](https://dictionaryofml.org/terms/policy.tex) · [Python demo](https://dictionaryofml.org/terms/policy.py) · [notebook](https://dictionaryofml.org/terms/policy.ipynb)*

Math is LaTeX with the book's macros expanded, so no notation package is needed to read it.

## Abstract

A policy in reinforcement learning is a function that maps the current state to an action. Sometimes a policy is stochastic and defined by a conditional probability distribution over the actions given the state. The policy of a reinforcement learning method can be viewed as the hypothesis of a machine learning method. It takes the features that characterize the current state of the agent as input and outputs a prediction of the best action to take. Instead of an average loss on a training set, reinforcement learning methods use the rewards observed after taking actions to guide the learning of a policy.

## Definition

In reinforcement learning, an agent interacts with an environment. At each time instant $t = 1, 2, \ldots$, the agent observes the state $s_{t}$ of the environment, takes an action $a_{t}$, and receives the next state $s_{t+1}$ together with a reward $r_{t+1}$. This interaction is modeled as a Markov decision process. Fig. 1 shows three time instants of a self-driving car: the state is the position and heading of the car, the action is the steering direction, and the reward tells how well the car follows the road.

In its simplest form, a policy is a function that specifies which action $a_{t}$ to take in this Markov decision process when the current state is $s_{t}$ (Sutton and Barto, 2018, Sect. 3.5). A policy differs from a plan, a fixed sequence of actions: a policy reacts to the state observed. A policy of this kind is deterministic. It is a special case of a stochastic policy, which defines a conditional probability distribution $\mathbb{P}^{(a \mid s)}$ over the actions given the state, a probability distribution from which the action is drawn.

![Figure 1 of the entry policy](https://dictionaryofml.org/terms/fig/policy-fig1.svg)

*Figure 1: A self-driving car at three time instants, between the two contours of a road. The state $s_{t}$ is the position and heading of the car; the action $a_{t}$ selected by the policy is the steering direction (arrows). At $t$ the direction is slightly off the center of the road, so the car drifts towards the outer contour and the reward $r_{t+1}$ is low. The direction at $t+1$ is better aligned with the center, so the car returns to it and the reward $r_{t+2}$ is larger*

A policy can be viewed as a hypothesis map $h({\mathbf x})$ that predicts the best action to take. The feature vector ${\mathbf x}$ fed into the hypothesis is either the state itself, when the state is fully observed, or some indirect measurements of it, when the state is only partially observed. What sets supervised learning apart from reinforcement learning is how the usefulness of a hypothesis is assessed. Instead of computing the average loss on a dataset of labeled data points, reinforcement learning methods use the expected return obtained when the policy is applied to a Markov decision process.

The return at time instant $t$ is the discounted sum of the rewards received afterwards,

$$
G_{t} := \sum_{k=0}^{\infty}
\gamma^{k} r_{t+k+1} \text{,}
$$

with a discount factor $\gamma \in [0,1]$ (Sutton and Barto, 2018, Sect. 3.3). The expected return, as a function of the starting state, is the value function of the policy (Sutton and Barto, 2018, Sect. 3.5). It can be estimated by executing the policy: the agent starts from the state several times, follows the policy for a number of time instants, records the rewards, and averages the observed returns (Sutton and Barto, 2018, Ch. 5).

**See also:** action, Markov decision process, state, [reinforcement learning](https://dictionaryofml.org/terms/reinforcementlearning.html), [reward](https://dictionaryofml.org/terms/reward.html), value function, return, policy gradient, agent.

## References

- Sutton and Barto (2018). Reinforcement Learning: An Introduction. *MIT Press*.

## Cite this entry

```bibtex
@misc{dictml_policy,
  author = {Jung, Alexander},
  editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
  title = {policy (reinforcement learning)},
  howpublished = {Dictionary of Applied Machine Learning (course edition)},
  year = {2026},
  doi = {10.5281/zenodo.21569296},
  note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-11-03},
  url = {https://dictionaryofml.org/terms/policy.html}
}
```
