Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor

Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, Sergey Levine

2018 · ICML

Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor

Problem

Framing

Deep RL in continuous control faced a bad tradeoff: on-policy methods were stable but sample-inefficient, while off-policy actor-critics were brittle. SAC closes it by optimizing a maximum-entropy objective with an off-policy stochastic actor and clipped double-Q updates, yielding stable gains on Hopper, Walker2d, HalfCheetah, Ant, and Humanoid.

Currently Used Methods

Foundational

Proposed Method

Architecture

SAC uses a stochastic Gaussian policy, two soft Q-functions, one soft value network, and a target value network. The policy samples an unconstrained Gaussian action and squashes it with tanh\tanh to satisfy action bounds.

at=tanh(μϕ(st)+σϕ(st)ϵt),ϵtN(0,I)\mathbf{a}_t = \tanh\left(\boldsymbol{\mu}_\phi(\mathbf{s}_t) + \boldsymbol{\sigma}_\phi(\mathbf{s}_t) \odot \boldsymbol{\epsilon}_t\right), \quad \boldsymbol{\epsilon}_t \sim \mathcal{N}(\mathbf{0}, \mathbf{I})

Loss / Objective

SAC maximizes reward plus entropy under the discounted occupancy measure.

J(π)=t=0TE(st,at)ρπ[r(st,at)+αH(π(st))]J(\pi) = \sum_{t=0}^{T} \mathbb{E}_{(\mathbf{s}_t,\mathbf{a}_t) \sim \rho_\pi}\left[r(\mathbf{s}_t,\mathbf{a}_t) + \alpha \, \mathcal{H}\big(\pi(\cdot \mid \mathbf{s}_t)\big)\right]

The practical critic, value, and actor losses are:

JQ(θ)=E(st,at)D[12(Qθ(st,at)Q^(st,at))2]J_Q(\boldsymbol{\theta}) = \mathbb{E}_{(\mathbf{s}_t,\mathbf{a}_t) \sim \mathcal{D}} \left[\frac{1}{2}\left(Q_{\boldsymbol{\theta}}(\mathbf{s}_t,\mathbf{a}_t) - \hat{Q}(\mathbf{s}_t,\mathbf{a}_t)\right)^2\right] Q^(st,at)=r(st,at)+γVψˉ(st+1)\hat{Q}(\mathbf{s}_t,\mathbf{a}_t) = r(\mathbf{s}_t,\mathbf{a}_t) + \gamma \, V_{\bar{\boldsymbol{\psi}}}(\mathbf{s}_{t+1}) JV(ψ)=EstD[12(Vψ(st)Eatπϕ[minj=1,2Qθj(st,at)logπϕ(atst)])2]J_V(\boldsymbol{\psi}) = \mathbb{E}_{\mathbf{s}_t \sim \mathcal{D}}\left[\frac{1}{2}\left(V_{\boldsymbol{\psi}}(\mathbf{s}_t) - \mathbb{E}_{\mathbf{a}_t \sim \pi_\phi}\left[\min_{j=1,2} Q_{\boldsymbol{\theta}_j}(\mathbf{s}_t,\mathbf{a}_t) - \log \pi_\phi(\mathbf{a}_t \mid \mathbf{s}_t)\right]\right)^2\right] Jπ(ϕ)=EstD,ϵtN[logπϕ(fϕ(ϵt;st)st)minj=1,2Qθj(st,fϕ(ϵt;st))]J_\pi(\boldsymbol{\phi}) = \mathbb{E}_{\mathbf{s}_t \sim \mathcal{D}, \, \boldsymbol{\epsilon}_t \sim \mathcal{N}}\left[\log \pi_\phi\big(f_\phi(\boldsymbol{\epsilon}_t;\mathbf{s}_t) \mid \mathbf{s}_t\big) - \min_{j=1,2} Q_{\boldsymbol{\theta}_j}\big(\mathbf{s}_t, f_\phi(\boldsymbol{\epsilon}_t;\mathbf{s}_t)\big)\right]

Sampling Rule / Algorithm

Training alternates soft policy evaluation, reparameterized actor updates, and Polyak target updates.

ψˉτψ+(1τ)ψˉ\bar{\boldsymbol{\psi}} \leftarrow \tau \, \boldsymbol{\psi} + (1-\tau) \, \bar{\boldsymbol{\psi}}

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Training curves across six continuous-control benchmarks; SAC is the orange curve and leads on the hardest tasks.

Ablations

Table 1: Sensitivity of SAC on Ant-v1 to evaluation mode, reward scale, and target smoothing coefficient.

SettingObservation
Deterministic vs stochastic evaluationDeterministic evaluation finishes higher.
Reward scale {1,3,10,30,100}\{1, 3, 10, 30, 100\}Mid-range scales perform best; scale 1 underperforms.
Target smoothing coefficient τ{0.0001,0.001,0.01,0.1}\tau \in \{0.0001, 0.001, 0.01, 0.1\}0.0010.001 and 0.010.01 work well; 0.10.1 collapses.

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers