Leela Chess Zero: AlphaZero for the PC

by Albert Silver
4/26/2018 – It might sound like a joke, but it is not: the revolutionary techniques used to create Alpha Zero, the famous AI chess program developed by DeepMind, are now being used to engineer an engine that runs on the PC. This project has now been underway for about two months, and the engine, Leela Chess Zero, is already quite strong, playing at 2700 on good hardware, and is freely available. As will be seen, just about every aspect of this new engine is revolutionary and breaks all the paradigms that had dominated the field until now.

ChessBase 17 - Mega package - Edition 2024 ChessBase 17 - Mega package - Edition 2024

It is the program of choice for anyone who loves the game and wants to know more about it. Start your personal success story with ChessBase and enjoy the game even more.

More...

From Alpha Zero to Leela Zero

When Alpha Go, and then Alpha Go Zero, was released, it cracked one of the most challenging strategic games in the world, and one that experts all over had thought would resist for at least another decade. It was the result of a powerful artificial intelligence technique known as deep reinforcement learning, which built a neural network combined with the Monte Carlo Tree Search that allowed the program, equipped with just the barebones rules of the game, to play itself millions upon millions of times, learning as it went until it reached, as was the case, superhuman playing strength.

All the more remarkable was that the Deep Mind group published peer-reviewed papers that detailed exactly how it was achieved. In a sense, this was the equivalent of IBM creating the world-beating Deep Blue, and then publishing blueprints the very same day so that anyone could build their own. As a sidenote, Feng Hsu and the Deep Blue team did eventually publish papers describing the entire thing inside and out. Nevertheless, it was believed that while a game such as Go, might fit this form of software engineering, it would never really work for a chess program. At least not at the highest level. After all, Go is less about calculating exact lines, and more about extensive pattern recognition, while chess is highly tactical and seeing just a single extra move ahead can make or break a program.

Then along came Deep Mind, who poured in their resources and built a world-beating engine that learned the game itself within 24 hours. Naturally, there were plenty of special conditions in play, such as having access to thousands of incredibly powerful processors to help develop its ability in such a short time, but they did it. Consider that if Murray Campbell and Co. had thought that just piling in special hardware would somehow solve chess for them in 24 hours, they would have done it. Deep Blue had a system performance of 12 GFLOPS, while the horsepower DeepMind used easily exceeded 40 million GLOPS.

DeepMind's professor David Silver explains the new 'Zero' approach in AlphaGo Zero, which preceded Alpha Zero (chess)

The new Alpha Zero chess program lead to an astounding media frenzy, and just as much controversy in the chess world. Much was made about the conditions of the match against a 64-thread version of Stockfish used to test its strength, but this was to completely overlook the important aspect of it all: a new world-class engine, using a completely new method and technique, had been developed in 24 hours. What was more, anyone was invited to make their own.

The paper "Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm" at Cornell University

This was not nearly as easy as might seem. For one thing, a single person could hardly do it at home with a single machine, or even a room full. Then there is the matter of trying to translate Deep Mind’s explanations in their paper into concrete computer code.

But some programmers took up the challenge, and after developing a Go program, Leela Zero, the strongest one publicly available now, based on community effort and contributions, it has been transferred to chess.

Leela Chess Zero is based on the seminal Alpha Zero paper, using the same self-learning techniques and the same Monte Carlo Tree Search technique. It is hosted at the LCZero site and there one can not only find the engine but the latest version of the neural networks — the brain if you will.

How strong is Leela Chess Zero?

The project is still in its infancy, having only really started two months ago. As it depends very much on help by others to contribute computer time, the beginning was slow as time was needed for word to get around, tools developed to make it easy, etc. Because of the unique nature of the engine’s design, using a huge evaluation function (over 80MB), it gains exponentially in strength when used with a good graphics card.

Without a graphics card, using only my CPU, I barely get 20% the performance I get with the GPU (graphics processing unit). On a laptop equipped with a quad-core i7 and a fast GTX980M graphics card, it plays at around 2700 Elo or so. Remember that this is after just two months of self-learning. However, the engine’s play is quite different from anything I have seen or tested before, and I am speaking from over 20 years experience.

Without exception, until now, an engine’s strength was clearly determined by its speed and tactics. Sure an engine could compensate a slight tactical deficiency with more knowledge, but not by much, and more often than not, the ‘dumber but faster’ engine would compensate its ignorance with slightly deeper calculations. This give and take has defined engines on the PC since the beginning of computer chess.

