Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Maximum-Entropy RL & Soft Actor–Critic

Soft Bellman equations, soft policy iteration and automatic temperature tuning.

Adding the policy's entropy to the reward looks like a trick to keep exploring. It is more than that. It smooths the max of the Bellman equation into a log-sum-exp, makes the optimal policy a Boltzmann distribution over soft action values, admits a policy iteration with a short convergence proof, and provably buys robustness to some perturbations of the reward. This lesson develops that theory, follows it to soft actor–critic and its automatic temperature, and states what the entropy costs.

What you’ll learn

  • Derive the soft Bellman optimality equations and the Boltzmann form of the optimal maximum-entropy policy from the Gibbs variational principle.
  • Prove soft policy evaluation, soft policy improvement by information projection and the convergence of soft policy iteration, and relate soft policy iteration to entropy-regularized natural policy gradient.
  • Derive SAC's losses, including the reparameterized policy gradient and the temperature as a dual variable, and place soft Q-learning and path consistency learning in the same family.
  • Prove a one-step robustness guarantee for maximum-entropy policies, and quantify the bias the entropy introduces.

Soft values and the Boltzmann policy

Maximum-entropy RL scores a policy by its rewards plus α\alpha times the entropy of its action distribution in every state it visits, with temperature α>0\alpha>0. The soft value of a policy counts the entropy of the current state's action distribution, while the soft Q-function counts only the entropy of future states (the action at ss is already chosen):

Vπ(s)=Eπ[∑t≥0γt(r(St,At)−αlog⁡π(At∣St)) ∣ S0=s],Qπ(s,a)=r(s,a)+γ Es′[Vπ(s′)]V^\pi(s)=\E_\pi\Big[\sum_{t\ge0}\gamma^t\big(r(S_t,A_t)-\alpha\log\pi(A_t\mid S_t)\big)\,\Big|\,S_0=s\Big],\qquad Q^\pi(s,a)=r(s,a)+\gamma\,\E_{s'}\big[V^\pi(s')\big]
Together they satisfy Vπ(s)=Ea∼π[Qπ(s,a)−αlog⁡π(a∣s)]V^\pi(s)=\E_{a\sim\pi}\big[Q^\pi(s,a)-\alpha\log\pi(a\mid s)\big], the soft Bellman expectation equation. Here r(s,a)r(s,a) is the expected reward.
DerivationThe Gibbs variational principle
  1. Ea∼p[q(a)]+α H(p)=αlog⁡Z−α DKL(p ∥ p⋆)\E_{a\sim p}\big[q(a)\big]+\alpha\,\mathcal H(p)=\alpha\log Z-\alpha\,\KL(p\,\|\,p^\star)

    Fix a state with action values q(a)q(a) and let p⋆(a)=eq(a)/α/Zp^\star(a)=e^{q(a)/\alpha}/Z, Z=∑aeq(a)/αZ=\sum_ae^{q(a)/\alpha}. Expanding DKL(p ∥ p⋆)=∑ap(a)(log⁡p(a)−q(a)/α+log⁡Z)\KL(p\,\|\,p^\star)=\sum_ap(a)\big(\log p(a)-q(a)/\alpha+\log Z\big) gives, for every distribution pp,

  2. max⁡p{Ep[q]+α H(p)}=αlog⁡∑aeq(a)/α,arg max⁡p=p⋆∝eq/α\max_p\Big\{\E_p[q]+\alpha\,\mathcal H(p)\Big\}=\alpha\log\sum_ae^{q(a)/\alpha},\qquad\argmax_p=p^\star\propto e^{q/\alpha}

    The KL divergence is nonnegative and zero only at p=p⋆p=p^\star, so the entropy-regularized maximum is a log-sum-exp, attained by a Boltzmann distribution:

