Answers.Body: <p>I'm not aware of anyone running a setup of everything that AlphaZero does, minus the Policy Network, and reporting on how well it worked, so I don't think I can provide a definitive 100% certain answer. My intuition says that it would &quot;work&quot; in the sense that it could still produce a very strong agent, but I suspect it could be slower to train and/or not reach as high of a peak.</p>
  <hr />
  <p>One important advantage of the Policy Network over the Value Network is specifically during the training phase, and in particular in the beginning of training; <strong>the Policy Network receives much more training data</strong>. When we run self-play games as in the AlphaZero paper, we get one target for the Policy Network for every distinct state we encounter (so many different targets per state), but only a single target for the Value Network for every full game (just the outcome of the game). There are papers that try to address this in different ways (some extract multiple value targets from the tree, some speed up the generation of self-play games by only running shorter searches in some states and not generating policy targets from the shorter searches, etc.), but ignoring those... in the standard AlphaZero setup, we may expect the Policy Network to train faster / more easily, especially in the beginning. The Value Network can &quot;catch up&quot; afterwards.</p>
  <p>A second advantage of the Policy Network over the Value Network is that it may <strong>more effectively learn to distinguish good moves from bad moves in highly one-sided game states</strong>. Consider a game state <span class="math-container">$s$</span> where the player is (almost) sure to win, and can even afford to make a few mistakes. We'll probably get that all the successor states <span class="math-container">$s'$</span> get approximately the same value estimates <span class="math-container">$V(s') \approx 0.999$</span>, with only a tiny amount of variation, and we may be unable to distinguish good moves from bad moves. The value network may no longer have any sort of noticeable preference for good moves over bad moves, until it has made so many blunders/mistakes that it actually becomes necessary to play well again. It would probably still win, but possibly in a less convincing manner (and slower) than it could. It's not even <strong>wrong</strong> for the value network to learn in this way, since we do want it (ideally) to learn the game-theoretic values, and this would be correct from that point of view. But probably still <em>undesirable</em>. In contrast, the Policy Network is not trained to predict game-theoretic values, or trained just to win. It's actively trained to pick good moves over bad moves. Due to the exploratory behaviour that is inherent in MCTS, MCTS generally ends up preferring more convincing / faster / safer wins, so the Policy Network does actually get an incentive to really play well even in such states where mistakes can be afforded.</p>
  <p>A similar story to the above also applies to game states where the player is almost sure to lose; the Value Network gets no incentive to distinguish states from each other and might end up playing poorly in losing states, whereas a Policy Network still gets incentive to play well and &quot;fight back&quot;, which may end up allowing it to still reach a win against suboptimal players.</p>
  <hr />
  <blockquote>
  <p>What if we would replace the computation of the policy network with this logic: generate all subsequent moves, evaluate them using value network, and create policy from these predictions.</p>
  </blockquote>
  <p>This particular implementation you suggest would have an additional disadvantage of <strong>computational inefficiency</strong>: to evaluate the Value Network for all possible successor states, you actually need to 1) generate all those successor states first and 2) run forwards passes of the Neural Network for every successor. Both of those things take time. In contrast, the Policy Network just runs once for the single parent state, and at once computes all the probabilities for all the actions. This is much more efficient.</p>
  <hr />
  <p>Related to your suggestion, but quite a bit different because it does not use MCTS (but a different tree search algorithm) as the underlying search algorithm, a rather effective approach that only uses a Value Network (no Policy Network) is described in <a href="https://arxiv.org/abs/2008.01188" rel="nofollow noreferrer">&quot;Learning to Play Two-Player Perfect-Information Games without Knowledge&quot;</a> by Cohen-Solal, with additional empirical results described in <a href="https://arxiv.org/abs/2012.10700" rel="nofollow noreferrer">&quot;Minimax Strikes Back&quot;</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-12T01:05:19.743Z