Therefore you can imagine what I thought after the following: I gave a fairly weak engine — Firefly (rated 2250) — a basic tactics test of 100 positions, a set so easy I would expect myself to score 100, and it scored 94/100. I then fed it to Leela Zero, which barely scored 41/100. I grimaced, knowing this meant Leela was going to get trounced, but still decided to play a small match of 10-minute games just to gauge its play. I found myself forced to stop the match early after it was 10-0 for…. Leela!?! I check and triple-checked the settings to make sure everything was fine. 

I then tried another engine, Delphil 3.2 (rated 2494) with the same 10-minute conditions, and stopped it after 20 games with Leela bullying it 15½-4½. What on earth was going on?? I never heard of an engine compensating hundreds of Elo of tactical gaps with pure positional play. That is a human thing, not a machine. Eventually, it found its match with Nebula, a 2700+ engine with a  14½-14½ score, enough to suggest this is about where it stands.

With a description of an engine compensating tactical weaknesses with massive positional play, you might expect games that looked like Carlsen or Capablanca, with controlled complications, and then a boa constrictor win later, right? Not even close! Leela Zero makes Topalov, the king of exchange sacrifices, look like a timid milkmaid. It plays a ton of speculative moves, readily giving up pawns, exchanges and more for activity and play. Please note the word speculative, because I doubt very much these are all correct. However, they do make for very entertaining games, and what is more, it plays the endgame impressively well.

Take a look at the following game, which sort of illustrates some of the surprises it can come up with:

Nebula 2.0 vs Leela Chess Zero (NN189)

