← Back to Reinforcement Learning Mind Map
🎮 Reinforcement LearningID: actor-critic

Actor-Critic

Actor-Critic 框架
🎯Core Definition
Actor-Critic combines an Actor (policy network πθ(a∣s)\pi_\theta(a|s) generating actions) and a Critic (value network Vw(s)V_w(s) evaluating states): the Actor updates along the policy-gradient direction, and the Critic supplies a value baseline and advantage estimates to reduce variance. Core formulas:
📌Overview
∇θJ=Es,a[∇θlog⁡πθ(a∣s)Aπ(s,a)],A(s,a)=Qπ(s,a)−Vπ(s)\nabla_\theta J = \mathbb{E}_{s,a}\left[\nabla_\theta \log \pi_\theta(a|s) A^{\pi}(s,a)\right],\quad A(s,a) = Q^{\pi}(s,a) - V^{\pi}(s) \nDerivation: 1. Start from the policy gradient theorem and substitute Qπ(s,a)=r+γVπ(s′)Q^{\pi}(s,a) = r + \gamma V^{\pi}(s') into the advantage: ∇θJ=E[∇θlog⁡πθ(a∣s)(r+γVw(s′)−Vw(s))⏟δTD]\nabla_\theta J = \mathbb{E}[\nabla_\theta \log \pi_\theta(a|s)\underbrace{(r + \gamma V_w(s') - V_w(s))}_{\delta_{TD}}] — a one-step bootstrapped TD error serves as the advantage estimate; 2. The Critic fits the value by least squares: L(w)=E[(r+γVw(s′)−Vw(s))2]L(w) = \mathbb{E}[(r + \gamma V_w(s') - V_w(s))^2] with ∇wL=−2E[δTD∇wVw(s)]\nabla_w L = -2\mathbb{E}[\delta_{TD}\nabla_w V_w(s)] (TD(0): biased but low variance due to bootstrapping); 3. Generalize to TD(λ\lambda)/GAE: At=∑l=0∞(γλ)lδt+lA_t = \sum_{l=0}^{\infty}(\gamma\lambda)^l\delta_{t+l} with δt=rt+γV(st+1)−V(st)\delta_t = r_t + \gamma V(s_{t+1}) - V(s_t). λ=0\lambda=0 is pure TD advantage (low variance, high bias), λ=1\lambda=1 is MC advantage (high variance, low bias); GAE is the standard in PPO/RLHF; 4. The Actor updates: θ←θ+η∇θlog⁡πθ(at∣st)A^t\theta \leftarrow \theta + \eta \nabla_\theta \log \pi_\theta(a_t|s_t)\hat{A}_t. The baseline is unbiased as in policy gradients: E[∇θlog⁡π⋅V(s)]=0\mathbb{E}[\nabla_\theta \log \pi \cdot V(s)] = 0 — it only removes variance.
💡Use Cases
the shared backbone of on- and off-policy algorithms — A2C/A3C, PPO, SAC, TD3, and GRPO (which replaces the Critic with group-relative rewards) are all Actor-Critic variants.
⚡Key Problems Solved
REINFORCE uses full returns with high variance and learns no value. The Critic's V(s)V(s) baseline cancels state-dependent variance without biasing the gradient and provides credit assignment (the advantage A(s,a)A(s,a) scores each action relative to its state); Actor and Critic alternately supervise each other — the most important deep-RL framework.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Actor-Critic.
Use Cases
In production engineering, what are the primary use cases for Actor-Critic and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Define the advantage A(s,a)=Q(s,a)−V(s) and justify using it over Q or the raw reward.
2
Whiteboard: derive the Actor's TD-error update from the policy gradient theorem and prove the V(s) baseline is unbiased.
3
How is the Critic loss derived? How do TD(λ)/GAE trade off bias and variance?
4
How does Actor-Critic improve on REINFORCE? Why lower variance and online training?
5
How do A2C/A3C, PPO, SAC, GRPO reuse the Actor-Critic backbone, and what do they change?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Actor-Critic"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardDQN TrioNext Card →PPO Clipped Objective

🔗 More Reinforcement Learning Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/RL/card/actor-critic
中文速览与面试要点

Actor-Critic 框架 (Actor-Critic)

定义: Actor-Critic 由 Actor(策略网络 _ (a|s),负责产生动作)与 Critic(价值网络 V_w(s),负责评估状态)组成:策略梯度方向上更新 Actor,Critic 提供价值基线与优势估计降方差。核心公式: _ J = E_s,a [ _ _ (a|s) A^ (s,a) ], A(s,a) = Q^ (s,a) - V^ (s) 推导链: 1. 从策略梯度定理出发,用 Q^ (s,a) = r + V^ (s') 代入优势并移项,得一步 TD 误差形式: _ J = E[ _ _ (a|s) (r + V_w(s') - V_w(s))_ _TD] —— 用单步自举的 TD 误差充当优势估计; 2. Critic 以最小二乘拟合价值:L(w) = E[(r + V_w(s') - V_w(s))^2], _w L = -2 E[ _TD _w V_w(s)](TD(0):有偏低方差,因自举); 3. 推广到 TD( )/GAE:A_t = _l=0^ ( )^l _t+l, _t = r_t + V(s_t+1) - V(s_t)。 =0 即纯 TD 优势(低方差高偏差), =1 即 MC 优势(高方差低偏差),0< <1 折中;GAE 是 PPO/RLHF 的标准配置; 4. Actor 更新: + _ _ (a_t|s_t) A_t。基线无偏性同策略梯度: E[ _ V(s)] = 0,减基线不改期望只降方差。 使用场景: 在线(on-policy)与离策略算法的通用骨架——A2C/A3C、PPO、SAC、TD3、GRPO(以组内相对奖励替代 Critic)都是 Actor-Critic 的变体。 解决的问题: REINFORCE 用整段回报、方差高,且只学策略不学价值。Critic 提供 V(s) 基线,在不改变梯度期望的前提下抵消与状态相关的高方差分量,并给出信用分配(评估每一步动作的相对优劣 A(s,a));Actor 与 Critic 交替更新、互为监督信号,是深度 RL 最重要的框架。

核心要点

  • 写出优势函数 A(s,a)=Q(s,a)−V(s),说明为何用优势而非 Q 或奖励本身更新策略?
  • 白板手推: 从策略梯度定理推导 Actor 的 TD 误差更新方向,并证明价值基线 V(s) 无偏?
  • Critic 的损失 L=E[(r+γV(s')−V(s))²] 如何得到?TD(λ)/GAE 如何折中偏差与方差?
  • Actor-Critic 相比 REINFORCE 改进在哪?方差为何更低、可在线训练?
  • A2C/A3C、PPO、SAC、GRPO 如何复用 Actor-Critic 骨架?各做了哪些改动?