Answers.Body: <p>You are asking the right question but only want to refine your premise slightly. AlphaZero does indeed search "through lots of positions from the current one first," as you have said, only not precisely via alpha-beta pruning. AlphaZero's makers <a href="https://deepmind.com/documents/260/alphazero_preprint.pdf" rel="noreferrer">explain it thus</a>:</p>
  
  <blockquote>
    <p>Instead of an alpha-beta search with domain-specific enhancements, AlphaZero uses a general-purpose Monte Carlo tree search (MCTS) algorithm. Each search consists of a series of simulated games of self-play that traverse a tree from root state <em>s</em> root until a leaf state is reached. Each simulation proceeds by selecting in each state <em>s</em> a move <em>a</em> with low visit count (not previously frequently explored), high move probability and high value (averaged over the leaf states of simulations that selected <em>a</em> from <em>s</em>) according to the current neural network <em>f<sub>θ</sub></em>. The search returns a vector π representing a probability distribution over moves, π<sub><em>a</em></sub> = Pr(<em>a</em>|<em>s</em><sub>root</sub>).</p>
  </blockquote>
  
  <p>As you know, most opening and middlegame positions make it impractical to search all relevant chessboard futures, so the question is how to prune the search tree. AlphaZero prunes the tree as explained but, <em>for each relevant chessboard future not pruned,</em> evaluates the position by neural net.</p>
  
  <p>Thus, contrary to your premise (if I grasp your premise correctly), AlphaZero judges not only the position actually on the board but also potential future positions.</p>
  
  <p>If you have had occasion to review Stockfish's source code you will have noticed how straightforward Stockfish's evaluation function is. It's fairly simple and very quick. The speed of AlphaZero's evaluation function naturally depends in part on the hardware on which AlphaZero is run but in the absence of exotic hardware AlphaZero's evaluation can hardly be as fast as Stockfish's. Therefore, significantly, as far as I know, Stockfish has the advantage of evaluating more chessboard futures than AlphaZero can. Your premise is right to that extent.</p>
  
  <p>Nevertheless, AlphaZero</p>
  
  <ul>
  <li>searches more chessboard futures than a human master can, and</li>
  <li>apparently evaluates each better than Stockfish can.</li>
  </ul>
  
  <p>This is reportedly how AlphaZero plays better than either.</p>
  
  <p>Insofar as AlphaZero's makers have not released their source, it is hard to say too much more, but meanwhile you may have heard of <a href="https://lczero.org/" rel="noreferrer">LCZero,</a> a vigorous open-source attempt to replicate AlphaZero's results. If you have not heard of LCZero, also known as "Leela," then you might investigate when you have some time.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T14:42:46.320Z