[Event "Match"] [Date "2018.04.25"] [Round "6"] [White "Nebula 2.0 64bit"] [Black "Lczero 0.7 NN189"] [Result "1/2-1/2"] [ECO "A30"] [WhiteElo "2726"] [BlackElo "2700"] [PlyCount "191"] [EventDate "2018.??.??"] 1. c4 c5 2. Nf3 Nf6 3. g3 b6 4. Bg2 Bb7 5. Nc3 e6 6. O-O Be7 7. d4 cxd4 8. Qxd4 d6 9. Rd1 a6 10. b3 Nc6 11. Qd3 Qc7 12. Bf4 Rd8 13. Qc2 O-O 14. a3 Nb8 15. e4 h6 16. Rac1 Nbd7 17. h3 Nc5 18. Re1 Ncd7 19. Be3 Rfe8 20. Nd4 Qb8 21. f4 Rc8 22. Rcd1 b5 $5 {[#] It is more than a little astonishing to see an engine play this thematic double-strike with ...b5 and ...d5 in the hedgehog. It isn't quite correct, though Black does get play for it.} 23. cxb5 d5 $1 {In for a penny, in for a pound.} 24. e5 Ne4 25. Bxe4 dxe4 26. Nc6 Bxc6 27. bxc6 Rxc6 28. Rxd7 Bxa3 29. Rd4 Rec8 30. Rc4 Rxc4 31. bxc4 Rxc4 32. Qb1 Rb4 33. Qa2 Bb2 34. Nd1 Qb5 35. Kg2 h5 36. Kh2 Rb3 37. Bf2 Rb4 38. Kg2 a5 39. Nxb2 Rxb2 40. Qa3 Rb3 41. Qe7 Qc6 42. Qc5 Qb7 43. Qa7 Qc6 44. Be3 a4 45. g4 h4 46. Rc1 Qd5 47. Qe7 Rb8 48. Qxh4 a3 49. Qe1 Qd3 50. Rd1 Qb3 51. Qd2 a2 52. Ra1 Ra8 53. Qc1 Rd8 54. g5 Rd3 55. Bf2 e3 56. Be1 Qb7+ 57. Kh2 e2 58. Rxa2 Qf3 59. Qc8+ Kh7 60. Qc2 Qxh3+ 61. Kg1 Qf1+ 62. Kh2 Qh3+ 63. Kg1 Qg4+ 64. Kh1 Qf3+ 65. Kg1 Qf1+ 66. Kh2 Qxf4+ 67. Kg2 Qxg5+ 68. Kh1 Qh6+ 69. Kg1 Qe3+ 70. Kg2 Qe4+ 71. Kf2 Qf4+ 72. Kg2 Qf3+ 73. Kg1 Qg4+ 74. Kh2 Qh5+ 75. Kg1 Qg6+ 76. Kh2 Qh5+ 77. Kg1 Qg5+ 78. Kh1 Qh6+ 79. Kg1 Qe3+ 80. Kg2 Qe4+ 81. Kf2 Qd5 82. Ra4 Qf3+ 83. Kg1 g5 84. Ra3 Qf1+ 85. Kh2 Qxe1 86. Qxd3+ Kh6 $4 {An unfortunate blunder that allows White to save the game.} ({After} 86... Kg7 $1 {Black would win.}) 87. Qd4 Qf1 88. Rg3 e1=Q 89. Qh4+ gxh4 90. Rg6+ Kh7 91. Rg7+ Kh8 92. Rg8+ Kh7 93. Rg7+ Kh6 94. Rg6+ Kh5 95. Rg5+ Kh6 96. Rg6+ 1/2-1/2

Bear in mind that while it misses some easy tactics it also catches some hard ones very quickly.

 

In the position above, White (Leela) played the lovely 38.c5!! And went on to win after 38…dxc5 39.Rd7!

Interview with Gary Linscott

I caught up with Gary Linscott (pictured), the person who spearheaded the Leela Chess Zero project and helped make it what it is today. (Please note that another interview with Gian-Carlo Pascutto, creator of Leela Zero — which led to Leela Chess Zero — will appear soon.)

Albert Silver: Hi Gary, congratulations on the fascinating project. How did it come into existence? Concept, execution, etc

Gary Linscott

Gary Linscott: The AlphaZero paper was a landmark — it was the first time traditional techniques had been defeated in over 20 years. I had wanted to learn about reinforcement learning, and this provided a great motivation. I even started a small version of this project in python with a co-worker, but we weren't generating anywhere near enough games to make reasonable progress. Then, Leela Zero really started to take off. A user named benediamond got the ball rolling with a non-working prototype of chess support for Leela Zero. It needed a fair bit of additional work, which I did, and then coded up the server and client in Go [the coding language, not the game -Ed.] to learn more about that language. Then, I launched it on Talkchess, and the support has been incredible since then!

AS: How is Leela Chess Zero being developed? Is it just you, or others, or...? 

GL: There is an extremely active community! Folkert Huizinga (Error323) was one of the earliest to join and has been the driving force behind the training process, which generates the new networks. It's an extremely hard, and time-consuming part of the project, and he's done an amazing job. We got a donation of the training hardware as well, which has been fantastic. Then a bunch of great developers have stepped up to help out as well, special mention to Andy Olsen (KillerDucky) and Alexander Lyashuk (mooskagh).

AS: How close is it to Alpha Zero, or how different? 

GL: It's quite close to AlphaZero in concept. The paper doesn't really reveal all the little details, so we aren't 100% sure. For example, there is a critical change in the network architecture that was required for chess that wasn't in the paper (the number of layers in the policy head for the technically inclined).

AS: What has been the biggest challenge so far in creating/developing it?

GL: Keeping up with the community! There is a lot of passion, but it's a part-time project on my side. Others have really stepped up and made huge contributions thankfully.

AS: Roughly how strong is Leela Chess Zero right now in FIDE Elo terms?

GL: It depends (smiley). It's very sensitive to the hardware, and the time control used. However, in recent blitz/bullet matches, it was able to defeat human IM/GMs convincingly. Against other machines, it's still a long ways from the top — estimates vary between 2600 and 2800, while something like Stockfish is ~3300.

AS: How much strength does a decent video card add? 

GL: A huge amount! For example, the TCEC competition is playing it on ~40 cores, and it would be roughly the same speed on a 1080Ti.  We will also improve the efficiency significantly on GPU as time goes on, with things like CUDNN, and TensorRT.

AS: What has been the biggest surprise so far?

GL: How much interest and passion there is around this project. It's been fantastic to watch the community really get excited, and all the chess personalities who have tried playing it.

AS: While testing the engine in Fritz, I noticed a number of very strange tactical oversights, even in fairly simple positions. Is this normal, and if so, when would they be overcome?

GL: Definitely normal, the network is still learning tactics, especially at low depths. Also, we are on a much smaller network than DeepMind used (10x128 instead of 20x256).

AS: How many games did AlphaZero need to be trained to its famous level, and how many has Leela Chess Zero used? Also, at the current rate of development, how long would it take to reach that level (presuming similar hardware)?

GL: From their paper, 44 million if I recall correctly, while we are at 8.2 million as of this email. However, we've also had some significant bugs during the training process, and have been learning a lot as we go. I wouldn't be surprised if our run took longer.

AS: Can you tell a bit about yourself

GL: I've always loved the combination of distributed systems and chess. A few years back I also developed "fishtest", which helped take Stockfish to number one on the rating lists (although these days, a wonderful community has taken it on). My professional work is on developing autonomous cars, which is extremely fun and challenging.

How to install Leela Chess Zero in Fritz/ChessBase

Leela Chess Zero can be installed as a UCI engine in Fritz or ChessBase, though it does require a few extra steps. Also, you most definitely want a video card to run it properly. The faster the better, but anything beyond Intel integrated graphics should be a plus.

1) Download the latest Windows build (there are Mac versions too), it comes with the needed DLLs: https://github.com/glinscott/leela-chess/releases.

If you have a discrete GPU (graphics card), get the gpu-win.zip version instead

Unzip into a folder of your choice. I created one called \LCZero.

2) You may also need to download and install the VC Redistributable 2015 x64. Many other programs rely on this library so you may have it already.

