NNUE

from Wikipedia, the free encyclopedia
Nue is a mythical creature from Japanese mythology with the head of a monkey , the body of a raccoon dog , the legs of a tiger and a snake for its tail.

NNUE ( revertiertes acronym for English E fficiently U pdatable N EURAL N etwork , originally mirrored ИИUƎ written German  "Efficient updateable neural network" ) is a special architecture of a neural network that - not - different than usual graphics processors is instructed (GPU) , but is already running efficiently on a computer's central processing unit (CPU) .

An important application is the replacement of the classic evaluation function in computer board games , especially in computer chess , whereby a considerable increase in playing strength is achieved.

story

NNUE was developed by the Japanese software developer Yu Nasu for the computer shogi , a Japanese variant of computer chess, and was presented in its publication for the 28th Computer Shogi World Championship in April 2018 (see literature ). The basic idea is to replace the evaluation function , which has been laboriously heuristically optimized over many years by human experts, with a machine-generated one. For this purpose, a neural network consisting of only four layers is automatically trained in advance on the basis of many millions of chess positions and the optimized network is then used as a new part of the chess program to evaluate the position.

The new method initially received little public attention and was probably completely underestimated by some until opinion turned and it was described as a " revolution ". The Dutch computer chess pioneer Ed Schröder , programmer of the legendary Rebel chess program , which won the World Computer Chess Championship (WCCC) in 1992, wrote about NNUE in the summer of 2020:

"A new revolution in computer chess is taking place, in my opinion, it will (once again) change computer chess dramatically the coming years looking at the first results."

"A new revolution in computer chess is taking place, in my opinion it will change computer chess (again) dramatically in the coming years, if you look at the first results."

This happened shortly after it in May 2020 the first " proof of concept " for NNUE along with a chess - engine (not Shōgi) had given. On a trial basis, it was implemented in a development version of the free chess program Stockfish . After this was successfully achieved, NNUE became a regular component of the new development versions based on Stockfish 11 from August 2020 . Finally, on September 2, 2020, the Stockfish 12 version was released with the following comment:

“This version of Stockfish plays significantly stronger than any of its predecessors. In a match against Stockfish 11, Stockfish 12 will typically win at least ten times more game pairs than it loses. "

“This version of Stockfish plays a lot stronger than any of its predecessors. In a match against Stockfish 11, Stockfish 12 usually wins at least ten times more pairs than it loses. "

- stockfishchess.org

With Stockfish 12, NNUE optionally replaces ( parameter : Use NNUE ) the conventional evaluation function. After less than a month, the new “Stockfish + NNUE” showed an improvement of more than a hundred Elo points compared to the previous one (without NNUE) . An increase in skill level by such a value usually takes around two years of traditional development work and proves the potential of the new method.

This was followed by other chess engines such as RubiChess (version 1.8 NNUE), Minic (version 2.48 NNUE), Orion (version 0.7.nnue) and Igel (version 2.70 NNUE), some of which increased their skill level by more than two hundred Elo points with the help of NNUE could increase. Programs such as Zeus (version 9.3 NNUE), Cfish (version 180820 NNUE), AI (version 13.3 NNUE), ShashChess (version 13 NNUE), BrainLearn (version 10 NNUE) and CorChess (version NNUE 170820) use NNUE with success and thus achieved top places in computer chess tournaments.

principle

Alpha-Beta Search

The Minimax algorithm is basically used to determine the optimal game strategy for finite two-person zero-sum games with perfect information . These games include board games in which both players know the complete course of the game as well as the current position. Examples are Chess , Go , Othello , Checkers , Mill, and Connect Four . An optimized variant of this algorithm is the alpha-beta search (picture) .  

An important and time-critical component of the algorithm is the calculation of the evaluation function at the end of each branch of the search tree  (at the bottom of the picture) . The better the position on the board is for the player under consideration, the greater the value of this function. If the position is balanced, the value is zero. The next move is sought, which, assuming optimal counterplay, gives the highest value and thus maximizes the probability of winning. Since millions of different positions often have to be viewed and evaluated for this, time efficiency when calculating the evaluation is of crucial importance.

If the algorithm and the rest of the game program run completely on GPUs, it is useful to have the evaluation function calculated with their help. However, most programming GPUs, especially for computer games - software , much more complex, complicated and error-prone than using CPUs. Many powerful game programs (for historical reasons, since no GPUs were available at that time) were also created and optimized on CPUs. A port of the program code is therefore not appropriate and would be very costly.

In addition, for game programs generally no powerful GPUs should be required for the program to run. Therefore they usually run on CPUs. However, if you want to use neural networks for the evaluation function and implement them on GPUs, as is almost always done, there is a “ bottleneck ” in the ongoing data transfer between CPU and GPU, which thwart the efficiency of the game program.

An innovative aspect of NNUE is based on the idea of avoiding the bottleneck by also running the neural network, unlike usual, on the CPU, so that communication with the rest of the program is possible without any delay.

literature

  • Yu Nasu: ИИUƎ - Efficiently Updatable Neural-Network-based Evaluation Functions for Computer Shogi . Publication for the 28th Computer Shogi World Championship. April 28, 2018. PDF; 250 kB (Japanese and partly English).

Web links

Individual evidence

  1. Yu Nasu: ИИUƎ - Efficiently Updatable Neural-Network-based Evaluation Functions for Computer Shogi . Publication for the 28th Computer Shogi World Championship. April 28, 2018.
  2. Stockfish goes NN (English): “A new revolution in computer chess is taking place…”. Accessed on September 22, 2020.
  3. Much stronger Stockfish NNUE now as option in Stockfish development builds , accessed on October 2, 2020.
  4. stockfish-nnue-2020-05-30 (English), accessed on October 2, 2020.
  5. Stockfish 12 (English), accessed on October 2, 2020.
  6. Introducing NNUE Evaluation on the Stockfish Blog , accessed August 29, 2020.
  7. Stockfish swallows NNUE and improves its performance by 100 Elo points , accessed on August 29, 2020.
  8. Orion 0.7: NNUE experiment , accessed September 26, 2020.
  9. Igel and NNUE , accessed on September 24, 2020.
  10. Speedy Ratings , accessed on September 22, 2020.
  11. Zeus 9.3 NNUE wins JCER Fritz Tournament , accessed on September 22, 2020.
  12. Conrad Schormann: Stockfish 12 - the best of two worlds, in Perlen vom Bodensee - the chess magazine from September 5, 2020, accessed on September 17, 2020.