All models

sac_twin_q

SAC's twin soft Q-function critic: two MLPs over state and action whose minimum mitigates positive bias.

Reinforcement learning and control · 13 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (18 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
146.9K
Operations
13
Framework
PyTorch
Recurrent
No
Published
2018
Cited by
13,752 (as of 22 November 2026)
Authors
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, Sergey Levine
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m9004
Graph hash
d5f8d722a37eefafc1a20f3b30574c5db440faf956196369dc8aa4c9b6130a96
Skeleton hash
d95d8b435f540096baab15e72394742051172b4204043a7e52b085fe758745a7
Architecture hash
b0d3cf8b13373f01865c6142e89ad689a6888db5420347900e4c77af92d17fa6
Diagram SHA-256
2396fe1bf8876e420835dd558210c469cc09ba6be4f413dbe16664efeb14bef2
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This family is the critic of soft actor-critic (SAC), an off-policy actor-critic deep RL algorithm based on the maximum entropy reinforcement learning framework, in which the actor aims to maximize expected reward while also maximizing entropy. SAC matters because combining off-policy updates with a stable stochastic actor-critic formulation achieves state-of-the-art performance on a range of continuous control benchmark tasks, and the approach is very stable, achieving very similar performance across different random seeds.

The critic is a soft Q-function trained to minimize the soft Bellman residual, with a target built from a target value network whose weights can be an exponentially moving average of the value network weights. SAC parameterizes two Q-functions, trains them independently, and uses the minimum of the two for the value gradient and the policy gradient, in order to mitigate positive bias in the policy improvement step. Although the algorithm can learn challenging tasks, including a 21-dimensional Humanoid, with just a single Q-function, the authors found that two Q-functions significantly speed up training, especially on harder tasks.

In the paper's experiments all networks use 2 hidden layers of 256 units with ReLU nonlinearities, trained with Adam on minibatches of 256 samples from a replay buffer. Overall, SAC performs comparably to the baseline methods on the easier tasks and outperforms them on the harder tasks with a large margin, both in terms of learning speed and final performance.

The captured member follows Stable Baselines3, a set of reliable implementations of reinforcement learning algorithms in PyTorch that lists SAC among its algorithms, while the authors' own code, haarnoja/sac and its successor Softlearning, uses Tensorflow. In the paper the algorithm is agnostic to the parameterization of the policy, as long as it can be evaluated for any arbitrary state-action tuple.

Key idea. SAC's critic trains two independent soft Q-functions and takes their minimum, which the authors found significantly speeds up training, especially on harder tasks, inside what they describe as the first off-policy actor-critic method in the maximum entropy reinforcement learning framework.

  • soft actor-critic
  • sac
  • critic
  • q-function
  • soft q-function
  • twin q-functions
  • clipped double q
  • soft bellman residual
  • maximum entropy reinforcement learning
  • continuous control
  • stable-baselines3
  • softlearning

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{haarnoja2018softactorcriticoffpolicymaximum,
      title={Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor}, 
      author={Tuomas Haarnoja and Aurick Zhou and Pieter Abbeel and Sergey Levine},
      year={2018},
      eprint={1801.01290},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1801.01290}, 
}