3) You will now need to double-click on the LCZero.exe engine one time. It is vital this be done before trying to install it as a UCI engine.

4) Go to the Network page and download the latest network file. Naturally, you can download any version really, even when it was rated a big fat zero. Right-click on the blue Network number and save.

You then unzip it to the main Leela folder. Now you will have a very large file with a long name that looks like a secret code. Rename it to weights.txt

5) If you have a GPU, then I strongly suggest you download this .bat file and unzip it in the same folder as Leela and then run it. This is a simple command that will have the computer run a full tuning of your computer to get best results with Leela. It may take 20-30 minutes, so be patient.

Running the script will do a full tune of your graphics card to get optimal results. Please note this can improve performance to almost double even!

You are now ready to install it in Fritz/ChessBase!

6) In Fritz/ChessBase, select Create UCI engine 

Then find LCZero.exe file, and that is it!

When you want to update the neural network with the latest version, all you need to do is download the newest Network file, and rename it again.

Contributing to Leela Chess Zero

If you would like to contribute some of your computer time to help Leela, just double-click on the client.exe file in the folder. It will start running self-play games, and send them to the site. To stop the process, just close the window. For more information, please see the Getting Started page.

Questions and suggestions

If you are having trouble with Leela, or have any questions or suggestions, be sure to check out the official forum for it.

Links


Born in the US, he grew up in Paris, France, where he completed his Baccalaureat, and after college moved to Rio de Janeiro, Brazil. He had a peak rating of 2240 FIDE, and was a key designer of Chess Assistant 6. In 2010 he joined the ChessBase family as an editor and writer at ChessBase News. He is also a passionate photographer with work appearing in numerous publications, and the content creator of the YouTube channel, Chess & Tech.

Discuss

Rules for reader comments

 
 

Not registered yet? Register

dragodon1961 dragodon1961 3/28/2021 09:30
where is chess?
The Chessforce The Chessforce 10/12/2020 05:11
It says Access Denied
slund5499 slund5499 8/10/2019 02:34
Leela Chess network link is down and refuses to load. Who has another source for the nueral netwprk links for Leela?
chessindia chessindia 7/9/2019 05:40
Information on the latest installation instructions can be found here.

https://github.com/LeelaChessZero/lc0/wiki/Getting-Started
sound67 sound67 6/2/2019 09:39
This installation instructions are OUTDATED. Could you please get the information up to date, because the installation info on Leela Chess's homepage are a complete shambles. Thank you!
ppagan ppagan 5/31/2019 12:58
You write: "White (Leela) played the lovely 38.c5!! And went on to win after 38…dxc5 39.Rd7!" Where may one find the complete score for that game?
RJurjevic RJurjevic 10/10/2018 05:11
Just info for the others, if they would not know, Leela project has moved to the link below.

https://github.com/LeelaChessZero/lc0/wiki/Getting-Started
RJurjevic RJurjevic 9/24/2018 02:13
May I ask what sort of file is 256x20-test-dev2-2-1000.pb from 2018-09-08? The last 'brain' that works for me is from 2018-08-11. Is http://162.217.248.187/networks link dead? Thanks.
Igor1978 Igor1978 9/23/2018 04:51
я так не понел как устовить этот движок
mateau mateau 8/25/2018 02:20
As CUDA is proprietary to nVidia GPU's are there plans to move Leela to OpenCL? As OpenCL is open source and runs equally well on both nVidia and Radeon GPU's it would seem a better solution for those already invested in GPGPU with Radeon Pro or Vega GPU's.

