liveBook · Manning

Policy

As explained in Transformers in Action

A policy is a model or probability distribution that determines the actions or responses produced in a decision-making process.

A policy is the decision rule that maps the agent’s present state to its next action. In sequential environments, it guides choices toward maximizing total rewards under uncertainty. section 5.1.1

Policy operates across two related decision-making settings:

  • Within an MDP, the policy connects states, actions, rewards, and the agent’s long-term objective. section 5.1.1
  • Within preference alignment, an LLM policy is adjusted to favor responses labeled preferred over undesirable alternatives. section 5.2
  • RLHF maximizes policy performance through a reward model, whereas DPO directly optimizes the policy without an explicit reward model. section 5.2

Dog-training obstacle course

The dog acts as the agent, obstacles represent states, jumping or crawling supplies actions, and treats provide rewards. A learned policy selects actions that increase expected treats over the course. section 5.1.1

Figure 5.1 A simplified comparison of RLHF and DPO and how DPO directly optimizes for the policy without an explicit reward function
figure

Compare RLHF’s reward-model pathway with DPO’s direct policy-optimization pathway. section 5.2

How Transformers in Action covers it

How deep it goes
Defines state-based action selection, then contrasts reward-model optimization with DPO’s direct policy adjustment and KL-divergence constraint.
Examples
Uses a dog obstacle course, portfolio construction, preferred-response labels, and direct language-model preference optimization.
What it assumes
Builds from MDP components, while DPO discussion assumes the surrounding RLHF and reward-model framing.
What you can do after
Understand how policies select actions and how DPO favors preferred language-model responses without an explicit reward model.
How it connects
Connects policy with MDPs, reinforcement learning, rewards, RLHF, reward models, DPO, preference labels, and KL divergence.

Also explained in

Compare how 13 books explain policy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transformers in Action. The section links point to the parts of the book it draws on.