Answers.Text: Thank you for a nice answer! It seems that Minimax Strikes Back is exactly what I was looking for. Just one note to "Policy Network receives much more training data". If I am not mistaken the number of states used for training is the same for policy and value network, is not in? Also the targets for value networks should be equally distributed in the training samples; half of them are -1 and the other half is +1 (if there is no draw). So it is not really clear to me why policy network should learn faster. Can you please elaborate on that or point me to the mentioned literature? Many thanks!
Answers.UserDisplayName: Druudik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-12T08:34:19.360Z
Answers.Text: @Druudik Technically yeah, in your experience buffer you get equal amounts of samples for Policy and Value. But the policy targets are different for every state, and specifically "made" for that particular state. The value targets are the same for all states in the full game (ignoring negation for the opposite colours), and really not "made" for that particular state. They're probably fairly accurate for the last few states, but may be really inaccurate for early states. I recommend taking a look at Section 3.1 of https://arxiv.org/abs/1902.10565
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-12T14:47:55.920Z
Answers.Text: I think I am starting to get what you meant by that. Once again many thanks!
Answers.UserDisplayName: Druudik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-12T15:16:10.210Z
Answers.Text: Just adding reference to one more article that I've just found which I think explains exactly what you were mentioning https://medium.com/oracledevs/lessons-from-alphazero-part-4-improving-the-training-target-6efba2e71628.
Answers.UserDisplayName: Druudik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-11T19:24:45.523Z
Answers.LastActivityDate: 2021-11-11T19:24:45.523Z
Answers.UserDisplayName: Dennis Soemers
Answers.Body: <p>The solution approach for the linked work <a href="https://www.nature.com/articles/nature16961.pdf" rel="nofollow noreferrer">Mastering the game of Go with deep neural networks and tree search</a> is not only valid for the game Go but can also be used for other games, e.g. chess.
  The policy network has the task to learn the rules of the game and is then improved only with the help of the value network by focusing on winning games.
  If I understand you correctly, you want to evaluate all the moves using the value network and pick the best one?
  For this you need rules - i.e. which moves are allowed to be made at all.
  That's what I think you need the policy network for.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-11T15:48:37.190Z
Answers.Text: Regarding the rules: that is what I've meant by "where perfect simulator is available". Would policy network be requirement also in this case?
Answers.UserDisplayName: Druudik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-11T14:07:57.810Z
Answers.LastActivityDate: 2021-11-11T14:07:57.810Z
Answers.UserDisplayName: Markus Gersdorf
Body: <p>There is a nice <a href="https://stats.stackexchange.com/q/374100">post</a> about the intuition why AlphaZero works.</p>
  <p>One of the advantages of using a policy network in the games where a perfect simulator is available (such as chess) is to save computation time by not generating all subsequent moves and then evaluating them using the value network. Instead, we can only focus on the good moves given by the policy network.</p>
  <p>However, besides the computation time savings of the policy network, are there any requirements why it needs to be used during training?</p>
  <p>What if we would replace the computation of the policy network with this logic: generate all subsequent moves, evaluate them using value network, and create policy from these predictions. Would this still work?</p>
  <p>I would appreciate any references where this topic is discussed.</p>
  
