Answers.Body: <p>Answers to your question:</p>
  <blockquote>
  <p>Is this picture correct?</p>
  </blockquote>
  <p>You got it exactly right. It's exactly that- ab search with NN eval.</p>
  <blockquote>
  <p>If so, how is the NNUE being trained? Is it only being trained on Stockfish games, or does it also utilize games by other engines?</p>
  </blockquote>
  <p>Basically, it's given a bunch of positions and the SF eval at a certain depth, and is trained from that data. I'm not sure where the positions come from but I believe SF self-play.</p>
  <blockquote>
  <p>If NNUE is being trained on Stockfish games, does that mean Stockfish's original handwritten eval will continue to be tested and improved on? Or will Stockfish NNUE be trained on Stockfish NNUE games in the future (i.e. the handwritten eval is now obsolete and will not be developed anymore)?</p>
  </blockquote>
  <p>Yeah, handwritten eval will continue to be worked on. It's also worth noting that SF (the one after the merge) technically uses its old eval in certain types of positions- sadly I can't go into more detail since it's constantly changing with new elo-gaining patches, but as I understand it, classical eval is meant to be used in &quot;messier&quot; positions, while NNUE is used in quieter positions.</p>
  <blockquote>
  <p>Does this mean Stockfish's update process will now take longer? In the sense that for every new patch, a new NNUE would need to be trained, and then the new patch + new network plays against the old patch + old network?</p>
  </blockquote>
  <p>Nope, patches should come at the same speed (currently they're coming at a much faster rate due to obvious improvements being all over, like, I  go to sleep, I wake up, already several patches gaining elo....). As I understand, there'd be no need for a new NNUE.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T03:13:08.253Z
Answers.Text: *As I understand, there'd be no need for a new NNUE* If there's no need for a new NNUE, what's the point of continuing to work on handwritten eval? Also, does this mean patches will be primarily about search now?
Answers.UserDisplayName: Allure
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T03:16:52.007Z
Answers.Text: There would be no need for a new NNUE with every next patch, but NNUE can continue to be trained for sure (don't know if it would still be trained on stockfish traditional eval at depth whatever, or stockfish nnue/handwritten mix as SF is currently using- don't think a decision's been made on that). Even if the NNUE stayed the same, there'd still be a point, as in some positions where it's "crazy" (exact definition of this changes with half the patches right now) classical eval is used instead of NNUE. ATM most of the patches seem to be fine tuning where classical eval and NNUE eval are used.
Answers.UserDisplayName: pulsar512b
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T01:26:12.300Z
Answers.LastActivityDate: 2020-08-12T01:26:12.300Z
Answers.UserDisplayName: pulsar512b
Body: <p>Apparently there was a major update to Stockfish recently such that it gained +50 elo (<a href="https://github.com/glinscott/fishtest/wiki/Regression-Tests" rel="noreferrer">per regression tests</a>). I'm told that the difference is coming from the new NNUE (efficiently updatable neural network) eval function. In other words Stockfish is now a hybrid engine utilizing AB search &amp; NN eval.</p>
  <p>Questions:</p>
  <ul>
  <li>Is this picture correct?</li>
  <li>If so, how is the NNUE being trained? Is it only being trained on Stockfish games, or does it also utilize games by other engines?</li>
  <li>If NNUE is being trained on Stockfish games, does that mean Stockfish's original handwritten eval will continue to be tested and improved on? Or will Stockfish NNUE be trained on Stockfish NNUE games in the future (i.e. the handwritten eval is now obsolete and will not be developed anymore)?</li>
  <li>Does this mean Stockfish's update process will now take longer? In the sense that for every new patch, a new NNUE would need to be trained, and then the new patch + new network plays against the old patch + old network?</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T11:11:56.173Z
Comments.Text: This is probably a Machine Learning or programming question rather than a chess one
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T14:03:49.157Z
Comments.Text: @David I don't see why it would not be a chess question. It's completely about Stockfish.
Comments.UserDisplayName: Allure
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T17:49:01.903Z
Comments.Text: Would you consider a question about the market salary of a lumberjack a chess question? You can make chess boards out of wood....
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T19:39:41.600Z
Comments.Text: @David I feel like you don't understand the question. If you agree that questions about how Stockfish works are relevant in this SE, then you must agree that this question is also relevant.
Comments.UserDisplayName: Allure
Tags: <engines><stockfish>
Title: What does Stockfish NNUE mean for Stockfish?
ThreadText: # What does Stockfish NNUE mean for Stockfish?
  
  (Asked by: username_0 on 2020-08-10)
  
  Apparently there was a major update to Stockfish recently such that it gained +50 elo ([per regression tests](https://github.com/glinscott/fishtest/wiki/Regression-Tests)). I'm told that the difference is coming from the new NNUE (efficiently updatable neural network) eval function. In other words Stockfish is now a hybrid engine utilizing AB search & NN eval.
  
  Questions:
  
  * Is this picture correct?
  * If so, how is the NNUE being trained? Is it only being trained on Stockfish games, or does it also utilize games by other engines?
  * If NNUE is being trained on Stockfish games, does that mean Stockfish's original handwritten eval will continue to be tested and improved on? Or will Stockfish NNUE be trained on Stockfish NNUE games in the future (i.e. the handwritten eval is now obsolete and will not be developed anymore)?
  * Does this mean Stockfish's update process will now take longer? In the sense that for every new patch, a new NNUE would need to be trained, and then the new patch + new network plays against the old patch + old network?
  
  **Tags:** engines, stockfish
  
  > **Comments:**
  > **username_1**: This is probably a Machine Learning or programming question rather than a chess one  
  > **username_0**: @username_1 I don't see why it would not be a chess question. It's completely about Stockfish.  
  > **username_1**: Would you consider a question about the market salary of a lumberjack a chess question? You can make chess boards out of wood....  
  > **username_0**: @username_1 I feel like you don't understand the question. If you agree that questions about how Stockfish works are relevant in this SE, then you must agree that this question is also relevant.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-08-12. Score: 6 | Accepted answer
  
  Answers to your question:
  
  > Is this picture correct?
  
  You got it exactly right. It's exactly that- ab search with NN eval.
  
  > If so, how is the NNUE being trained? Is it only being trained on Stockfish games, or does it also utilize games by other engines?
  
  Basically, it's given a bunch of positions and the SF eval at a certain depth, and is trained from that data. I'm not sure where the positions come from but I believe SF self-play.
  
  > If NNUE is being trained on Stockfish games, does that mean Stockfish's original handwritten eval will continue to be tested and improved on? Or will Stockfish NNUE be trained on Stockfish NNUE games in the future (i.e. the handwritten eval is now obsolete and will not be developed anymore)?
  
  Yeah, handwritten eval will continue to be worked on. It's also worth noting that SF (the one after the merge) technically uses its old eval in certain types of positions- sadly I can't go into more detail since it's constantly changing with new elo-gaining patches, but as I understand it, classical eval is meant to be used in "messier" positions, while NNUE is used in quieter positions.
  
  > Does this mean Stockfish's update process will now take longer? In the sense that for every new patch, a new NNUE would need to be trained, and then the new patch + new network plays against the old patch + old network?
  
  Nope, patches should come at the same speed (currently they're coming at a much faster rate due to obvious improvements being all over, like, I go to sleep, I wake up, already several patches gaining elo....). As I understand, there'd be no need for a new NNUE.
  
  > **Comments:**
  > **username_0**: *As I understand, there'd be no need for a new NNUE* If there's no need for a new NNUE, what's the point of continuing to work on handwritten eval? Also, does this mean patches will be primarily about search now?  
  > **username_2**: There would be no need for a new NNUE with every next patch, but NNUE can continue to be trained for sure (don't know if it would still be trained on stockfish traditional eval at depth whatever, or stockfish nnue/handwritten mix as SF is currently using- don't think a decision's been made on that). Even if the NNUE stayed the same, there'd still be a point, as in some positions where it's "crazy" (exact definition of this changes with half the patches right now) classical eval is used instead of NNUE. ATM most of the patches seem to be fine tuning where classical eval and NNUE eval are used.  
  
  ---
  
  