Q⋆(s,a)=r(s,a)+γ Es′[V⋆(s′)],V⋆(s)=αlog⁡∑aeQ⋆(s,a)/α,π⋆(a∣s)=e(Q⋆(s,a)−V⋆(s))/αQ^\star(s,a)=r(s,a)+\gamma\,\E_{s'}\big[V^\star(s')\big],\qquad V^\star(s)=\alpha\log\sum_ae^{Q^\star(s,a)/\alpha},\qquad\pi^\star(a\mid s)=e^{(Q^\star(s,a)-V^\star(s))/\alpha}
The soft Bellman optimality equations (for continuous actions, an integral replaces the sum). As α→0\alpha\to0 the log-sum-exp becomes a max and ordinary optimality returns; as α→∞\alpha\to\infty the policy becomes uniform. Because the log-sum-exp is monotone and shifts by cc when all its inputs do, the soft optimality operator is a γ\gamma-contraction in the max norm, like its hard counterpart.
Predict before you look

A state has two actions with soft optimal values Q⋆(s,⋅)=(1,0)Q^\star(s,\cdot)=(1,0), and α=1\alpha=1. What is V⋆(s)V^\star(s)?

Show the answer

1.31

V⋆(s)=log⁡(e1+e0)=log⁡3.718≈1.313V^\star(s)=\log(e^1+e^0)=\log3.718\approx1.313, and π⋆\pi^\star picks the first action with probability e/(e+1)≈0.731e/(e+1)\approx0.731. The soft value exceeds the max because the policy also collects entropy. In general max⁡aQ⋆(s,a)≤V⋆(s)≤max⁡aQ⋆(s,a)+αlog⁡∣A∣\max_aQ^\star(s,a)\le V^\star(s)\le\max_aQ^\star(s,a)+\alpha\log\abs{\mathcal A}; with α=0.1\alpha=0.1 here, V⋆(s)≈1.0000045V^\star(s)\approx1.0000045, essentially the max.

Soft policy iteration

Haarnoja, Zhou, Abbeel and Levine (2018) built SAC on a policy iteration that works within a restricted class of policies Π\Pi, such as Gaussians. Their results assume a finite action set, so that entropies, and hence soft values, are bounded. Soft policy evaluation (Lemma 1): iterating Q←r+γEs′Ea′∼π[Q(s′,a′)−αlog⁡π(a′∣s′)]Q\leftarrow r+\gamma\E_{s'}\E_{a'\sim\pi}\big[Q(s',a')-\alpha\log\pi(a'\mid s')\big] converges to QπQ^\pi, because it is ordinary policy evaluation with the bounded reward r(s,a)+γα Es′H(π(⋅∣s′))r(s,a)+\gamma\alpha\,\E_{s'}\mathcal H\big(\pi(\cdot\mid s')\big).

DerivationProof of soft policy improvement
  1. Ea∼πnew[αlog⁡πnew(a∣s)−Qπold(s,a)]≤Ea∼πold[αlog⁡πold(a∣s)−Qπold(s,a)]=−Vπold(s)\E_{a\sim\pi_{\text{new}}}\big[\alpha\log\pi_{\text{new}}(a\mid s)-Q^{\pi_{\text{old}}}(s,a)\big]\le\E_{a\sim\pi_{\text{old}}}\big[\alpha\log\pi_{\text{old}}(a\mid s)-Q^{\pi_{\text{old}}}(s,a)\big]=-V^{\pi_{\text{old}}}(s)

    πold\pi_{\text{old}} is itself a candidate in the projection, so the minimizer does at least as well. The partition function depends only on ss and cancels from both sides:

  2. Ea∼πnew[Qπold(s,a)−αlog⁡πnew(a∣s)] ≥ Vπold(s)\E_{a\sim\pi_{\text{new}}}\big[Q^{\pi_{\text{old}}}(s,a)-\alpha\log\pi_{\text{new}}(a\mid s)\big]\ \ge\ V^{\pi_{\text{old}}}(s)

    So, in every state, acting once with πnew\pi_{\text{new}} and then following πold\pi_{\text{old}} does at least as well, in soft value, as following πold\pi_{\text{old}}:

  3. Qπold(s,a)=r(s,a)+γEs′[Vπold(s′)]≤r(s,a)+γEs′Ea′∼πnew[Qπold(s′,a′)−αlog⁡πnew(a′∣s′)]≤⋯≤Qπnew(s,a)Q^{\pi_{\text{old}}}(s,a)=r(s,a)+\gamma\E_{s'}\big[V^{\pi_{\text{old}}}(s')\big]\le r(s,a)+\gamma\E_{s'}\E_{a'\sim\pi_{\text{new}}}\big[Q^{\pi_{\text{old}}}(s',a')-\alpha\log\pi_{\text{new}}(a'\mid s')\big]\le\cdots\le Q^{\pi_{\text{new}}}(s,a)

    Insert this bound into the soft Bellman equation of πold\pi_{\text{old}} and repeat at every later step; the right side converges to the soft value of πnew\pi_{\text{new}}. ■\blacksquare