OpenCL would increase your Total Addressable Market. I am also wondering how the Radeon Pro Duo with 32gb Ram and dual Vega processors would handle Leela.

I also have to wonder just how much of Leela's playing strength is due to the massively parralel processing available on GPU's vs say a 32 core 64 thread Threadripper running a 2.5x the clock speed of a GPU.

Clearly Leela has demonstrated that GPU's can be programmed for Chess despite what Peter Schreiner seems to think. Mr. Schreiner pointed out to me in an email correspondence that GPU chess programming would be not sensible. "From my point of view the architecture makes not sense for developing a Chess engine."

Clearly Leela has changed this perception.
RJurjevic RJurjevic 8/15/2018 02:57
Please note that http://162.217.248.187/networks seems not to be updating. Thanks.
AntonioM1969 AntonioM1969 8/11/2018 06:22
" However, they do make for very entertaining games, and what is more, it plays the endgame impressively well."....mmmh are you still sure about the last sentence?
RJurjevic RJurjevic 7/18/2018 11:47
Leela is improving, but this time Vafra got her.
RJurjevic RJurjevic 7/18/2018 11:46
Vafra 2.12.0 vs LeelaZero 0.10, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand, both engines thought only on their own move, i.e., no pondering, both engines used six threads, both engines used the same opening book, Fritz 13, in 6 games up to 15 moves, Vafra had access to endgame tablebases, all five- and some six-men, Leela was using a brain of 17/Jun/2018, i.e., NN500, Vafra 2.12.0 is close to its final version

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_21.html
RJurjevic RJurjevic 7/13/2018 11:49
Vafra 2.12.0 vs LeelaZero 0.10 NN486 0-1, a nice victory by Leela. I have an impression that Leela is improving and that it may become close to AlphaZero, at least in style. It seems that it does not make so many tactical mistakes, if any, and that her strategy keeps improving. I think I read somewhere that Leela authors concisely chose a smaller neural network than that of AlphaZero, not sure if switching to a larger neural network would improve the things?
RJurjevic RJurjevic 7/13/2018 11:42
Vafra 2.12.0 vs LeelaZero 0.10, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand, both engines thought only on their own move, i.e., no pondering, both engines used six threads, both engines used the same opening book, Fritz 13, in 6 games up to 15 moves, Vafra had access to endgame tablebases, all five- and some six-men, Leela was using a brain of 12/Jun/2018, i.e., NN486, Vafra 2.12.0 is still a working version

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_18.html
RJurjevic RJurjevic 7/12/2018 08:47
LeelaZero 0.10 NN486 vs Stockfish 9 ½-½ is an excellent result for LeelaZero 0.10 NN486 I think. It would seem that LeelaZero is improving.
RJurjevic RJurjevic 7/12/2018 08:44
LeelaZero 0.10 vs Stockfish 9, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand, both engines thought only on their own move, i.e., no pondering, both engines used six threads, both engines used the same opening book, Fritz 13, in 6 games up to 15 moves, Leela was using a brain of 12/Jun/2018, i.e., NN486

http://www.jurjevic.org.uk/chess/games/1718/Leela/Leela-Stockfish_1.html
RJurjevic RJurjevic 7/12/2018 01:23
Vafra 2.12.0 vs LeelaZero 0.10, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand, both engines thought only on their own move, i.e., no pondering, both engines used six threads, both engines used the same opening book, Fritz 13, in 6 games up to 15 moves, Vafra had access to endgame tablebases, all five- and some six-men, Leela was using a brain of 11/Jun/2018, i.e., NN484, Vafra 2.12.0 is still a working version

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_17.html
IvankoH IvankoH 6/29/2018 07:55
Thanks for the program I had it running, but the stockfish chess is better.

Stockfish - Leela Chess Zero 5.0
jsaldea12 jsaldea12 6/17/2018 03:25
Proposal to FIDE – Amend/update rules on chess compositions/ puzzles

