NNUE

From Chessprogramming wiki
Revision as of 02:08, 29 July 2020 by Phhnguyen (talk | contribs)
Jump to: navigation, search

Home * Learning * Neural Networks * NNUE

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 [1], and was used in Shogi adaptations of Stockfish such as YaneuraOu [2], and Kristallweizen-kai [3], apparently with AlphaZero strength [4]. NNUE chess engines could be considered as hybrids between Neural Networks engines and AlphaBeta engines.

Stockfish NNUE

As reported by Henk Drost [5], 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 [6]. In July 2020, the playing code of NNUE is put into the official Stockfish repository as a branch for further development and examination. However, the training code still remains in Nodchip's repo [7].

Strong points of Stockfish NNUE

  • Reuses and gets benefits from the very optimized search function of Stockfish as well as almost all Stockfish's code
  • Run with CPU only, doesn't require expensive video cards, delete the need of installing video drivers and specific libraries, thus it becomes much easier to install (compare with other NN engines such as Leela Chess Zero) for users and can run in almost all modern computers
  • Require much smaller training sets. Some high score networks can be built with the effort of one or a few people. It doesn't require the massive computing from a supercomputer and/or from community

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 256x2x32-32x32-32x1 neurons 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 [8]

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

Re: The Stockfish of shogi by Gian-Carlo Pascutto, CCC, January 18, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 23, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 24, 2020

External Links

References

  1. Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)
  2. GitHub - yaneurao/YaneuraOu: YaneuraOu is the World's Strongest Shogi engine(AI player), WCSC29 1st winner, educational and USI compliant engine
  3. GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。
  4. The Stockfish of shogi by Larry Kaufman, CCC, January 07, 2020
  5. Stockfish NNUE by Henk Drost, CCC, May 31, 2020
  6. Can the sardine! NNUE clobbers SF by Henk Drost, CCC, July 16, 2020
  7. NNUE merge · Issue #2823 · official-stockfish/Stockfish · GitHub by Joost VandeVondele, July 25, 2020
  8. 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)
  9. An info by Sylwy, CCC, July 25, 2020

Up one Level