For the theorem, the soft values QπiQ^{\pi_i} increase monotonically and are bounded, so they converge; at the limit the policy is its own projection, and the same unrolling shows its soft values dominate those of every other policy in Π\Pi. The guarantee is for exact evaluation and exact projection in the tabular case, and optimality is within Π\Pi.

When Π\Pi contains every policy, the projection is exact, πt+1∝exp⁡(Qπt/α)\pi_{t+1}\propto\exp\big(Q^{\pi_t}/\alpha\big), and soft policy iteration is entropy-regularized natural policy gradient with step size η=(1−γ)/α\eta=(1-\gamma)/\alpha (The Natural Policy Gradient), which converges linearly, at rate γ\gamma (Cen, Cheng, Chen, Wei & Chi, 2022).

Check your understanding

Soft policy improvement projects with DKL(π′ ∥ eQ/α/Z)\KL\big(\pi'\,\|\,e^{Q/\alpha}/Z\big), the new policy in the first argument. What does this direction buy in practice?

  1. It makes the new policy cover every mode of the Boltzmann distribution
  2. The objective becomes Ea∼π′[αlog⁡π′(a∣s)−Q(s,a)]\E_{a\sim\pi'}\big[\alpha\log\pi'(a\mid s)-Q(s,a)\big] up to a constant: an expectation under the policy being optimized, estimable with its own samples, with the intractable Z(s)Z(s) dropping out
  3. It removes the need for a critic
  4. It guarantees that the projected policy is deterministic
Show the answer

B. The objective becomes Ea∼π′[αlog⁡π′(a∣s)−Q(s,a)]\E_{a\sim\pi'}\big[\alpha\log\pi'(a\mid s)-Q(s,a)\big] up to a constant: an expectation under the policy being optimized, estimable with its own samples, with the intractable Z(s)Z(s) dropping out

In this direction the expectation is over π′\pi', which we can sample and reparameterize, and log⁡Z(s)\log Z(s) is a constant per state. The reverse direction would need samples from eQ/α/Ze^{Q/\alpha}/Z, which is what soft Q-learning had to approximate with a separate sampler. The price is mode-seeking behavior: a unimodal Gaussian π′\pi' settles on one mode of a multimodal Boltzmann policy.

From soft policy iteration to SAC

SAC runs both steps of soft policy iteration approximately, one stochastic gradient step at a time, on minibatches from a replay buffer D\data: twin soft critics Qϕ1,Qϕ2Q_{\phi_1},Q_{\phi_2} with target copies QϕˉjQ_{\bar\phi_j}, and a reparameterized actor a=fθ(ε;s)a=f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s), a tanh-squashed Gaussian with ε∼N(0,I)\boldsymbol\varepsilon\sim\mathcal N(0,I).

