Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Control as Inference

RL as probabilistic inference: optimality variables, the evidence lower bound and MPO.

What if "act optimally" were an observation? Attach a binary optimality variable to every step, with probability erewarde^{\text{reward}}, condition on all of them being 1, and ask a probabilistic graphical model for the posterior over actions. Out come soft value functions and Boltzmann policies, and, when the dynamics are stochastic, an agent that believes it can make its own luck. This lesson derives exact inference and its optimism, the variational fix that recovers maximum-entropy RL as an evidence lower bound, the EM-style algorithms built on it, from MPO to advantage-weighted regression, and the critique that inference about optimality is not exploration.

What you’ll learn

  • Define the optimality-variable model and derive its backward messages, soft values and posterior policy by exact inference.
  • Show that exact inference with stochastic dynamics backs up log⁡E[eV(s′)]\log\E\big[e^{V(s')}\big], a risk-seeking value, and explain it through the posterior dynamics.
  • Derive maximum-entropy RL as the evidence lower bound of a variational family whose dynamics are held fixed.
  • Derive MPO's E-step (a KL-constrained, nonparametric improvement with a convex dual) and M-step, and relate them to REPS, AWR, V-MPO and KL-regularized fine-tuning of language models.
  • Explain why inference about optimal actions does not provide deep exploration (O'Donoghue, Osband & Ionescu, 2020).

Optimality as evidence

Follow the inference literature and take a finite horizon TT with undiscounted rewards (a discount γ\gamma is the same model with an absorbing "end" state entered with probability 1−γ1-\gamma at every step). Control as inference adds a binary optimality variable Ot\mathcal O_t to each step, with likelihood

p(Ot=1∣st,at)=exp⁡(r(st,at)/α),p(\mathcal O_t=1\mid s_t,a_t)=\exp\big(r(s_t,a_t)/\alpha\big),

where α>0\alpha>0 is a temperature. For this to be a probability the rewards must be at most 0; subtract the largest reward, or read er/αe^{r/\alpha} as an unnormalized potential, and nothing below changes. With a uniform prior over actions (any other prior can be folded into the reward), conditioning on O1:T=1\mathcal O_{1:T}=1 gives a posterior over trajectories:

p(τ∣O1:T=1) ∝ [p(s1)∏t=1TP(st+1∣st,at)]exp⁡(1α∑t=1Tr(st,at))p\big(\tau\mid\mathcal O_{1:T}=1\big)\ \propto\ \Big[p(s_1)\prod_{t=1}^{T}P(s_{t+1}\mid s_t,a_t)\Big]\exp\Big(\frac1\alpha\sum_{t=1}^{T}r(s_t,a_t)\Big)
The physics of the system, reweighted by the exponentiated total reward. Trajectories are not forced to be optimal; better ones are exponentially more probable.

With deterministic dynamics the bracket only says which trajectories are feasible, so the most probable trajectory is the reward-maximizing plan: planning is maximum a posteriori inference. The idea has several roots: Todorov's (2008) duality between optimal control and estimation, Toussaint's (2009) trajectory optimization by approximate inference, Kappen, Gómez and Opper's (2012) optimal control as graphical-model inference, Rawlik, Toussaint and Vijayakumar's (2012) approximate inference control, and Ziebart's (2010) principle of maximum causal entropy, which also founded maximum-entropy inverse RL (Maximum-Entropy Inverse RL). Levine (2018) gives the unified account this lesson follows.

Exact inference, and an agent that makes its own luck

As in a hidden Markov model, the posterior policy needs only backward messages, βt(s,a)=p(Ot:T=1∣st=s,at=a)\beta_t(s,a)=p(\mathcal O_{t:T}=1\mid s_t=s,a_t=a) and βt(s)=p(Ot:T=1∣st=s)\beta_t(s)=p(\mathcal O_{t:T}=1\mid s_t=s), computed from t=Tt=T down to 1 with βT+1≡1\beta_{T+1}\equiv1. In log space they are value functions.

DerivationBackward messages are soft values
  1. βt(s,a)=er(s,a)/α  Es′∼P(⋅∣s,a)[βt+1(s′)],βt(s)=1∣A∣∑aβt(s,a)\beta_t(s,a)=e^{r(s,a)/\alpha}\;\E_{s'\sim P(\cdot\mid s,a)}\big[\beta_{t+1}(s')\big],\qquad\beta_t(s)=\frac{1}{\abs{\mathcal A}}\sum_a\beta_t(s,a)

    Condition on the next state; the optimality of step tt and of the rest of the trajectory are independent given it:

  2. Qt(s,a)=r(s,a)+αlog⁡Es′∼P(⋅∣s,a)[eVt+1(s′)/α],Vt(s)=αlog⁡∑aeQt(s,a)/αQ_t(s,a)=r(s,a)+\alpha\log\E_{s'\sim P(\cdot\mid s,a)}\Big[e^{V_{t+1}(s')/\alpha}\Big],\qquad V_t(s)=\alpha\log\sum_ae^{Q_t(s,a)/\alpha}

    Define Qt=αlog⁡βt(s,a)Q_t=\alpha\log\beta_t(s,a) and Vt(s)=αlog⁡∑aβt(s,a)V_t(s)=\alpha\log\sum_a\beta_t(s,a). The recursion becomes a backup, up to a constant αlog⁡∣A∣\alpha\log\abs{\mathcal A} per step from the uniform prior, which does not affect the policy:

  3. p(at=a∣st=s,Ot:T=1)=βt(s,a)∑a′βt(s,a′)=exp⁡(Qt(s,a)−Vt(s)α)p\big(a_t=a\mid s_t=s,\mathcal O_{t:T}=1\big)=\frac{\beta_t(s,a)}{\sum_{a'}\beta_t(s,a')}=\exp\Big(\frac{Q_t(s,a)-V_t(s)}{\alpha}\Big)

    By Bayes' rule the posterior policy is the ratio of messages: a Boltzmann policy over the soft values, as in maximum-entropy RL.

  4. With deterministic dynamics, αlog⁡E[eV/α]=V(s′)\alpha\log\E[e^{V/\alpha}]=V(s') and the backup is the soft Bellman equation. With stochastic dynamics it is not: by Jensen's inequality αlog⁡E[eV/α]≥E[V]\alpha\log\E[e^{V/\alpha}]\ge\E[V], a soft maximum over next states. One lucky outcome can dominate the value of a risky action.

The reason is in the posterior dynamics. Conditioned on optimality, the next state is distributed as p(s′∣s,a,Ot+1:T)∝P(s′∣s,a) eVt+1(s′)/αp(s'\mid s,a,\mathcal O_{t+1:T})\propto P(s'\mid s,a)\,e^{V_{t+1}(s')/\alpha}: given that the trajectory turned out optimal, the good outcomes must have happened. The objective exact inference optimizes contains terms for changing the dynamics, so the inferred agent behaves as if it could bend the world toward good outcomes at a KL cost (Levine, 2018). Under the posterior's logic, a lottery ticket is a sound purchase. In risk-sensitive terms, αlog⁡E[eG/α]\alpha\log\E[e^{G/\alpha}] is an exponential-utility certainty equivalent with a risk-seeking sign.

Predict before you look

A gamble pays 0.9 with probability 0.9 and 10.9 with probability 0.1 (mean 1.9). With α=1\alpha=1, what value does the exact-inference backup log⁡E[eG]\log\E\big[e^{G}\big] assign to it?

Show the answer

8.6

log⁡(0.9e0.9+0.1e10.9)=log⁡(2.21+5417.6)≈8.60\log\big(0.9e^{0.9}+0.1e^{10.9}\big)=\log(2.21+5417.6)\approx8.60, far above the mean of 1.9 and close to the jackpot. The posterior puts probability 0.1e10.9/5419.9≈0.99960.1e^{10.9}/5419.9\approx0.9996 on winning. A larger temperature tempers the optimism: at α=10\alpha=10 the value is 10log⁡(0.9e0.09+0.1e1.09)≈2.4910\log\big(0.9e^{0.09}+0.1e^{1.09}\big)\approx2.49 and the posterior probability of the jackpot about 0.23.

Variational inference recovers maximum-entropy RL

The fix is to stop the agent from choosing its luck. Approximate the posterior with a structured variational family that keeps the true start distribution and dynamics and lets only the policy vary, q(τ)=p(s1)∏tP(st+1∣st,at) q(at∣st)q(\tau)=p(s_1)\prod_tP(s_{t+1}\mid s_t,a_t)\,q(a_t\mid s_t), and maximize the evidence lower bound.

DerivationThe evidence lower bound is the maximum-entropy objective
  1. log⁡p(O1:T=1)=log⁡Eτ∼q[p(τ,O1:T=1)q(τ)] ≥ Eτ∼q[log⁡p(τ,O1:T=1)−log⁡q(τ)]\log p(\mathcal O_{1:T}=1)=\log\E_{\tau\sim q}\Big[\frac{p(\tau,\mathcal O_{1:T}=1)}{q(\tau)}\Big]\ \ge\ \E_{\tau\sim q}\big[\log p(\tau,\mathcal O_{1:T}=1)-\log q(\tau)\big]

    Write the evidence as an expectation under qq and apply Jensen's inequality:

  2. log⁡p(O1:T=1) ≥ Eτ∼q[∑t=1T(r(st,at)α−log⁡q(at∣st))]−Tlog⁡∣A∣\log p(\mathcal O_{1:T}=1)\ \ge\ \E_{\tau\sim q}\Big[\sum_{t=1}^{T}\Big(\frac{r(s_t,a_t)}{\alpha}-\log q(a_t\mid s_t)\Big)\Big]-T\log\abs{\mathcal A}

    Expand both log-densities. The start distribution and the dynamics appear in both and cancel, because qq uses the true ones; the uniform action prior leaves a constant:

  3. Multiplied by α\alpha, the bound is the maximum-entropy objective, Eq[∑tr(st,at)+α H(q(⋅∣st))]\E_q\big[\sum_t r(s_t,a_t)+\alpha\,\mathcal H\big(q(\cdot\mid s_t)\big)\big] plus a constant. The gap is DKL(q(τ) ∥ p(τ∣O1:T=1))\KL\big(q(\tau)\,\|\,p(\tau\mid\mathcal O_{1:T}=1)\big), the distance from the optimistic posterior.

Optimizing this bound over q(a∣s)q(a\mid s) by dynamic programming gives the soft Bellman equation with an expectation over next states, Q(s,a)=r(s,a)+Es′[V(s′)]Q(s,a)=r(s,a)+\E_{s'}[V(s')] with V(s)=αlog⁡∑aeQ(s,a)/αV(s)=\alpha\log\sum_ae^{Q(s,a)/\alpha}, exactly the backup of Maximum-Entropy RL & Soft Actor–Critic. Freezing the dynamics in the variational family restores risk neutrality toward the environment's randomness; with deterministic dynamics, exact and variational inference coincide. The bound also accommodates any policy class, such as Gaussians or networks that see only partial observations.

Check your understanding

Why does restricting the variational family to the true dynamics remove the optimism of exact inference?

  1. Because it changes the reward function to a risk-averse one
  2. Because the posterior over trajectories reweights next states by eV(s′)/αe^{V(s')/\alpha}, and a qq with the true dynamics cannot follow that reweighting, so only actions are optimized and next states are averaged with their true probabilities
  3. Because the evidence lower bound is always smaller than the true value
  4. Because it lowers the temperature to zero
Show the answer

B. Because the posterior over trajectories reweights next states by eV(s′)/αe^{V(s')/\alpha}, and a qq with the true dynamics cannot follow that reweighting, so only actions are optimized and next states are averaged with their true probabilities

Exact inference matches the posterior, which tilts transitions toward good outcomes. The restricted family cannot tilt them: the dynamics terms cancel in the bound, and the best qq maximizes expected reward plus entropy under the real dynamics, a risk-neutral soft Bellman equation.

EM for policies: MPO and its relatives

Replace the uniform action prior by the current policy πθ\pi_{\boldsymbol\theta} and the bound becomes a KL-regularized objective, J(q,θ)=Eq[∑tγt(rt−α DKL(q(⋅∣st) ∥ πθ(⋅∣st)))]+log⁡p(θ)\mathcal J(q,\boldsymbol\theta)=\E_q\big[\sum_t\gamma^t\big(r_t-\alpha\,\KL\big(q(\cdot\mid s_t)\,\|\,\pi_{\boldsymbol\theta}(\cdot\mid s_t)\big)\big)\big]+\log p(\boldsymbol\theta), with a prior p(θ)p(\boldsymbol\theta) on the parameters. MPO, maximum a posteriori policy optimisation (Abdolmaleki, Springenberg, Tassa, Munos, Heess & Riedmiller, 2018), maximizes it by coordinate ascent, as in expectation–maximization: an E-step improves qq with the policy fixed, an M-step fits the policy to qq. Both use the old policy's critic Q(s,a)Q(s,a) learned off-policy from replay, and both are written as hard KL constraints, because a penalty's scale relative to the rewards is hard to choose.

DerivationThe E-step in closed form
  1. max⁡q Es∼DEa∼q(⋅∣s)[Q(s,a)]subject toEs∼D[DKL(q(⋅∣s) ∥ πold(⋅∣s))]≤ϵ\max_q\ \E_{s\sim\data}\E_{a\sim q(\cdot\mid s)}\big[Q(s,a)\big]\quad\text{subject to}\quad\E_{s\sim\data}\Big[\KL\big(q(\cdot\mid s)\,\|\,\pi_{\text{old}}(\cdot\mid s)\big)\Big]\le\epsilon

    Over replayed states s∼Ds\sim\data, improve the action distribution while staying within ϵ\epsilon of the old policy on average:

  2. q(a∣s)=πold(a∣s) eQ(s,a)/ηEa′∼πold[eQ(s,a′)/η]q(a\mid s)=\frac{\pi_{\text{old}}(a\mid s)\,e^{Q(s,a)/\eta}}{\E_{a'\sim\pi_{\text{old}}}\big[e^{Q(s,a')/\eta}\big]}

    With a Lagrange multiplier η\eta for the constraint, each state's problem is the Gibbs variational principle with the old policy as reference: a tilted version of the old policy.

  3. g(η)=η ϵ+η Es∼D[log⁡Ea∼πold(⋅∣s)[eQ(s,a)/η]],η⋆=arg min⁡η>0g(η)g(\eta)=\eta\,\epsilon+\eta\,\E_{s\sim\data}\Big[\log\E_{a\sim\pi_{\text{old}}(\cdot\mid s)}\big[e^{Q(s,a)/\eta}\big]\Big],\qquad\eta^\star=\argmin_{\eta>0}g(\eta)

    The temperature is not a hyperparameter but the minimizer of the convex dual, estimated with actions sampled from πold\pi_{\text{old}}:

python
import math
import torch

def mpo_e_step(q_values, eps=0.1, iters=200):
    """q_values: (B, K) critic values of K actions sampled from pi_old in each of B states.
    Returns the nonparametric E-step weights q(a_k | s_b) and the temperature eta."""
    log_eta = torch.zeros((), requires_grad=True)
    opt = torch.optim.Adam([log_eta], lr=0.05)
    K = q_values.shape[1]
    for _ in range(iters):                 # minimize the convex dual g(eta)
        eta = log_eta.exp()
        log_mean_exp = torch.logsumexp(q_values / eta, dim=1) - math.log(K)
        g = eta * eps + eta * log_mean_exp.mean()
        opt.zero_grad()
        g.backward()
        opt.step()
    eta = log_eta.exp().detach()
    return torch.softmax(q_values / eta, dim=1), eta

# M-step: maximize sum over b, k of weights[b, k] * log pi_theta(a_k | s_b),
# subject to an average KL(pi_old || pi_theta) below a second bound.

Because the actions were sampled from πold\pi_{\text{old}}, the tilted distribution restricted to them is just a softmax of Q/ηQ/\eta over each state's samples. A larger ϵ\epsilon gives a smaller η\eta and sharper weights.

The M-step is supervised learning: weighted maximum likelihood, max⁡θEs∼DEa∼q[log⁡πθ(a∣s)]\max_{\boldsymbol\theta}\E_{s\sim\data}\E_{a\sim q}\big[\log\pi_{\boldsymbol\theta}(a\mid s)\big], subject to Es[DKL(πold(⋅∣s) ∥ πθ(⋅∣s))]\E_s\big[\KL\big(\pi_{\text{old}}(\cdot\mid s)\,\|\,\pi_{\boldsymbol\theta}(\cdot\mid s)\big)\big] below a second bound. The two KL divergences point in opposite directions: mode-seeking in the E-step, moment-matching in the M-step, which the authors found keeps the parametric policy's entropy from collapsing, and the M-step constraint greatly increased stability.

The same tilt-then-project structure runs through a family of methods. Relative entropy policy search (REPS; Peters, Mülling & Altun, 2010) solves a similar dual over joint state–action distributions. Reward-weighted regression (Peters & Schaal, 2007) weights actions by exponentiated returns. Advantage-weighted regression (AWR; Peng, Kumar, Zhang & Levine, 2019) fits π\pi to replayed actions weighted by exp⁡(1β(R−V(s)))\exp\big(\frac1\beta(R-V(s))\big), the projection of π⋆∝b(a∣s) e(R−V(s))/β\pi^\star\propto b(a\mid s)\,e^{(R-V(s))/\beta} for a behavior policy bb; the baseline VV proved crucial, and the weights are clipped to avoid exploding gradients. It reappears in offline RL (Conservative Offline RL: BCQ, CQL & IQL). V-MPO (Song et al., 2019) is the on-policy version: advantages from a learned state-value function, only the top half of each batch's advantages in the E-step, a learned temperature and a Lagrange multiplier for the M-step's KL bound; it reported surpassing previously published multi-task scores on Atari-57 and DMLab-30 without importance weighting, entropy regularization or population-based hyperparameter tuning.

Language-model fine-tuning has the same skeleton. The KL-regularized objective Eπ[r]−β DKL(π ∥ πref)\E_\pi[r]-\beta\,\KL(\pi\,\|\,\pi_{\text{ref}}) is maximized by π⋆∝πref er/β\pi^\star\propto\pi_{\text{ref}}\,e^{r/\beta}, an E-step with the reference policy as prior (Direct Preference Optimization & Its Relatives), and Korbak, Perez and Buckley (2022) argue that KL-regularized RL for language models is best understood as variational inference toward that posterior.

Inference about optimality is not exploration

The word "posterior" invites a misreading. The posterior in control as inference is over trajectories given optimality, computed as if the MDP were known. It says nothing about what the agent does not yet know about the MDP, and that epistemic uncertainty is what exploration must resolve. O'Donoghue, Osband and Ionescu (2020) made the gap concrete with a one-state problem with N≥3N\ge3 actions: action 1 pays 1, actions 3 to NN pay 1−ϵ1-\epsilon, and action 2 pays +2+2 or −2-2, each with prior probability ½.

The Bayes-optimal agent tries action 2 once: if it paid +2+2 it keeps it, otherwise it switches to action 1. A soft Q-learning agent acts by a Boltzmann policy over expected rewards, in which action 2 is worth 0 and competes with N−2N-2 distractors worth nearly 1, so it almost never tries it. In their experiment (ϵ=10−3\epsilon=10^{-3}, uniform prior) the Bayesian regret was 1.5 for the Bayes-optimal policy, 2 for Thompson sampling and at most 2.2 for K-learning, while soft Q-learning's regret grew linearly in NN even at the best temperature. K-learning keeps the soft Bellman equation and Boltzmann policy but adds a count-based bonus and a schedule for the temperature, which makes its values optimistic about uncertain actions, and it comes with a Bayesian regret bound.

Key takeaways

  • With p(Ot=1∣st,at)=er(st,at)/αp(\mathcal O_t=1\mid s_t,a_t)=e^{r(s_t,a_t)/\alpha}, the posterior over trajectories is the dynamics reweighted by e∑tr/αe^{\sum_tr/\alpha}; its backward messages are soft values, and the posterior policy is exp⁡((Q−V)/α)\exp\big((Q-V)/\alpha\big).
  • Exact inference with stochastic dynamics backs up αlog⁡E[eV(s′)/α]\alpha\log\E\big[e^{V(s')/\alpha}\big]: the posterior assumes the lucky outcomes happened, and the agent is risk-seeking (a 10% jackpot of 10.9 against 0.9 is worth about 8.6 at α=1\alpha=1, not 1.9).
  • Variational inference with the true dynamics held fixed turns the evidence lower bound into the maximum-entropy objective, and the backup into the risk-neutral soft Bellman equation.
  • MPO runs EM on the KL-regularized bound: a closed-form E-step q∝πoldeQ/ηq\propto\pi_{\text{old}}e^{Q/\eta} with η\eta from a convex dual, then weighted maximum likelihood under a KL constraint; REPS, AWR, V-MPO and the optimum of KL-regularized LM fine-tuning share this tilt-then-project form.
  • The posterior given optimality contains no uncertainty about the MDP, so inference-based methods do not explore deeply; optimism or posterior sampling (K-learning, Thompson sampling) must be added.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the optimality-variable model with stochastic dynamics, exact inference backs up Qt(s,a)=r(s,a)+αlog⁡Es′[eVt+1(s′)/α]Q_t(s,a)=r(s,a)+\alpha\log\E_{s'}\big[e^{V_{t+1}(s')/\alpha}\big]. What kind of agent does this produce?

  1. A risk-neutral agent, identical to standard maximum-entropy RL
  2. A risk-averse agent, since the logarithm is concave
  3. A risk-seeking agent: the backup is a soft maximum over next states, so a rare high-value outcome can dominate
  4. An agent that ignores the dynamics entirely
Show the answer

C. A risk-seeking agent: the backup is a soft maximum over next states, so a rare high-value outcome can dominate

By Jensen's inequality the log-expected-exponential is at least the expectation, and it approaches the maximum as α→0\alpha\to0. It is an exponential-utility certainty equivalent with a risk-seeking sign, the result of a posterior that assumes the lucky outcomes happened.

Question 2

With q(τ)=p(s1)∏tP(st+1∣st,at)q(at∣st)q(\tau)=p(s_1)\prod_tP(s_{t+1}\mid s_t,a_t)q(a_t\mid s_t), what is α\alpha times the evidence lower bound, up to a constant?

  1. Eq[∑tr(st,at)]\E_q\big[\sum_tr(s_t,a_t)\big], the standard expected return
  2. Eq[∑t(r(st,at)+α H(q(⋅∣st)))]\E_q\big[\sum_t\big(r(s_t,a_t)+\alpha\,\mathcal H(q(\cdot\mid s_t))\big)\big], the maximum-entropy objective
  3. Eq[∑tr(st,at)]−α DKL(q ∥ πold)\E_q\big[\sum_t r(s_t,a_t)\big]-\alpha\,\KL\big(q\,\|\,\pi_{\text{old}}\big), a trust-region objective
  4. log⁡Eq[e∑tr(st,at)/α]\log\E_q\big[e^{\sum_tr(s_t,a_t)/\alpha}\big], the exact log-evidence
Show the answer

B. Eq[∑t(r(st,at)+α H(q(⋅∣st)))]\E_q\big[\sum_t\big(r(s_t,a_t)+\alpha\,\mathcal H(q(\cdot\mid s_t))\big)\big], the maximum-entropy objective

The dynamics terms of log⁡p(τ,O)\log p(\tau,\mathcal O) and log⁡q(τ)\log q(\tau) cancel, leaving ∑t(r/α−log⁡q(at∣st))\sum_t\big(r/\alpha-\log q(a_t\mid s_t)\big) minus a constant from the uniform prior. Multiplying by α\alpha gives reward plus α\alpha times entropy.

Question 3

What does MPO's E-step produce, and where does its temperature η\eta come from?

  1. A tilted version of the old policy, q(a∣s)∝πold(a∣s) eQ(s,a)/ηq(a\mid s)\propto\pi_{\text{old}}(a\mid s)\,e^{Q(s,a)/\eta}, with η\eta the Lagrange multiplier of the average-KL constraint, found by minimizing a convex dual
  2. The greedy policy arg max⁡aQ(s,a)\argmax_aQ(s,a), with η\eta a learning rate
  3. A new parametric policy trained by the policy gradient, with η\eta an entropy bonus chosen by hand
  4. A uniform policy over actions whose value exceeds η\eta
Show the answer

A. A tilted version of the old policy, q(a∣s)∝πold(a∣s) eQ(s,a)/ηq(a\mid s)\propto\pi_{\text{old}}(a\mid s)\,e^{Q(s,a)/\eta}, with η\eta the Lagrange multiplier of the average-KL constraint, found by minimizing a convex dual

Maximizing expected QQ under a KL budget is the Gibbs variational principle with the old policy as reference. The budget ϵ\epsilon fixes η\eta through the dual g(η)=ηϵ+η Eslog⁡Eπold[eQ/η]g(\eta)=\eta\epsilon+\eta\,\E_s\log\E_{\pi_{\text{old}}}[e^{Q/\eta}]; the M-step then fits the parametric policy to qq by weighted maximum likelihood.

Question 4

O'Donoghue, Osband and Ionescu (2020) showed that soft Q-learning can perform poorly on a one-state problem with one uncertain action. What is the core reason?

  1. Its temperature is always too high
  2. It computes a posterior over trajectories given optimality, as if the MDP were known; its Boltzmann policy over expected rewards almost never tries an uncertain action whose expected value is low, so it does not resolve its own uncertainty
  3. Soft Bellman equations do not converge in bandit problems
  4. It is risk-seeking, so it tries the uncertain action too often
Show the answer

B. It computes a posterior over trajectories given optimality, as if the MDP were known; its Boltzmann policy over expected rewards almost never tries an uncertain action whose expected value is low, so it does not resolve its own uncertainty

Exploration requires reasoning about what the agent does not know and about the value of finding out. The inference framework's "posterior" contains no epistemic uncertainty. Thompson sampling and K-learning, which do, achieve small Bayesian regret on the same problem, while soft Q-learning's grows with the number of distractor actions.

Further reading

  • S. Levine, "Reinforcement learning and control as probabilistic inference: Tutorial and review," arXiv:1805.00909 (2018).
  • B. D. Ziebart, Modeling Purposeful Adaptive Behavior with the Principle of Maximum Causal Entropy, PhD thesis, Carnegie Mellon University (2010).
  • A. Abdolmaleki, J. T. Springenberg, Y. Tassa, R. Munos, N. Heess & M. Riedmiller, "Maximum a posteriori policy optimisation," ICLR (2018).
  • B. O'Donoghue, I. Osband & C. Ionescu, "Making sense of reinforcement learning and probabilistic inference," ICLR (2020).
  • H. F. Song, A. Abdolmaleki, J. T. Springenberg, A. Clark, H. Soyer, J. W. Rae, S. Noury, A. Ahuja et al., "V-MPO: On-policy maximum a posteriori policy optimization for discrete and continuous control," ICLR (2020).