The rules of chess composition contest s are traced back to middle age! At those times, the complexity and beauty of chess puzzles were hard to verify manually, unlike now , with the advent of chess computers, chess puzzles are resolved in a wink of an eye by chess engines. Thus, the various restrictions, simplifications that cripple the beauty of chess puzzles, like illegal position, illegal dual moves? are outmoded, needs to be re-evaluated, needs to be deleted in this age of chess computers..
In this connection, permit undersigned to propose to FIDE to amend, update the rules of chess puzzles to be universally, uniformly applied: unhindered, unexpurgated so that all the beauty of chess puzzles in all its glory is fully revealed.

Jose S. Aldea
6.17, 2018
RJurjevic RJurjevic 5/30/2018 10:51
Test game 10. Vafra 2.12.0 vs LeelaZero 0.10, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand. Both engines thought only on their own move, i.e., no pondering, used six threads, the same opening book, Fritz 13, settings, in 6 games up to 15 moves. Vafra had access to endgame tablebases, all five- and some six-men. Leela was using a brain of 29/May/2018, i.e., NN355. Vafra 2.12.0 is a slightly modified Vafra 2.11.0.

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_11.html
RJurjevic RJurjevic 5/12/2018 10:51
Test game 4. Vafra 2.11.0 vs LeelaZero 0.8, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand. Both engines thought only on their own move, i.e., no pondering, used six threads, the same opening book, Fritz 13, with default settings. Vafra had access to endgame tablebases, all five- and some six-men. Leela was using a brain of 12/May/2018, i.e., NN281.

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_5.html
RJurjevic RJurjevic 5/12/2018 09:36
Test game 3. Vafra 2.11.0 vs LeelaZero 0.8, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand. Both engines thought only on their own move, i.e., no pondering, used six threads, the same opening book, Fritz 13, with default settings. Vafra had access to endgame tablebases, all five- and some six-men. Leela was using a brain of 09/May/2018, i.e., NN278.

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_4.html
RJurjevic RJurjevic 5/11/2018 10:43
@Alpha Zero and others: AlphaZero, as far as I understand, uses deep neural network learning, and a variant of, I think, UCT or the like, Monte Carlo tree search. The UCT, or the like, part is here, as far as I understand, to avoid randomness in the search. Let us assume that in a position a move performs very well on average, but with precise play can be easily refuted, and that other move can be proven to be better. UTC, or the like, I think, addresses this problem, i.e., allows Monte Carlo not to play purely randomly, but with some 'knowledge' of which moves are more promising. In AlphaZero, I think, they also use deep neural network 'knowledge' to aid to choosing of 'good' moves. Now, I am not sure if AlphaZero, when it plays, chooses the moves based on the neural network knowledge only, or also on the UCT, or the like, Monte Carlo real time tree search as well. In a nutshell, as far as I understand, artificial neural networks resemble real neural networks, say in our brains, and have myriad of weights, i.e., numbers, to be set. These weights define how the network will process the input, i.e., what will be the output for a given input. I think that in AlphaZero, eventually, the network is used to predict the best move for a given position. So, in order to train the neural network, one needs to have sample of data on which to check how the network performs, i.e., what it knows, and to adjust the weights to fit the data as good as possible. It would appear that the data set they use for AlphaZero, is UCT, or the like, Monte Carlo tree search in self play. Then, based on the data, the neural network weights are adjusted, or I think they say fed back. Then a new set of data is generated, using self play, but this time with a more knowledgeable neural network, i.e., on average better moves are played, and the feed back, based on this new data, further increases the knowledge of the network, etc., and the process is repeated. For Leela one can download ``the latest version of the neural networks — the brain if you will''. What they meant by that is, I think, that one can download a set of neural network weights, which are obtained by self play. That is, I think, why they need volunteers to give their CPU or GPU time, i.e., to generate the data based on self play, which is then used to tune the network knowledge. That is why AlphaZero needs no other knowledge, say such as that Rooks are good on open files, etc., than the rules of the games, which include which moves are legal in a position, what is checkmate, stalemate, etc.

https://stevenmiller888.github.io/mind-how-to-build-a-neural-network/
RJurjevic RJurjevic 5/11/2018 09:44
@crispyambulance: GPU can be programmed to calculate other things, not only for graphics, etc., and are, as far as I understand, good for simple massively parallel tasks.
RJurjevic RJurjevic 5/11/2018 08:18
Test game 2. Vafra 2.11.0 vs LeelaZero 0.8, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand. Both engines thought only on their own move, i.e., no pondering, used six threads, the same opening book, Fritz 13, with default settings. Vafra had access to endgame tablebases, all five- and some six-men. Leela was using a brain of 09/May/2018.

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_3.html
RJurjevic RJurjevic 5/11/2018 03:05
This may be of some interest.

