TL;DR
Soft Actor-Critic (SAC) is an off-policy reinforcement learning method that trains a stochastic policy to earn reward while staying as random as it can. This 2018 follow-up paper makes the method practical. Its main change is that the entropy weight is no longer set by hand: it is tuned automatically to hold the policy at a target level of randomness. The authors then test the method on simulated benchmarks and on two real robots. A quadruped learns to walk in about two hours, and a three-finger hand learns to turn a valve from camera images.
Where you'll see it: in robot learning research, as a standard baseline for continuous-control tasks, and in the many later papers that build on its automatic temperature rule.
The problem
Deep reinforcement learning has two practical problems. The first is sample complexity: many algorithms need millions of environment steps. On a physical robot, each step costs time, and falls and resets wear the hardware. Methods such as PPO discard their data after each update, which makes them expensive. Off-policy methods reuse old data, but the combination of off-policy learning with neural networks and continuous actions has been unstable.
The second problem is brittleness. Learning rates, exploration noise and similar settings must be chosen carefully for each task. The earlier SAC paper showed that the maximum entropy objective depends on the reward scale, so a fixed entropy weight that works on one task can fail on another. A method that needs per-task tuning is hard to run on a robot that someone has to babysit.
Key idea
SAC has three ingredients: an actor-critic split between a policy and value estimators, off-policy learning from a replay buffer, and an entropy bonus that rewards the policy for staying random. The new piece in this paper is a constraint. Instead of fixing the entropy weight , the algorithm asks the policy to keep its average entropy above a target . The weight then becomes the price of that constraint, and it rises or falls during training to enforce it.
The constraint is on the average over visited states, not on each state separately. The policy can therefore stay broad where several actions are equally good and narrow where one action clearly wins.
flowchart LR A[Collect a transition] --> B[Replay buffer] B --> C[Update two critics] B --> D[Update the policy] D --> E[Measure entropy against target] E --> F[Adjust alpha] F --> D C --> D
The method
The objective is the maximum entropy return. For a policy over states and actions , it maximises
where is the distribution of states and actions the policy visits, is the entropy of the policy at a state, and controls how much entropy counts against reward. As goes to zero, the objective becomes the usual one. The paper's maximum entropy framework defines the soft value
Policy evaluation. Repeated application of the soft Bellman backup converges to the soft Q-function of the policy (the first lemma of the soft policy iteration section). Under these assumptions, policy improvement is a projection of onto the policy class, measured by KL divergence (the second lemma), and iterating the two steps converges to the optimal maximum entropy policy in the tabular case (the theorem). These results are the reason the update is trusted, but neural networks have no such guarantee.
Practical updates. The approximations are concrete:
- Two soft Q-functions and are trained on the soft Bellman residual, using target networks that move slowly, . The target uses the smaller of the two estimates, which limits the overestimation that also troubles Q-Learning. The same double-critic trick appears in twin delayed DDPG (TD3), the method the paper compares against, which extends DDPG.
- The policy is a squashed Gaussian, reparameterised as with drawn from a fixed distribution. The gradient flows through using the Reparameterization Trick, which the paper prefers to the likelihood-ratio estimator because the critic is differentiable and the variance is lower.
- The appendix on action bounds gives the log-probability after the squash :
Temperature. The entropy constraint is handled by its dual. The dual variable is , and its objective is
The paper does not solve this to convergence. It takes one gradient step on per update, which approximates dual gradient descent. The authors note that the convergence argument needs convexity, which neural networks do not have, but they found the approach works in practice. The default target is , which is minus the number of action dimensions.
Algorithm. Algorithm 1 alternates between collecting a transition with the current policy and running gradient steps on the two Q-functions, the policy, and the target networks. Training uses mini-batches of 256 transitions from a replay pool. The shared hyperparameters are Adam with learning rate , discount , a replay pool of transitions, two hidden layers of 256 ReLU units for every network, and .
Results
Simulated benchmarks. The authors compare SAC with DDPG, PPO, soft Q-learning and TD3 on OpenAI Gym continuous-control tasks and on the 21-dimensional Humanoid from rllab. Each algorithm is run with five random seeds, and the curves show the mean and the minimum-maximum band. On easier tasks SAC is comparable to the baselines. On the hardest tasks it leads by a wide margin in both speed and final return. DDPG makes no progress on Ant-v1, Humanoid-v1 and Humanoid (rllab). The automatic temperature version works well across all the environments, which the authors read as removing the need to tune the temperature by hand.
Quadruped on real terrain. The Minitaur robot has eight direct-drive motors. Its actions are a swing angle and an extension for each leg, mapped to motor positions and tracked by a PD controller. Observations include motor angles, roll, pitch and angular velocities. Yaw is left out because it drifts. Latency and contact make the dynamics non-Markovian, so the state stacks the current and past five observations and actions. The policy learns to walk from about 160k environment steps, roughly 400 episodes of up to 500 steps, which is about two hours of real time. It is trained only on flat ground. Without further training it walks up a slope, pushes through a wooden-block obstacle and steps down stairs.
Dexterous hand from pixels. A three-finger hand with nine degrees of freedom rotates a valve to a target angle. The valve starts at a random angle, and the policy must infer its angle from 32 by 32 RGB camera images, alongside the finger joint positions and velocities. Learning from images takes 300k steps, about 20 hours including resets. When the valve position is given directly, learning takes about 3 hours. The authors report that PPO took 7.4 hours on the same state-based task in prior work.
These are the authors' own experiments on one robot setup each. The paper gives no independent replication, and the real-robot results come from one hardware configuration.
Why it mattered
The paper turned SAC from a promising result into a method people could run without tuning. The automatic temperature rule is the form most later SAC implementations use, and the paper's real-robot runs showed that a learned policy can handle conditions it was never trained on. The entropy bonus gave the policy enough spread to recover from disturbances, which the authors cite as the reason the quadruped generalised. The paper also set SAC as a reference point for later continuous-control work, where it is compared against PPO and TD3.
Reading guide
Read in this order. Each entry names the prerequisite lessons a part depends on.
- Introduction. Sample complexity and brittleness. Needs Reinforcement Learning and Markov Decision Process.
- Related work. Why on-policy and off-policy methods trade off. Needs Actor-Critic Methods, Policy Gradient and Q-Learning.
- Preliminaries. The maximum entropy objective and the soft value. Needs Maximum Entropy Reinforcement Learning and Entropy.
- Soft policy iteration. The soft Bellman backup and the KL projection. Needs Bellman Equation, Value Function and Kullback–Leibler Divergence.
- Soft actor-critic. The critic loss, the reparameterised actor update. Needs Reparameterization Trick and Gaussian (Normal) Distribution, and the concept lesson Soft Actor-Critic.
- Entropy adjustment (the temperature). The entropy constraint and its dual. Needs the dual idea from optimisation, which the paper sets out itself.
- Practical algorithm and Algorithm 1. Replay pool, target networks and the twin critics. Needs Experience Replay and Deep Q-Network.
- Experiments. The baselines. Needs Deep Deterministic Policy Gradient (DDPG) and Proximal Policy Optimization (PPO).
- Appendix on action bounds. The tanh correction to the log-probability. Needs the change-of-variables formula, which the paper states in full.
Check yourself
QuestionRecall: what does the automatic temperature rule control, and what target does it aim for?Show answer
It sets the weight on the entropy bonus so that the policy's entropy stays near a target . The paper's default target is minus the number of action dimensions. When the policy is too random, falls, and when it is too narrow, rises.
QuestionComputation: the paper's target for a robot with 4 action dimensions. What is , and is a policy with average too random or too narrow?Show answer
The target is . The measured entropy is , which is above the target of , so the policy is more random than required. The gradient is positive, so a gradient step lowers and the policy is allowed to narrow.
QuestionWhy does the paper use the reparameterised action rather than the likelihood-ratio gradient for the policy?Show answer
The target density is the Q-function, which is a differentiable neural network. Writing the action as a smooth function of the parameters and a fixed noise sample lets the gradient pass through the action into the policy directly. The estimator has lower variance than the likelihood-ratio form, which does not use the differentiability.
QuestionApplied: a team wants to run SAC on a robot with a 300k-step budget. The paper's hand task needed that many steps from pixels. What would you check first, and why does the paper's state-based result matter?Show answer
Check the observation design first, because learning from pixels is the costly case. The state-based run needed about 3 hours, far less than the pixel run's 20 hours, so giving the policy the object's state where possible is the cheaper route when the sensor allows it. The paper's gap between the two results is the evidence for that choice.