Tags: <reference-request><game-ai><monte-carlo-tree-search><game-theory><alphazero>
Title: Would AlphaZero work just with a value network?
UserDisplayName: Druudik
ThreadText: # Would AlphaZero work just with a value network?
  
  (Asked by: username_0 on 2021-11-10)
  
  There is a nice [post](https://stats.stackexchange.com/q/374100) about the intuition why AlphaZero works.
  
  One of the advantages of using a policy network in the games where a perfect simulator is available (such as chess) is to save computation time by not generating all subsequent moves and then evaluating them using the value network. Instead, we can only focus on the good moves given by the policy network.
  
  However, besides the computation time savings of the policy network, are there any requirements why it needs to be used during training?
  
  What if we would replace the computation of the policy network with this logic: generate all subsequent moves, evaluate them using value network, and create policy from these predictions. Would this still work?
  
  I would appreciate any references where this topic is discussed.
  
  **Tags:** reference-request, game-ai, monte-carlo-tree-search, game-theory, alphazero
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-11-11. Score: 1 | Accepted answer
  
  I'm not aware of anyone running a setup of everything that AlphaZero does, minus the Policy Network, and reporting on how well it worked, so I don't think I can provide a definitive 100% certain answer. My intuition says that it would "work" in the sense that it could still produce a very strong agent, but I suspect it could be slower to train and/or not reach as high of a peak.
  
  ---
  
  One important advantage of the Policy Network over the Value Network is specifically during the training phase, and in particular in the beginning of training; **the Policy Network receives much more training data**. When we run self-play games as in the AlphaZero paper, we get one target for the Policy Network for every distinct state we encounter (so many different targets per state), but only a single target for the Value Network for every full game (just the outcome of the game). There are papers that try to address this in different ways (some extract multiple value targets from the tree, some speed up the generation of self-play games by only running shorter searches in some states and not generating policy targets from the shorter searches, etc.), but ignoring those... in the standard AlphaZero setup, we may expect the Policy Network to train faster / more easily, especially in the beginning. The Value Network can "catch up" afterwards.
  
  A second advantage of the Policy Network over the Value Network is that it may **more effectively learn to distinguish good moves from bad moves in highly one-sided game states**. Consider a game state $s$ where the player is (almost) sure to win, and can even afford to make a few mistakes. We'll probably get that all the successor states $s'$ get approximately the same value estimates $V(s') \approx 0.999$, with only a tiny amount of variation, and we may be unable to distinguish good moves from bad moves. The value network may no longer have any sort of noticeable preference for good moves over bad moves, until it has made so many blunders/mistakes that it actually becomes necessary to play well again. It would probably still win, but possibly in a less convincing manner (and slower) than it could. It's not even **wrong** for the value network to learn in this way, since we do want it (ideally) to learn the game-theoretic values, and this would be correct from that point of view. But probably still *undesirable*. In contrast, the Policy Network is not trained to predict game-theoretic values, or trained just to win. It's actively trained to pick good moves over bad moves. Due to the exploratory behaviour that is inherent in MCTS, MCTS generally ends up preferring more convincing / faster / safer wins, so the Policy Network does actually get an incentive to really play well even in such states where mistakes can be afforded.
  
  A similar story to the above also applies to game states where the player is almost sure to lose; the Value Network gets no incentive to distinguish states from each other and might end up playing poorly in losing states, whereas a Policy Network still gets incentive to play well and "fight back", which may end up allowing it to still reach a win against suboptimal players.
  
  ---
  
  > What if we would replace the computation of the policy network with this logic: generate all subsequent moves, evaluate them using value network, and create policy from these predictions.
  
  This particular implementation you suggest would have an additional disadvantage of **computational inefficiency**: to evaluate the Value Network for all possible successor states, you actually need to 1) generate all those successor states first and 2) run forwards passes of the Neural Network for every successor. Both of those things take time. In contrast, the Policy Network just runs once for the single parent state, and at once computes all the probabilities for all the actions. This is much more efficient.
  
  ---
  
  Related to your suggestion, but quite a bit different because it does not use MCTS (but a different tree search algorithm) as the underlying search algorithm, a rather effective approach that only uses a Value Network (no Policy Network) is described in ["Learning to Play Two-Player Perfect-Information Games without Knowledge"](https://arxiv.org/abs/2008.01188) by Cohen-Solal, with additional empirical results described in ["Minimax Strikes Back"](https://arxiv.org/abs/2012.10700).
  
  > **Comments:**
  > **username_0**: Thank you for a nice answer! It seems that Minimax Strikes Back is exactly what I was looking for. Just one note to "Policy Network receives much more training data". If I am not mistaken the number of states used for training is the same for policy and value network, is not in? Also the targets for value networks should be equally distributed in the training samples; half of them are -1 and the other half is +1 (if there is no draw). So it is not really clear to me why policy network should learn faster. Can you please elaborate on that or point me to the mentioned literature? Many thanks!  
  > **username_1**: @Druudik Technically yeah, in your experience buffer you get equal amounts of samples for Policy and Value. But the policy targets are different for every state, and specifically "made" for that particular state. The value targets are the same for all states in the full game (ignoring negation for the opposite colours), and really not "made" for that particular state. They're probably fairly accurate for the last few states, but may be really inaccurate for early states. I recommend taking a look at Section 3.1 of https://arxiv.org/abs/1902.10565  
  > **username_0**: I think I am starting to get what you meant by that. Once again many thanks!  
  > **username_0**: Just adding reference to one more article that I've just found which I think explains exactly what you were mentioning https://medium.com/oracledevs/lessons-from-alphazero-part-4-improving-the-training-target-6efba2e71628.  
  
  ---
  
  ### Answer by username_2 on 2021-11-11. Score: 0
  
  The solution approach for the linked work [Mastering the game of Go with deep neural networks and tree search](https://www.nature.com/articles/nature16961.pdf) is not only valid for the game Go but can also be used for other games, e.g. chess.
  The policy network has the task to learn the rules of the game and is then improved only with the help of the value network by focusing on winning games.
  If I understand you correctly, you want to evaluate all the moves using the value network and pick the best one?
  For this you need rules - i.e. which moves are allowed to be made at all.
  That's what I think you need the policy network for.
  
  > **Comments:**
  > **username_0**: Regarding the rules: that is what I've meant by "where perfect simulator is available". Would policy network be requirement also in this case?  
  
  ---
  
  