---
title: "Advantage Actor Critic (A2C)"
description: "Actor-Critic methods reduce the high variance of Monte-Carlo policy-gradient estimates in Reinforce by pairing a policy network (Actor) with a value network (Critic) that scores the actions taken."
url: "https://swe.quest/articles/advantage-actor-critic-a2c-5b4f17254e3ab304"
canonical: "https://huggingface.co/blog/deep-rl-a2c"
source: "Hugging Face"
published: "2022-07-22"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 7
tags: ["machine-learning","model-training","algorithms"]
---

# Advantage Actor Critic (A2C)

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2022-07-22, 7 min read, Deep dive. Original: [https://huggingface.co/blog/deep-rl-a2c](https://huggingface.co/blog/deep-rl-a2c)

## Summary

Actor-Critic methods reduce the high variance of Monte-Carlo policy-gradient estimates in Reinforce by pairing a policy network (Actor) with a value network (Critic) that scores the actions taken. A2C stabilizes training further by using the advantage function, which measures how much better an action is than the state's average value. The TD error serves as a practical estimator, so separate Q and V networks aren't needed. The unit closes with a Colab exercise training bipedal and spider walkers in PyBullet with Stable-Baselines3.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)

## Prerequisites

- policy gradient methods
- Reinforce algorithm ([easy posts on Algorithms](https://swe.quest/tags/algorithms.md?difficulty=easy))
- value functions and Q-values
- TD learning

## Keywords

A2C, Actor-Critic, Reinforce, Stable-Baselines3, PyBullet, Hugging Face Deep RL Course

## Related posts

- [Policy Gradient with PyTorch](https://swe.quest/articles/policy-gradient-with-pytorch-8cc397d15e17e5f8.md): Hugging Face · 2022-06-30 · Easy · 7 min read · Machine learning, Model training, Python
  Policy-gradient methods optimize a stochastic policy directly via gradient ascent on expected return, instead of deriving a policy from learned Q-values as in Deep Q-Learning.
- [An Introduction to Deep Reinforcement Learning](https://swe.quest/articles/an-introduction-to-deep-reinforcement-learning-d17541fa32bf28e1.md): Hugging Face · 2022-05-04 · Easy · 16 min read · Machine learning, Model training
  Deep reinforcement learning trains an agent to act in an environment through trial and error, using rewards as its only feedback, with the goal of maximizing expected cumulative (discounted) return.
- [Thinking of ACE? We Can Do It with Fewer Tokens](https://swe.quest/articles/thinking-of-ace-we-can-do-it-with-fewer-tokens-2dc38e3991553657.md): Hugging Face · 2026-08-11 · Hard · 8 min read · AI agents, LLMs, Evaluation, Cost optimization
  ALTK-Evolve and ACE both turn an LLM agent's past trajectories into reusable lessons without weight updates.
- [Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox](https://swe.quest/articles/turning-database-grading-into-rl-rewards-post-training-agents-with-thinkingbox-9126975f97c5fba4.md): Hugging Face · 2026-10-22 · Hard · 18 min read · Model training, AI agents, Evaluation, LLMs
  Executable checks on terminal database state, originally built to grade agents in ThinkingBox-Bench, double as binary RL rewards for post-training tool-using agents.
- [An Introduction to Q-Learning Part 1](https://swe.quest/articles/an-introduction-to-q-learning-part-1-02c8621463858d6d.md): Hugging Face · 2022-05-18 · Medium · 13 min read · Machine learning, Model training, Algorithms
  Value-based reinforcement learning methods learn a state-value or action-value function and derive the policy from it, typically a greedy or epsilon-greedy policy, rather than training the policy directly.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
