liveBook · Manning

Markov decision process

As explained in Transformers in Action

A Markov decision process is a mathematical model for sequential decision-making in which an agent selects actions in states, receives rewards, and undergoes probabilistic transitions.

A Markov decision process (MDP) models sequential decisions in a changing environment with uncertainty. An agent observes its present state, selects an action through a policy, receives a reward, and moves toward a subsequent state. The policy depends on the present state, while probabilistic events also influence what happens next. section 5.1.1 section 5.1

An MDP organizes decision-making around five key components:

  • Agent — the decision-maker operating within the environment. section 5.1.1
  • States — the situations the agent encounters. section 5.1.1
  • Actions — the choices available in each state. section 5.1.1
  • Rewards — positive or negative feedback from actions and resulting states. section 5.1.1
  • Policy — the rule that selects the next action from the present state. section 5.1.1

Dog-training obstacle course

A dog acts as the agent, the obstacle course as the environment, and obstacles as states. Jumping, crawling, or sidestepping are actions; treats or gentle scolding provide rewards. The dog aims to maximize total treats across the course, illustrating how an agent uses interactions to pursue long-term reward. section 5.1.1

MDPs provide the foundation for reinforcement learning. In preference alignment, generation is treated as sequential decision-making so later optimization methods such as proximal policy optimization can favor outputs that better reflect human intent. section 5.1

How Transformers in Action covers it

How deep it goes
Defines stochastic control, five components, state-based policies, uncertainty, and reward maximization without developing PPO.
Examples
Uses portfolio construction and a dog-training obstacle course to illustrate uncertain sequential decisions and reward maximization.
What you can do after
Evaluate sequential decision problems by identifying agents, states, actions, rewards, policies, and uncertain transitions.
How it connects
Connects reinforcement learning, policy, rewards, proximal policy optimization, reward models, and transformer output alignment.

Also explained in

Compare how 4 books explain Markov decision process →

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.