Answers.LastActivityDate: 2019-04-07T14:42:46.320Z
Answers.UserDisplayName: thb
Body: <p>NOTE: I asked a similar question at the ai stackexchange, but didn't get any satisfying answers, so I will post an updated version of the question here, to see if someone with more of a chess background can answer it.</p>
  
  <p>In short terms: Is it possible to combine the techniques used by AlphaZero with those used by, say, Stockfish? In AI terms that would be combining deep reinforcement learning with alpha-beta pruning. And if so, has it been attempted?</p>
  
  <p>I have only a brief knowledge about how AlphaZero works, but from what I've understood, it basically takes the board state as input to a neural net, possibly combined with monte carlo methods, and outputs a board evaluation or prefered move. To me, this really resembles the heuristic function used by traditional chess engines like stockfish.</p>
  
  <p>So, from this I will conclude (correct me if I'm wrong) that AlphaZero evaluates the current position, but uses a very powerful heuristic. Stockfish on the other hand searches through lots of positions from the current one first, and then uses a less powerful heuristic when a certain depth is reached.</p>
  
  <p>Is it therefore possible to combine these approaches by first using alpha-beta pruning, and then using AlphaZero as some kind of heuristic when the max depth is reached? To me it seems like this would be better than just evaluating the current position like (I think) AlphaZero does. Will it take too much time to evaluate? Or is it something I have misunderstood? If it's possible, has anyone attempted it?</p>
  
  <p>---Reopening motivation---</p>
  
  <p>This closed question may have a good answer in <a href="https://www.newinchess.com/komodo-chess-13" rel="nofollow noreferrer">https://www.newinchess.com/komodo-chess-13</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-07T13:33:39.460Z
Comments.Text: Note: If you didn't get the answer on AI.SE, you probably won't get a good one here. I might take a stab at it, though. Could you link to the AS.SE question? Thanks.
Comments.UserDisplayName: Brandon_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-07T13:51:35.600Z
Comments.Text: @thb drat I meant to say "might" not "probably". Ugh...
Comments.UserDisplayName: Brandon_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-07T14:46:43.240Z
Comments.Text: @Brandon_J I see. That makes sense.
Comments.UserDisplayName: thb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-21T13:48:13.147Z
Comments.Text: This closed question may have a good answer in https://www.newinchess.com/komodo-chess-13
Comments.UserDisplayName: MichalRyszardWojcik
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-21T15:20:53.503Z
Comments.Text: Why was this question flagged as too broad? This is a very specific question. (And clear and well researched if I might add)
Comments.UserDisplayName: Patrick Coulombe
Tags: <stockfish><alphazero>
Title: Combining AlphaZero methods with Stockfish methods
ThreadText: # Combining AlphaZero methods with Stockfish methods
  
  (Asked by: username_0 on 2019-04-07)
  
  NOTE: I asked a similar question at the ai stackexchange, but didn't get any satisfying answers, so I will post an updated version of the question here, to see if someone with more of a chess background can answer it.
  
  In short terms: Is it possible to combine the techniques used by AlphaZero with those used by, say, Stockfish? In AI terms that would be combining deep reinforcement learning with alpha-beta pruning. And if so, has it been attempted?
  
  I have only a brief knowledge about how AlphaZero works, but from what I've understood, it basically takes the board state as input to a neural net, possibly combined with monte carlo methods, and outputs a board evaluation or prefered move. To me, this really resembles the heuristic function used by traditional chess engines like stockfish.
  
  So, from this I will conclude (correct me if I'm wrong) that AlphaZero evaluates the current position, but uses a very powerful heuristic. Stockfish on the other hand searches through lots of positions from the current one first, and then uses a less powerful heuristic when a certain depth is reached.
  
  Is it therefore possible to combine these approaches by first using alpha-beta pruning, and then using AlphaZero as some kind of heuristic when the max depth is reached? To me it seems like this would be better than just evaluating the current position like (I think) AlphaZero does. Will it take too much time to evaluate? Or is it something I have misunderstood? If it's possible, has anyone attempted it?
  
  ---Reopening motivation---
  
  This closed question may have a good answer in <https://www.newinchess.com/komodo-chess-13>
  
  **Tags:** stockfish, alphazero
  
  > **Comments:**
  > **username_1**: Note: If you didn't get the answer on AI.SE, you probably won't get a good one here. I might take a stab at it, though. Could you link to the AS.SE question? Thanks.  
  > **username_1**: @username_2 drat I meant to say "might" not "probably". Ugh...  
  > **username_2**: @username_1 I see. That makes sense.  
  > **username_3**: This closed question may have a good answer in https://www.newinchess.com/komodo-chess-13  
  > **username_4**: Why was this question flagged as too broad? This is a very specific question. (And clear and well researched if I might add)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-04-07. Score: 6 | Accepted answer
  
  You are asking the right question but only want to refine your premise slightly. AlphaZero does indeed search "through lots of positions from the current one first," as you have said, only not precisely via alpha-beta pruning. AlphaZero's makers [explain it thus](https://deepmind.com/documents/260/alphazero_preprint.pdf):
  
  > Instead of an alpha-beta search with domain-specific enhancements, AlphaZero uses a general-purpose Monte Carlo tree search (MCTS) algorithm. Each search consists of a series of simulated games of self-play that traverse a tree from root state *s* root until a leaf state is reached. Each simulation proceeds by selecting in each state *s* a move *a* with low visit count (not previously frequently explored), high move probability and high value (averaged over the leaf states of simulations that selected *a* from *s*) according to the current neural network *fθ*. The search returns a vector π representing a probability distribution over moves, π*a* = Pr(*a*|*s*root).
  
  As you know, most opening and middlegame positions make it impractical to search all relevant chessboard futures, so the question is how to prune the search tree. AlphaZero prunes the tree as explained but, *for each relevant chessboard future not pruned,* evaluates the position by neural net.
  
  Thus, contrary to your premise (if I grasp your premise correctly), AlphaZero judges not only the position actually on the board but also potential future positions.
  
  If you have had occasion to review Stockfish's source code you will have noticed how straightforward Stockfish's evaluation function is. It's fairly simple and very quick. The speed of AlphaZero's evaluation function naturally depends in part on the hardware on which AlphaZero is run but in the absence of exotic hardware AlphaZero's evaluation can hardly be as fast as Stockfish's. Therefore, significantly, as far as I know, Stockfish has the advantage of evaluating more chessboard futures than AlphaZero can. Your premise is right to that extent.
  
  Nevertheless, AlphaZero
  
  * searches more chessboard futures than a human master can, and
  * apparently evaluates each better than Stockfish can.
  
  This is reportedly how AlphaZero plays better than either.
  
  Insofar as AlphaZero's makers have not released their source, it is hard to say too much more, but meanwhile you may have heard of [LCZero,](https://lczero.org/) a vigorous open-source attempt to replicate AlphaZero's results. If you have not heard of LCZero, also known as "Leela," then you might investigate when you have some time.
  
  
  ---
  
  