Answers.Body: <p><strong>Note:</strong> you mentioned in the comments that you are reading the old, pre-print version of the paper describing AlphaZero on arXiv. My answer will be for the "official", peer-reviewed, more recent publication in Science (which nbro linked to in his comment). I'm not only focusing on the official version of the paper just because it is official, but also because I found it to be much better / more complete, and I would recommend reading it instead of the preprint if you are able to (I understand it's behind a paywall so it may be difficult for some to get access). The answer to this specific question would probably be identical for the arXiv version anyway.</p>
  
  <hr>
  
  <p><strong>No, AlphaZero does not use <span class="math-container">$Q$</span>-learning</strong>.</p>
  
  <p>The neural network in AlphaZero is trained to minimise the following loss function:</p>
  
  <p><span class="math-container">$$(z - \nu)^2 - \pi^{\top} \log \mathbf{p} + c \| \theta \|^2,$$</span></p>
  
  <p>where:</p>
  
  <ul>
  <li><span class="math-container">$z \in \{-1, 0, +1\}$</span> is the real outcome observed in a game of self-play.</li>
  <li><span class="math-container">$\nu$</span> is a predicted outcome / value.</li>
  <li><span class="math-container">$\pi$</span> is a distribution over actions derived from the visit counts of MCTS.</li>
  <li><span class="math-container">$\mathbf{p}$</span> is the distribution over actions output by the network / the policy.</li>
  <li><span class="math-container">$c \| \theta \|^2$</span> is a regularisation term, not really interesting for this question/answer.</li>
  </ul>
  
  <p>In this loss function, the term <span class="math-container">$(z - \nu)^2$</span> is exactly what we would have if we were performing plain Monte-Carlo updates, based on Monte-Carlo returns, in a traditional Reinforcemet Learning setting (with function approximation). Note that there is no "bootstrapping", no combination of a single-step observed reward plus predicted future rewards, as we would have in <span class="math-container">$Q$</span>-learning. We play out all the way until the end of a game (an "episode"), and use the final outcome <span class="math-container">$z$</span> for our updates to our value function. That's what makes this Monte-Carlo learning, rather than <span class="math-container">$Q$</span>-learning.</p>
  
  <p>As for the <span class="math-container">$- \pi^{\top} \log \mathbf{p}$</span> term, this is definitely not <span class="math-container">$Q$</span>-learning (we're directly learning a policy in this part, not a value function).</p>
  
  <blockquote>
    <p>If it's a Supervised Learning, then why is it said that AZ uses Reinforcement Learning? Is "reinforcement" part primarily a result of using Monte-Carlo Tree Search?</p>
  </blockquote>
  
  <p>The policy learning looks very similar to Supervised Learning; indeed it's the cross-entropy loss which is frequently used in Supervised Learning (classification) settings. <strong>I'd still argue it is Reinforcement Learning, because the update targets are completely determined by self-play, by the agent's own experience. There are no training targets / labels that are provided externally</strong> (i.e. no learning from a database of human expert games, as was done in 2016 in AlphaGo).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-08T22:09:15.047Z
Answers.Text: Dennis, can I ask about the convention of using || around the theta?
Answers.UserDisplayName: DukeZhou
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-09T09:29:02.960Z
Answers.Text: @DukeZhou Sure. The two bars on each side of the vector basically denotes that we take the $\ell_2$-norm, or Euclidean norm, of the vector: $\sqrt{\theta_0^2 + \theta_1^2 + \dots + \theta_n^2}$. This could've been made a bit more clear with an additional subscript $2$, but I just followed the notation from the paper :) Afterwards the superscript $2$ just means that we square it again, which cancels out the square root in the Euclidean norm, meaning we just end up with the sum of the squared elements of the vector.
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-02T10:16:06.990Z
Answers.LastActivityDate: 2019-07-02T10:16:06.990Z
Answers.UserDisplayName: Dennis Soemers
Body: <p>I was reading the AlphaZero paper <a href="https://arxiv.org/pdf/1712.01815.pdf" rel="noreferrer">Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm</a>, and it seems they don't mention Q-Learning anywhere.</p>
  
  <p>So does AZ use Q-Learning on the results of self-play or just a Supervised Learning?</p>
  
  <p>If it's a Supervised Learning, then why is it said that AZ uses Reinforcement Learning? Is "reinforcement" part primarily a result of using Monte-Carlo Tree Search?</p>
  
Tags: <reinforcement-learning><q-learning><monte-carlo-tree-search><supervised-learning><alphazero>
Title: Does AlphaZero use Q-Learning?
UserDisplayName: Avetik
ThreadText: # Does AlphaZero use Q-Learning?
  
  (Asked by: username_0 on 2019-07-01)
  
  I was reading the AlphaZero paper [Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm](https://arxiv.org/pdf/1712.01815.pdf), and it seems they don't mention Q-Learning anywhere.
  
  So does AZ use Q-Learning on the results of self-play or just a Supervised Learning?
  
  If it's a Supervised Learning, then why is it said that AZ uses Reinforcement Learning? Is "reinforcement" part primarily a result of using Monte-Carlo Tree Search?
  
  **Tags:** reinforcement-learning, q-learning, monte-carlo-tree-search, supervised-learning, alphazero
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-02. Score: 7 | Accepted answer
  
  **Note:** you mentioned in the comments that you are reading the old, pre-print version of the paper describing AlphaZero on arXiv. My answer will be for the "official", peer-reviewed, more recent publication in Science (which nbro linked to in his comment). I'm not only focusing on the official version of the paper just because it is official, but also because I found it to be much better / more complete, and I would recommend reading it instead of the preprint if you are able to (I understand it's behind a paywall so it may be difficult for some to get access). The answer to this specific question would probably be identical for the arXiv version anyway.
  
  ---
  
  **No, AlphaZero does not use $Q$-learning**.
  
  The neural network in AlphaZero is trained to minimise the following loss function:
  
  $$(z - \nu)^2 - \pi^{\top} \log \mathbf{p} + c \| \theta \|^2,$$
  
  where:
  
  * $z \in \{-1, 0, +1\}$ is the real outcome observed in a game of self-play.
  * $\nu$ is a predicted outcome / value.
  * $\pi$ is a distribution over actions derived from the visit counts of MCTS.
  * $\mathbf{p}$ is the distribution over actions output by the network / the policy.
  * $c \| \theta \|^2$ is a regularisation term, not really interesting for this question/answer.
  
  In this loss function, the term $(z - \nu)^2$ is exactly what we would have if we were performing plain Monte-Carlo updates, based on Monte-Carlo returns, in a traditional Reinforcemet Learning setting (with function approximation). Note that there is no "bootstrapping", no combination of a single-step observed reward plus predicted future rewards, as we would have in $Q$-learning. We play out all the way until the end of a game (an "episode"), and use the final outcome $z$ for our updates to our value function. That's what makes this Monte-Carlo learning, rather than $Q$-learning.
  
  As for the $- \pi^{\top} \log \mathbf{p}$ term, this is definitely not $Q$-learning (we're directly learning a policy in this part, not a value function).
  
  > If it's a Supervised Learning, then why is it said that AZ uses Reinforcement Learning? Is "reinforcement" part primarily a result of using Monte-Carlo Tree Search?
  
  The policy learning looks very similar to Supervised Learning; indeed it's the cross-entropy loss which is frequently used in Supervised Learning (classification) settings. **I'd still argue it is Reinforcement Learning, because the update targets are completely determined by self-play, by the agent's own experience. There are no training targets / labels that are provided externally** (i.e. no learning from a database of human expert games, as was done in 2016 in AlphaGo).
  
  > **Comments:**
  > **username_2**: username_1, can I ask about the convention of using || around the theta?  
  > **username_1**: @username_2 Sure. The two bars on each side of the vector basically denotes that we take the $\ell_2$-norm, or Euclidean norm, of the vector: $\sqrt{\theta_0^2 + \theta_1^2 + \dots + \theta_n^2}$. This could've been made a bit more clear with an additional subscript $2$, but I just followed the notation from the paper :) Afterwards the superscript $2$ just means that we square it again, which cancels out the square root in the Euclidean norm, meaning we just end up with the sum of the squared elements of the vector.  
  
  ---
  
  