Difference between revisions of "NNUE"

From Chessprogramming wiki
Jump to: navigation, search
Line 16: Line 16:
  
 
=NNUE Engines=
 
=NNUE Engines=
Being tempted by the success of [[Stockfish NNUE]] and attracted by how easy the method and small the code is, many engine developers have started testing and applying [[NNUE]]. For quick trials and evaluating before going into serious development, some of them borrowed and/or rewrote NNUE code and use networks from Stockfish NNUE. Most of them reported positive results, such as [[David Carteau]] with [[Orion]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=74828 Orion 0.7 : NNUE experiment] by [[David Carteau]], [[CCC]], 19 Aug 2020</ref>, various [[Stockfish#Derivatives|Stockfish derivatives]] by [[Michael Byrne]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=74825 ... the last shall be first ...] by [[Michael Byrne|MikeB]], [[CCC]], 19 Aug 2020</ref>, and [[Volodymyr Shcherbyna]] with [[Igel]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=67890&start=10#p856742 Introducing Igel chess engine] by [[Volodymyr Shcherbyna]], [[CCC]], 20 Aug 2020</ref>, to name a few.
+
Being tempted by the success of [[Stockfish NNUE]] and attracted by how easy the method and small the code is, many engine developers have started testing and applying [[NNUE]]. For quick trials and evaluating before going into serious development, some of them borrowed and/or rewrote NNUE code and use networks from Stockfish NNUE. Most of them reported positive results, such as [[David Carteau]] with [[Orion]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=74828 Orion 0.7 : NNUE experiment] by [[David Carteau]], [[CCC]], 19 Aug 2020</ref>, various [[Stockfish#Derivatives|Stockfish derivatives]] by [[Michael Byrne]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=74825 ... the last shall be first ...] by [[Michael Byrne|MikeB]], [[CCC]], 19 Aug 2020</ref>, and [[Volodymyr Shcherbyna]] with [[Igel]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=67890&start=10#p856742 Introducing Igel chess engine] by [[Volodymyr Shcherbyna]], [[CCC]], 20 Aug 2020</ref> using the ''Night Nurse'' NNUE net by [[Dietrich Kappe]] <ref>[http://talkchess.com/forum3/viewtopic.php?f=2&t=74837 Night Nurse 0.2] by [[Dietrich Kappe]], [[CCC]], August 19, 2020</ref>.
  
 
=NN Structure=
 
=NN Structure=

Revision as of 20:38, 23 August 2020

Home * Learning * Neural Networks * NNUE

Toriyama Sekien - Nue (鵺) [1] [2]

NNUE, (ƎUИИ Efficiently Updatable Neural Networks)
a Neural Network architecture intended to replace the evaluation of Shogi, chess and other board game playing alpha-beta searchers running on a CPU. NNUE was introduced in 2018 by Yu Nasu [3], and was used in Shogi adaptations of Stockfish such as YaneuraOu [4], and Kristallweizen [5], apparently with AlphaZero strength [6].

Stockfish NNUE

As reported by Henk Drost [7], Nodchip incorporated NNUE into the chess playing Stockfish 10 as a proof of concept. Stockfish NNUE was born, and in summer 2020 the computer chess community bursts out enthusiastically due to its rapidly raising playing strength with different networks trained using a mixture of supervised and reinforcement learning methods - despite the approximately halved search speed, seemingly becoming stronger than its original [8].

NNUE Engines

Being tempted by the success of Stockfish NNUE and attracted by how easy the method and small the code is, many engine developers have started testing and applying NNUE. For quick trials and evaluating before going into serious development, some of them borrowed and/or rewrote NNUE code and use networks from Stockfish NNUE. Most of them reported positive results, such as David Carteau with Orion [9], various Stockfish derivatives by Michael Byrne [10], and Volodymyr Shcherbyna with Igel [11] using the Night Nurse NNUE net by Dietrich Kappe [12].

NN Structure

The neural network consists of four layers, W1 through W4. The input layer W1 is heavily overparametrized, feeding in the board representation for various king configurations. The efficiency of the net is due to incremental update of W1 in make and unmake move, where only a fraction of its neurons need to be recalculated. The remaining three layers with 32x2x256, 32x32 and 32x1 weights are computational less expensive, best calculated using appropriate SIMD instructions like AVX2 on x86-64, or if available, AVX-512.

NNUE.jpg

NNUE structure with incremental update [13]

Publications

  • Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)

Forum Posts

2020 ...

Re: The Stockfish of shogi by Gian-Carlo Pascutto, CCC, January 18, 2020

July

Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 23, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 24, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, August 03, 2020

August

External Links

NNEU

Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 1. Network Structure) - Computer Shogi
Let's Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 2. Remodeling/Learning) - Computer Shogi

Misc

References

  1. Nue (鵺) from the Konjaku Gazu Zoku Hyakki (今昔画図続百鬼) by Toriyama Sekien, circa 1779, Wikimedia Commons
  2. Re: What does NNUE actually mean by Henk Drost, CCC, July 29, 2020
  3. Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)
  4. GitHub - yaneurao/YaneuraOu: YaneuraOu is the World's Strongest Shogi engine(AI player), WCSC29 1st winner, educational and USI compliant engine
  5. GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。
  6. The Stockfish of shogi by Larry Kaufman, CCC, January 07, 2020
  7. Stockfish NN release (NNUE) by Henk Drost, CCC, May 31, 2020
  8. Can the sardine! NNUE clobbers SF by Henk Drost, CCC, July 16, 2020
  9. Orion 0.7 : NNUE experiment by David Carteau, CCC, 19 Aug 2020
  10. ... the last shall be first ... by MikeB, CCC, 19 Aug 2020
  11. Introducing Igel chess engine by Volodymyr Shcherbyna, CCC, 20 Aug 2020
  12. Night Nurse 0.2 by Dietrich Kappe, CCC, August 19, 2020
  13. Image from Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)

Up one Level