TL;DR
MPO is a Reinforcement Learning method for policies that output continuous actions, such as joint torques for a robot arm. It alternates two steps. First it reweights a set of sampled actions so that actions with higher estimated value get more weight, while staying close to the current policy. Then it refits the policy to those weighted actions with ordinary supervised learning.
The name comes from treating the improvement as an Expectation-Maximization Algorithm-style procedure with a prior on the policy. The "closeness" requirement is a Kullback–Leibler Divergence bound, enforced with a Lagrange multiplier, which keeps each update small and stable.
Where you'll see it: in continuous-control agents, where the action space is a vector of real numbers rather than a short list of choices, and in the family of trust-region methods that also includes Trust Region Policy Optimization (TRPO).
Intuition
Start from a leash
Suppose you are learning to park a car by trial and error. You have a rough habit, and you can estimate which of a few nearby manoeuvres would have worked better. A careless learner jumps to the best manoeuvre it has seen and changes everything at once. That often breaks the habits that worked, and the estimates are noisy, so the jump may be wrong.
MPO takes a shorter step. It picks a few manoeuvres near the current habit, gives more weight to the ones that look good, and then nudges the habit toward that weighted mix. A leash limits how far the new habit may stray from the old one. The leash is a Kullback–Leibler Divergence bound, a measure of how different two probability distributions are.
The two steps
flowchart LR A["Current policy"] --> B["Sample actions for each state"] B --> C["E-step: reweight actions by value, stay within the leash"] C --> D["M-step: refit the policy to the weighted actions"] D --> A
The E-step does not change the policy. It builds a target distribution over actions. The M-step makes the policy match that target as closely as its shape allows, again within a leash. Splitting the work this way means each step is a problem with a known solution, instead of one hard optimisation.
The math
Write for a state, for an action, for the current policy, and for the estimated value of taking action in state , then following the policy. The aim is a new policy with higher expected value. The MPO derivation takes it in two parts.
The E-step: an improved target
For a single state, the E-step chooses a distribution that maximises the expected value under , subject to staying close to the old policy:
Here is the Kullback–Leibler Divergence from to , and is the size of the allowed step. Using a Lagrangian with a multiplier for the KL constraint, the best has a closed form:
In words: the new weight of an action is its old probability times an exponential of its value. A large keeps close to , and a small concentrates on the best action. The value is chosen by minimising the dual function
Here is the average over actions drawn from the old policy, and is the natural logarithm. In practice the average is taken over a few sampled actions per state, and is minimised with a few gradient steps on .
The M-step: refit the policy
The M-step fits a parametric policy to the target by weighted maximum likelihood, over sampled states and actions:
Here is the weight that gives to the sampled action, normalised over the sampled actions for each state. The M-step adds a second Kullback–Leibler Divergence bound, this time between the old and new policy, . For a Gaussian policy, the paper enforces separate bounds on the mean and the Covariance, so that the mean can move without the spread changing wildly. Each bound has its own multiplier, found by the same dual trick: minimise a function of the multiplier alone, which the Lagrangian produces once the best or is substituted in.
Why it is called a maximum a posteriori method
The M-step is the same kind of problem as fitting a model to data in Expectation-Maximization Algorithm: the weights act like soft labels, and the policy is refitted to them. The KL bound acts like a prior that keeps the new policy near the old one. Read this way, the update finds the most probable policy under the weighted data and the prior, which is where the name comes from. For the general idea of fitting with a prior, see Maximum a Posteriori (MAP) Estimation.
Worked examples
The numbers are illustrative. They show the arithmetic of the E-step, with one state and three actions.
One state, three actions. The old policy gives probabilities . The estimated values are . Take .
- Compute the exponentials of the values: , , .
- Multiply by the old probabilities: , , .
- Sum: .
- Divide by the sum: . These add to .
- Interpretation: the probability of the third action rose from to , and the probability of the second action fell from to . The best action now dominates the target.
Check the value gain. Under the old policy the expected value is . Under it is . The target is better by about .
Use the same three actions. Fix the leash at . We need the that the dual function prefers. The dual is .
- At : the scaled values are . Their exponentials are . The weighted sum is , and . So .
- At : the exponentials are , the weighted sum is , and . So .
- At : the scaled values are , with exponentials . The weighted sum is , , and .
- The smallest of the three values is at , so that is the chosen temperature. As a check, the KL divergence of the Example 1 target from the old policy is , which equals the leash as it should at the dual minimum. The target from Example 1 is therefore the right one for this leash.
- Interpretation: the leash is the constraint that decides how sharp the target can be. A smaller leash would push up and flatten toward the old policy.
A robot joint's torque is a real number, and the policy is Gaussian with mean for some state. The E-step has produced weights for three sampled torques. The sampled torques and their normalised weights are and .
- The weighted mean of the sampled torques is .
- Refitting with no leash would move the mean all the way to .
- The KL bound on the policy limits the step. Suppose the bound allows 40 percent of the way from the old mean to the weighted mean. The new mean is .
- Interpretation: the policy moved toward the higher-value torques, but only part of the way, so that a noisy batch of value estimates cannot drag the policy far in one update.
In a real system the weights come from many states and many samples, and the bound is set by a multiplier updated during training.
Tradeoffs and failure modes
| Situation | Problem | Better choice |
|---|---|---|
| Continuous actions with a Gaussian policy | Plain policy gradient can be unstable because one large update can break the policy | MPO's two bounded steps, or another trust-region method |
| Very noisy value estimates | Weights concentrate on actions whose values are overestimated | Use more samples per state, or a smaller leash |
| Discrete actions with few choices | The method's extra machinery adds little over simpler policy gradients | A simpler method such as Policy Gradient with a baseline |
| Leash too tight | The policy barely moves, so training is slow | Loosen the bound, or let the multiplier adapt |
| Leash too loose | The policy can jump, and training becomes unstable | Tighten the bound, which is the main safety control |
Some failure modes deserve attention:
- Value errors leak into the target. The E-step trusts . If the critic (the learned estimate of , as in Actor-Critic Methods methods) overestimates some actions, the target puts too much weight on them, and the M-step copies that mistake.
- Two bounds to tune. The E-step and M-step leashes interact. Setting both well takes care, and the paper reports that the sensible values depend on the task.
- Sample cost. Each update needs several sampled actions per state to form the target. This costs environment steps and compute, though the updates are stable.
The method is close in spirit to Trust Region Policy Optimization (TRPO), which also limits each update by a KL bound. The difference is that MPO separates the target construction from the fit, and uses sampled actions instead of the exact gradient of a surrogate.
History
The idea of a relative-entropy leash on policy improvement goes back to the relative entropy policy search method of Jan Peters, Katharina Mülling and Yasemin Altun in 2010, which used a similar closed-form weighting step. Trust-region methods for policy optimisation, such as the one by John Schulman and colleagues in 2015, made the KL bound a standard tool in the field.
Abbas Abdolmaleki and colleagues at DeepMind introduced MPO in 2018. They combined the E-step and M-step framing with separate bounds for the mean and covariance of Gaussian policies, and showed it working on continuous-control tasks. It caught on because it was stable across a wide range of tasks with the same settings, which made it practical for large experiments.
Recap
MPO improves a policy in two bounded steps. The E-step reweights sampled actions by , with set by the KL leash through the dual function. The M-step refits the policy to those weights by weighted maximum likelihood, under its own KL bound. Small steps keep training stable, at the cost of sampling several actions per state. The same leash idea underlies Trust Region Policy Optimization (TRPO), while MPO replaces the direct Policy Gradient step with a weighted refit.
Check yourself
QuestionIn the E-step, what is the new weight of an action proportional to?Show answer
Its old probability times the exponential of its estimated value divided by the temperature . Actions with higher value get more weight, and the old probability keeps the target close to the current policy.
QuestionWith old probabilities and values at , what is the new probability of the best action?Show answer
About . The unnormalised weights are , which sum to . Dividing gives .
QuestionWhy does the M-step include a KL bound between the old and new policy?Show answer
Without it, one update could move the policy far, based on value estimates that are noisy. The bound keeps each step small, so the policy changes gradually and training stays stable. This is the same leash idea used in the E-step.
QuestionIn Example 3, why does the new mean end at instead of ?Show answer
The KL bound allows only part of the move. The weighted mean is and the old mean is , so the full move is . The bound allows 40 percent of it, giving .
QuestionA leash of gives the lowest dual value at in the example. What would a much smaller do to , and to the target?Show answer
A smaller means a tighter leash, so the optimal rises and the target flattens toward the old policy. The best action gets less extra weight, and the update is more cautious.