Answers.Body: <p>It seems this is happening because for endgame positions, Stockfish uses its handcrafted eval function. This is why Stockfish still has a contempt setting, since it's unclear how to implement contempt with NNUE eval, but contempt is still applicable whenever Stockfish uses its handcrafted eval. The handcrafted eval can flatline, therefore Stockfish can flatline as well.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-28T23:46:00.723Z
Answers.LastActivityDate: 2021-02-28T23:46:00.723Z
Answers.UserDisplayName: Allure
Body: <p>Flatline - to produce a flat evaluation curve.</p>
  <p>As I understand engine chess, engines &quot;flatline&quot; in fortress positions. In these positions there are a lot of effectively-equivalent positions that return the same static eval. For example, in a KR vs KB endgame, almost all positions are the same, so it's not surprising that the eval flatlines.</p>
  <p>NNUE however is different, because it's a neural network. It's hard for me to imagine that all the computations that's needed in a NN can yield exactly the same number for many different positions. That's why for example Leela Chess Zero never flatlines. How, then, can Stockfish NNUE flatline?</p>
  <p><a href="https://tcec-chess.com/#div=p&amp;game=78&amp;season=20" rel="nofollow noreferrer">Example of a game where Stockfish NNUE flatlines</a>: first from move 24 to 32 at 0.13, and then from move 33 to 38 at 0.05.</p>
  
Tags: <engines><stockfish>
Title: Why does Stockfish NNUE flatline?
ThreadText: # Why does Stockfish NNUE flatline?
  
  (Asked by: username_0 on 2021-01-04)
  
  Flatline - to produce a flat evaluation curve.
  
  As I understand engine chess, engines "flatline" in fortress positions. In these positions there are a lot of effectively-equivalent positions that return the same static eval. For example, in a KR vs KB endgame, almost all positions are the same, so it's not surprising that the eval flatlines.
  
  NNUE however is different, because it's a neural network. It's hard for me to imagine that all the computations that's needed in a NN can yield exactly the same number for many different positions. That's why for example Leela Chess Zero never flatlines. How, then, can Stockfish NNUE flatline?
  
  [Example of a game where Stockfish NNUE flatlines](https://tcec-chess.com/#div=p&game=78&season=20): first from move 24 to 32 at 0.13, and then from move 33 to 38 at 0.05.
  
  **Tags:** engines, stockfish
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-02-28. Score: 1 | Accepted answer
  
  It seems this is happening because for endgame positions, Stockfish uses its handcrafted eval function. This is why Stockfish still has a contempt setting, since it's unclear how to implement contempt with NNUE eval, but contempt is still applicable whenever Stockfish uses its handcrafted eval. The handcrafted eval can flatline, therefore Stockfish can flatline as well.
  
  
  ---
  
  