https://youtu.be/A3ekFcZ3KNw
RJurjevic RJurjevic 5/11/2018 02:02
Test game 1. Vafra 2.11.0 vs LeelaZero 0.8, a proper slow time control chess game, on HP Pavilion dv7 laptop, using Intel® Core™ i7, with four hyper-threaded Cores, no GPU used, probably because there isn't one, which did not suit LeelaZero, I understand. Both engines thought only on their own move, i.e., no pondering, used six threads, the same opening book, Fritz 13, with default settings. Vafra had access to endgame tablebases, all five- and some six-men. Leela was using a brain of 09/May/2018.

http://www.jurjevic.org.uk/chess/games/1718/Leela/Vafra-Leela_2.html
RJurjevic RJurjevic 5/11/2018 01:57
Thank you. Great stuff!
celeje celeje 5/6/2018 12:50
@puertolajas: Sounds like easiest is to use a different version of Fritz.
Yeah, I know, not helpful if 16 is the only one you have or want to use.
puertolajas puertolajas 5/5/2018 11:18
Is there anyone who has been finally able to run Leela Zero under Fritz 16?? It seems like mission impossible!! Not even following the instructions on Chessbase.com
celeje celeje 5/1/2018 04:03
The NN size was upgraded again - 2nd time. So it's more time-consuming again.
Looks like games contributed number is about 2/3 what it was before.
ryuken ryuken 5/1/2018 06:42
@ Albert Silver: ive installed leela on fritz and it runs fine. my only problem is that it is showing 0 knps when analyzing and playing games. and there is no display on moves being analyzed currently. why is that? i just followed your instructions above.
garyklien garyklien 4/30/2018 06:51
Not sure as I only got it to work for a few hours one day, about 140 games. Then the next day it constantly tells me it cant find leelachess.exe file. So....Running someone my rig atm, but cant do nearly as much as if the coalab worked for me and didn't disconnect after 20 games when it does work.
celeje celeje 4/30/2018 05:56
@ garyklien: the fundraising page says they want to test its performance before buying. That's just for training.

Creating self-play games needs the community's computer time.
Reported numbers are confusing.
Anyone can use the free Google Colab Tesla K80 GPU
The lc0 page says this creates 1000-1500 games a day.
But some say their laptops create 1000 games a day.
Dunno how both numbers can be right.

How many self-play games is your computer playing?
garyklien garyklien 4/29/2018 04:06
Cele I thought the supercomputers for chest did better when they bought mini lower-powered processors are gpus to run together
celeje celeje 4/29/2018 12:06
The lc0 fundraising campaign (gofundme.com/leela-chess-zero) for training hardware to run 24/7 is also going well. They're considering e.g. Titan V.

Hope everyone is patient & doesn't push for addons to current self-training. That'd just dilute available hardware.
fons3 fons3 4/28/2018 10:42
Johannes Kiliani on why LC0 does badly on tactics puzzles:

Leela will always be weak(er) playing positions that are very unlike those encountered in the actual training games, since here the neural net has to make deductions from insufficient good information. The policy head only has to miss one important candidate move in a tactical line for the engine not to find that tactic. In regular games against humans or other engines, it's very difficult for the opponent to lead Leela far enough out of her depth for this effect to matter without getting into a losing position anyway, but for a chess problem that she never had any contribution getting into? Likely happens all the time that those just don't look like anything Leela was ever trained on, with predictable results.

At some point in the future, it could probably be tried to train Leela (or a fork of her) on a mix of self-play games and tactical suites like this one. There's a chance that this would make the net at least more familiar with these types of positions, which is what's required to solve such puzzles. May take quite a bit of trial and error though to do that without weakening the general gameplay of the neural net, and it will definitely require a very LARGE database of tactical puzzles to train on.

(from http://talkchess.com/forum/viewtopic.php?start=0&t=67239&topic_view=flat)
garyklien garyklien 4/28/2018 07:36
Hi, Bertman. I belive this should be added as it will be the main way most can connect, otherwise it would just be chessbase users.

https://github.com/glinscott/leela-chess/wiki/Run-Leela-Chess-Zero-client-on-a-Tesla-K80-GPU-for-free-(Google-Colaboratory)

Shows how to let google colab processors run for you, instead of running your personal computer, or you can do both!