LQ(ϕi)=ED[12(Qϕi(s,a)−r−γ(min⁡jQϕˉj(s′,a′)−αlog⁡πθ(a′∣s′)))2],Lπ(θ)=Es∼D, ε[αlog⁡πθ(fθ(ε;s)∣s)−min⁡jQϕj(s,fθ(ε;s))]\loss_Q(\phi_i)=\E_{\data}\Big[\tfrac12\Big(Q_{\phi_i}(s,a)-r-\gamma\big(\min_jQ_{\bar\phi_j}(s',a')-\alpha\log\pi_{\boldsymbol\theta}(a'\mid s')\big)\Big)^2\Big],\qquad\loss_\pi(\boldsymbol\theta)=\E_{s\sim\data,\,\boldsymbol\varepsilon}\Big[\alpha\log\pi_{\boldsymbol\theta}\big(f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s)\mid s\big)-\min_jQ_{\phi_j}\big(s,f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s)\big)\Big]
a′∼πθ(⋅∣s′)a'\sim\pi_{\boldsymbol\theta}(\cdot\mid s') is sampled fresh (terminal transitions drop the bootstrap term). Lπ\loss_\pi is the projection objective α DKL(πθ ∥ eQ/α/Z)\alpha\,\KL\big(\pi_{\boldsymbol\theta}\,\|\,e^{Q/\alpha}/Z\big) up to a constant: the information projection of soft policy improvement. The original version also learned a separate state-value network; the second version dropped it.
DerivationThe reparameterized policy gradient
  1. ∇^θLπ=∇θ αlog⁡πθ(a∣s)+(∇a αlog⁡πθ(a∣s)−∇aQ(s,a))∇θfθ(ε;s)∣a=fθ(ε;s)\hat\nabla_{\boldsymbol\theta}\loss_\pi=\nabla_{\boldsymbol\theta}\,\alpha\log\pi_{\boldsymbol\theta}(a\mid s)+\Big(\nabla_a\,\alpha\log\pi_{\boldsymbol\theta}(a\mid s)-\nabla_aQ(s,a)\Big)\nabla_{\boldsymbol\theta}f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s)\Big|_{a=f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s)}

    The sampled action depends on θ\boldsymbol\theta through fθf_{\boldsymbol\theta}, so the chain rule has a direct term (the log-density's own dependence on θ\boldsymbol\theta at fixed aa) and a pathwise term through the action, which is where the critic's action gradient enters:

  2. Automatic differentiation of the loss through a=fθ(ε;s)a=f_{\boldsymbol\theta}(\boldsymbol\varepsilon;s) computes exactly this. As α→0\alpha\to0 and the policy becomes deterministic, only −∇aQ ∇θf-\nabla_aQ\,\nabla_{\boldsymbol\theta}f survives: the deterministic policy gradient of DDPG and TD3, which SAC contains as a limit.

The temperature as a dual variable. Haarnoja et al. (2018b) replace the fixed α\alpha by a constraint: maximize the expected return subject to an average entropy of at least Hˉ\bar{\mathcal H} at every step. Over a finite horizon, solving backward in time gives a dual variable per step, the temperature, and strong duality holds because the objective is linear and the entropy concave in the policy. In practice SAC keeps one α\alpha and takes one gradient step on J(α)=Ea∼π[−αlog⁡π(a∣s)−αHˉ]J(\alpha)=\E_{a\sim\pi}\big[-\alpha\log\pi(a\mid s)-\alpha\bar{\mathcal H}\big] per update, with Hˉ=−dim⁡A\bar{\mathcal H}=-\dim\mathcal A by default. This truncated dual gradient descent has guarantees only under convexity, which neural networks do not provide; the authors found it works in practice.

The family. Soft Q-learning (Haarnoja, Tang, Abbeel & Levine, 2017), SAC's predecessor, learned the soft Q-function directly and sampled from the energy-based policy π∝eQ/α\pi\propto e^{Q/\alpha} with a separate network trained by amortized Stein variational gradient descent; SAC's projection onto a tractable Gaussian replaced that sampler. Schulman, Chen and Abbeel (2017) showed that soft Q-learning is exactly equivalent to an entropy-regularized policy gradient method. And for deterministic transitions, the soft optimal values satisfy a consistency along any action sequence, V⋆(st)−γV⋆(st+1)=r(st,at)−αlog⁡π⋆(at∣st)V^\star(s_t)-\gamma V^\star(s_{t+1})=r(s_t,a_t)-\alpha\log\pi^\star(a_t\mid s_t), which path consistency learning (Nachum, Norouzi, Xu & Schuurmans, 2017) turns into one loss for the policy and values, usable on- and off-policy.

What entropy buys, and what it costs

Maximum-entropy policies are often reported to be robust: SAC's quadruped, trained on flat ground, walked over obstacles it had never seen. In one step the reason can be proved in a few lines. Write Jα(π)=Eπ[r]+αH(π)J_\alpha(\pi)=\E_\pi[r]+\alpha\mathcal H(\pi) for a single decision with rewards r(a)r(a), and let an adversary replace rr by any r~\tilde r in the set Rε={r~: αlog⁡∑ae(r(a)−r~(a))/α≤ε}\mathcal R_\varepsilon=\big\{\tilde r:\ \alpha\log\sum_ae^{(r(a)-\tilde r(a))/\alpha}\le\varepsilon\big\}. Since a log-sum-exp is at least its largest term, the adversary may lower each action's reward by at most ε\varepsilon, and by less when it lowers many at once.

DerivationMaximum entropy is exactly robust in one step
  1. log⁡∑ae(r(a)−r~(a))/α=log⁡Ea∼π[e(r(a)−r~(a))/α−log⁡π(a)] ≥ Eπ[r]−Eπ[r~]α+H(π)\log\sum_ae^{(r(a)-\tilde r(a))/\alpha}=\log\E_{a\sim\pi}\Big[e^{(r(a)-\tilde r(a))/\alpha-\log\pi(a)}\Big]\ \ge\ \frac{\E_\pi[r]-\E_\pi[\tilde r]}{\alpha}+\mathcal H(\pi)

    For any full-support π\pi and any r~\tilde r, write the log-sum-exp as an expectation under π\pi and apply Jensen's inequality to the concave logarithm:

  2. min⁡r~∈RεEa∼π[r~(a)]=Jα(π)−ε\min_{\tilde r\in\mathcal R_\varepsilon}\E_{a\sim\pi}\big[\tilde r(a)\big]=J_\alpha(\pi)-\varepsilon

    Rearranged: every reward in Rε\mathcal R_\varepsilon gives the policy at least its entropy-regularized value, minus the budget. Equality holds for r~=r−αlog⁡π−ε\tilde r=r-\alpha\log\pi-\varepsilon, which is in the set:

  3. The set does not depend on π\pi, so the policy maximizing JαJ_\alpha also maximizes the worst-case reward over Rε\mathcal R_\varepsilon. The worst case lowers the reward most on the actions the policy relies on, by ε+αlog⁡π(a)\varepsilon+\alpha\log\pi(a), which is close to ε\varepsilon for likely actions; spreading probability out is what limits the damage.

Eysenbach and Levine (2022) proved sequential versions. The maximum-entropy objective of a full-support policy equals its worst-case return over a set of adversarially chosen reward functions, a set that now depends on the policy; and, for positive rewards, a related theorem bounds the worst case over a set of perturbed dynamics from below by a maximum-entropy objective with a transformed reward. They are careful to add that this does not make maximum-entropy RL the best robust RL method, only a simple one with guarantees.

That gap is the cost. The entropy-regularized optimum gives up at most αlog⁡∣A∣/(1−γ)\alpha\log\abs{\mathcal A}/(1-\gamma) of plain return (Global Convergence of Policy Gradients); here log⁡3≈1.10\log3\approx1.10 bounds the actual 0.1970.197 at α=1\alpha=1. For continuous actions the bound is vacuous (a deterministic policy has differential entropy −∞-\infty). Choosing α\alpha is also delicate, because its effect depends on the scale of the rewards, which differs across tasks and changes as the policy improves; that is why SAC's second version targets an average entropy instead of fixing a temperature. And entropy is undirected: it spreads probability over actions now, not toward states the agent knows little about, so it does not solve deep exploration, a point the next lesson's critique of control as inference sharpens.

Key takeaways

  • By the Gibbs variational principle, max⁡p{Ep[q]+αH(p)}=αlog⁡∑aeq(a)/α\max_p\{\E_p[q]+\alpha\mathcal H(p)\}=\alpha\log\sum_ae^{q(a)/\alpha}, attained at p∝eq/αp\propto e^{q/\alpha}: soft Bellman equations replace the max by a log-sum-exp, and the optimal policy is Boltzmann in the soft action values.
  • Soft policy improvement projects eQπold/α/Ze^{Q^{\pi_{\text{old}}}/\alpha}/Z onto the policy class with DKL(π′ ∥ ⋅)\KL(\pi'\,\|\,\cdot) and never lowers soft values; soft policy iteration converges to the best policy in the class, and with an unrestricted class it is entropy-regularized natural policy gradient, linear at rate γ\gamma.
  • SAC approximates both steps with twin soft critics, a reparameterized squashed-Gaussian actor whose loss is the information projection, and a temperature treated as the dual variable of an entropy constraint; as α→0\alpha\to0 its actor gradient becomes the deterministic policy gradient.
  • In one step, the maximum-entropy policy is exactly the robust policy for rewards an adversary may lower within an exponential budget; over many steps the equality holds with a policy-dependent set of rewards, and perturbed dynamics get a lower bound (Eysenbach & Levine, 2022).
  • The price is bias, at most αlog⁡∣A∣/(1−γ)\alpha\log\abs{\mathcal A}/(1-\gamma) for finite actions, and entropy is undirected: it does not solve deep exploration.

Check yourself

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

Question 1

How does the soft optimal value V⋆(s)=αlog⁡∑aeQ⋆(s,a)/αV^\star(s)=\alpha\log\sum_ae^{Q^\star(s,a)/\alpha} compare with max⁡aQ⋆(s,a)\max_aQ^\star(s,a)?

  1. V⋆(s)≤max⁡aQ⋆(s,a)V^\star(s)\le\max_aQ^\star(s,a), because entropy is a penalty
  2. They are always equal
  3. max⁡aQ⋆(s,a)≤V⋆(s)≤max⁡aQ⋆(s,a)+αlog⁡∣A∣\max_aQ^\star(s,a)\le V^\star(s)\le\max_aQ^\star(s,a)+\alpha\log\abs{\mathcal A}
  4. V⋆(s)V^\star(s) is the average of the Q⋆(s,a)Q^\star(s,a)
Show the answer

C. max⁡aQ⋆(s,a)≤V⋆(s)≤max⁡aQ⋆(s,a)+αlog⁡∣A∣\max_aQ^\star(s,a)\le V^\star(s)\le\max_aQ^\star(s,a)+\alpha\log\abs{\mathcal A}

The sum contains the largest term, giving the lower bound, and at most ∣A∣\abs{\mathcal A} copies of it, giving the upper bound. The gap is the entropy the soft-optimal policy collects in that state, at most αlog⁡∣A∣\alpha\log\abs{\mathcal A}.

Question 2

The information projection onto a Gaussian class is usually not the Boltzmann policy itself. Why does soft policy improvement still never lower the soft values?

  1. Because Gaussian policies are always optimal for continuous actions
  2. Because the projection error is always zero for a large enough network
  3. Because the entropy bonus compensates exactly for any projection error
  4. Because the old policy belongs to the class, so the projected policy scores at least as well in the KL objective, which is exactly the one-step improvement inequality; unrolling the soft Bellman equation extends it to all steps
Show the answer

D. Because the old policy belongs to the class, so the projected policy scores at least as well in the KL objective, which is exactly the one-step improvement inequality; unrolling the soft Bellman equation extends it to all steps

The proof never compares the new policy with the Boltzmann policy, only with the old policy, which was a feasible choice. That gives Eπnew[Qπold−αlog⁡πnew]≥Vπold\E_{\pi_{\text{new}}}[Q^{\pi_{\text{old}}}-\alpha\log\pi_{\text{new}}]\ge V^{\pi_{\text{old}}} in every state, and the rest is the usual policy-improvement argument.

Question 3

With an unrestricted policy class, soft policy iteration updates πt+1∝exp⁡(Qπt/α)\pi_{t+1}\propto\exp\big(Q^{\pi_t}/\alpha\big). What is it?

  1. Entropy-regularized natural policy gradient with step size η=(1−γ)/α\eta=(1-\gamma)/\alpha, which converges linearly at rate γ\gamma
  2. Ordinary policy iteration, since the exponential concentrates on the greedy action
  3. Plain softmax policy gradient with step size α\alpha
  4. Value iteration on the hard Bellman equation
Show the answer

A. Entropy-regularized natural policy gradient with step size η=(1−γ)/α\eta=(1-\gamma)/\alpha, which converges linearly at rate γ\gamma

Entropy-regularized NPG updates πt+1∝πt1−ηα/(1−γ)exp⁡(ηQπt/(1−γ))\pi_{t+1}\propto\pi_t^{1-\eta\alpha/(1-\gamma)}\exp\big(\eta Q^{\pi_t}/(1-\gamma)\big); at η=(1−γ)/α\eta=(1-\gamma)/\alpha the old policy's exponent vanishes, leaving soft policy iteration. Cen et al. (2022) prove the linear rate γ\gamma.

Question 4

In the one-step robustness argument, which reward does the worst-case adversary choose from Rε\mathcal R_\varepsilon?

  1. It lowers every action's reward by exactly ε\varepsilon
  2. r~=r−αlog⁡π−ε\tilde r=r-\alpha\log\pi-\varepsilon, lowering the reward most on the actions the policy relies on, so a policy that spreads its probability loses less
  3. It lowers only the reward of the least likely action
  4. It leaves the reward unchanged, since the set is centered at rr
Show the answer

B. r~=r−αlog⁡π−ε\tilde r=r-\alpha\log\pi-\varepsilon, lowering the reward most on the actions the policy relies on, so a policy that spreads its probability loses less

Equality in Jensen's inequality needs r−r~−αlog⁡πr-\tilde r-\alpha\log\pi constant across actions, which with the budget gives r~=r−αlog⁡π−ε\tilde r=r-\alpha\log\pi-\varepsilon. The policy then earns exactly Jα(π)−εJ_\alpha(\pi)-\varepsilon: its entropy-regularized value is its guaranteed worst-case return, up to the constant budget.

Further reading

  • T. Haarnoja, A. Zhou, P. Abbeel & S. Levine, "Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor," ICML (2018).
  • T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Kumar, H. Zhu, A. Gupta, P. Abbeel & S. Levine, "Soft actor-critic algorithms and applications," arXiv:1812.05905 (2018).
  • T. Haarnoja, H. Tang, P. Abbeel & S. Levine, "Reinforcement learning with deep energy-based policies," ICML (2017).
  • B. Eysenbach & S. Levine, "Maximum entropy RL (provably) solves some robust RL problems," ICLR (2022).
  • J. Schulman, X. Chen & P. Abbeel, "Equivalence between policy gradients and soft Q-learning," arXiv:1704.06440 (2017).