18
$\begingroup$

I'm struggling to understand the difference between actor-critic and advantage actor-critic.

At least, I know they are different from asynchronous advantage actor-critic (A3C), as A3C adds an asynchronous mechanism that uses multiple worker agents interacting with their own copy of the environment and reports the gradient to the global agent.

But what is the difference between the actor-critic and advantage actor-critic (A2C)? Is it simply with or without advantage function? But, then, does the actor-critic have any other implementation except for the use of advantage function?

Or maybe are they synonyms and actor-critic is just a shorthand for A2C?

$\endgroup$
0

4 Answers 4

18
$\begingroup$

Actor-Critic is not just a single algorithm, it should be viewed as a "family" of related techniques. They're all techniques based on the policy gradient theorem, which train some form of critic that computes some form of value estimate to plug into the update rule as a lower-variance replacement for the returns at the end of an episode. They all perform "bootstrapping" by using some sort of prediction of value.

Advantage Actor-Critic specifically uses estimates of the advantage function $A(s, a) = Q(s, a) - V(s)$ for its bootstrapping, whereas "actor-critic" without the "advantage" qualifier is not specific; it could be a trained $V(s)$ function, it could be some sort of estimate of $Q(s, a)$, it could be a variety of things.

In practice, the critic of Advantage Actor-Critic methods actually can just be trained to predict $V(s)$. Combined with an empirically observed reward $r$, they can then compute the advantage estimate $A(s, a) = r + \gamma V(s') - V(s)$.

$\endgroup$
6
  • 1
    $\begingroup$ Nice clarification. Do you know an example of an actor-critic method that is not advantage actor-critic? Also, would it be fair to say that PPO is a type of advantage actor-critic method? $\endgroup$
    – Mei Zhang
    Feb 18, 2019 at 10:06
  • 1
    $\begingroup$ @MeiZhang Some options are listed here, but I don't think they have clear names really. Advantages are certainly the most commonly-used. Sure, PPO could be viewed as an advantage actor-critic method. $\endgroup$
    – Dennis Soemers
    Feb 18, 2019 at 10:35
  • $\begingroup$ Can advantage actor critic use the loss gradient $$-\sum_t \left( Q_\phi(s_t, a_t) - \sum_a \pi_\theta(s_t, a) Q_\phi(s_t, a) \right) \nabla_\theta \log \pi_\theta(s_t, a_t) + \nabla_\phi \frac{1}{T} \sum_t (R_t - Q_\phi(s_t, a_t))^2$$ (where $R_t$ are the discounted returns), as described in the Mean Actor Critic paper? It's not doing well in my implementation, for some reason. I can post a separate question if you'd like. $\endgroup$
    – user76284
    Oct 12, 2020 at 22:17
  • $\begingroup$ @user76284 I didn't carefully inspect the equation you wrote there, but I'm familiar with the paper and yes, I see no reason why that wouldn't work. I've used something with similar intuition (summing up over all the actions, multiplying predicted values with policy's probabilities) in arxiv.org/abs/1905.05809. That was a very different setting though, games instead of single-agent RL, with value estimates produced by MCTS instead of a network. That seemed to work fine though. $\endgroup$
    – Dennis Soemers
    Oct 13, 2020 at 9:30
  • $\begingroup$ @DennisSoemers I posted a question about this here. $\endgroup$
    – user76284
    Oct 14, 2020 at 20:02
2
$\begingroup$

According to Sutton and Barto, they are the same thing. Note 13.5-6 (page 338) of their Reinforcement Learning: An Introduction, 2nd Edition book:

Actor-critic methods are sometimes referred to as advantage actor-critic methods in the literature

$\endgroup$
0
$\begingroup$

Though the word "Advantage" in the actor-critic realm has been used to refer to the difference between the state value and the state action value, A2C brings in the ideas of A3C. In A3C, several worker networks interact with different copies of the environment (asynchronous learning) and update a master network after a set if steps. This was meant to solve instability issues associated with both temporal difference update method and correlations within neural network generated prediction and target values. However it was noticed by OpenAI that there was no need of the asynchrony, i.e. there was no practical benefit of having different worker networks. Instead, they had the same copy of the network that interacted with different copies of the environment (one works from the beginning, another working backwards from the end) and they update at once without the master lagging behind like in A3C. The removal of asynchrony gave rise to A2C.

$\endgroup$
0
$\begingroup$

So, this is the formula for updating the weights $\theta$ of your policy network using the policy gradient theorem: $$ \nabla_\theta J(\theta) = E_{a, s \sim \pi_\theta} \Big[ \nabla \log \pi_\theta(a|s) R(s, a) \Big]. $$ Obviously your policy network is the actor. The question is how do you evaluate $R$.
You could do a simple Monte-Carlo estimate: $$ R(s_t, a_t) = \sum_{i=t}^{T} r_{i+1} $$ This is not an actor-critic algorithm.
Or, you could do for example a one-step bootstrap using a value network with weights $\phi$: $$ R(s_t, a_t) = r_{t+1} + V_\phi(s_{t+1}) $$ This is an actor-critic algorithm. In this case the value network is the critic. It essentially assigns a score on each of the actions taken by the actor.
Or, you could learn a q-value network with weights $\psi$ and use that: $$ R(s_t, a_t) = Q_\psi(s_t, a_t) $$ This is again an actor-critic algorithm and your q-value network is the critic. Same reasoning as above.
So, actor-critic algorithms are a set of algorithms where you have an actor (the policy network) that selects actions for the rollout and a critic (a second model), that is used to compute the returns.
But instead of using the return, you could estimate the policy gradient using the advantage: $$ \nabla_\theta J(\theta) = E_{a, s \sim \pi_\theta} \Big[ \nabla \log \pi_\theta(a|s) A(s, a) \Big], $$ where $A(s,a) = R(s,a) - V_\phi(s)$. Usually you will have a value network for estimating the value of the state.
Now, for the Monte-Carlo estimate $A(s_t, a_t) = \sum_{i=t}^{T} r_{i+1} - V_\phi(s_t)$ you get what is known as "policy gradient with baseline" - not an actor-critic algorithm. In the other two cases:

  • one-step bootstrap $A(s_t, a_t) = r_{t+1} + V_\phi(s_{t+1}) - V_\phi(s_{t})$,
  • q-value network $A(s_t, a_t) = Q_\psi(s_t, a_t) - V_\phi(s_t)$,

you get an Advantage Actor-Critic algorithm.
You could also use a neural network that models the advantage directly: $ A(s_t, a_t) = A_\zeta(s_t, a_t)$. Obviously, you also get an advantage actor-critic algorithm.
So, advantage actor-critic algorithms are a set of algorithms where again you have an actor and a critic, but now you estimate the gradient using the advantage instead of the return.

I recommend reading this blog post.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .