In reinforcement learning, a policy is the agent’s way of choosing what to do. It takes the current state of the environment and returns an action, or a set of probabilities over actions. Everything an RL agent learns is ultimately stored as its policy: training exists to make it pick better actions.
The usual notation is π(a | s), read “the probability of taking action a in state s”. A chess policy maps a board position to a move. A robot’s policy maps joint angles and camera input to motor commands.
Two kinds
- Deterministic: each state always gets the same action. Simple, but predictable, and it can’t explore on its own.
- Stochastic: each state gets a probability distribution, and the action is sampled from it. This builds in exploration and is the natural fit when the best move really is to mix, as in rock-paper-scissors.
Where it sits in the loop
The diagram shows the policy at the decision point of every cycle. The agent observes a state, the policy picks an action, the environment responds, and a reward plus the next state come back. Learning then adjusts the policy so that actions leading to more total reward become more likely. The goal is not the biggest immediate reward but the biggest cumulative one, which is why a good policy will sometimes accept a small loss now for a larger gain later.
How policies are learned
- Value-based: learn a value function that estimates how good each action is in each state, then act greedily with respect to it. The policy is implicit. Q-learning and DeepMind’s Atari-playing DQN work this way.
- Policy-based: represent the policy directly, often as a neural network that outputs action probabilities, and nudge its parameters in the direction that raises expected reward. This is policy gradient.
- Actor-critic: combine both, with a learned value estimate guiding the policy’s updates. PPO (2017) is a widely used example; it clips each update so the new policy can’t drift too far from the old one in a single step.
Policies in language models
In RLHF, the language model itself is the policy: the state is the conversation so far, and the action is the next token. OpenAI’s InstructGPT work fine-tuned such a policy with PPO against a learned reward model. The catch is the same as anywhere in RL: a policy optimizes exactly the reward it is given, so a flawed reward signal gets exploited rather than ignored.