Chess Fighter Neural Net

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Alexander Lim
Posts: 16
Joined: Sun Mar 10, 2019 12:16 am
Full name: Alexander Lim

Chess Fighter Neural Net

Post by Alexander Lim » Fri Mar 15, 2019 12:10 am

Hi everyone,

I would like to announce a new chess engine: Chess Fighter! It's a neural net engine based on AlphaZero although there are many many changes in my implementation. It's written in C++ and uses Dlib for the neural net. The project is private and the source code (and some of its novel techniques) will remain private for now. It does not use any Stockfish or Leela code.

It's probably around ELO 2500-2600 and although it's still training, its possible it may not go much further using my current methods and network size. It's trained entirely on self-play games from random weights and this has been done all on one PC with one 1080ti GPU!

Chess Fighter learns very fast: it takes about 1.5 minutes for one iteration and each iteration is about 19.2 games. Its had many many training runs which I've stopped and started and abandoned as I discovered new bugs and ideas. The current run (which I'm going to try to see to the end) is on iteration 14,000 == 268,000 games == 350 hours.

Generation 9852 (approx 190,000 games) won a 10 game match against AnMon (ELO 2537) +4-2=4, 2 min + 3 sec. And (I think) it started to have the occasional wins against 2500 engines around gen 6000 or so. There was a major bug discovered around gen 7000 that had the effect of CF not caring too much about being a pawn down. And another minor bug relating to the inputs was found later. Fortunately both issues were recoverable through further training (so no restart needed!) and there was a noticeable increase in strength (especially as it stopped giving away free pawns!)

It does use custom input planes in addition to the pieces though I do have a version that takes only the pieces as input and it trains just as fast. The fully zero version is on hold for now whilst I finish of this semi-zero version.

There is one very noticeable difference between Chess Fighter and Leela (aside from strength) and that is Chess Fighter does not troll! It is strictly a no-troll engine :mrgreen: . Of course in some situations when it can't find the way forward it may shuffle a bit but in general it always goes for the win (including in endgame play) in a very efficient manner just like a classical engine.

Here are some details:

Name: Chess Fighter
Other names: Chess Fighter Zero
Gender: Male (sorry guys)
Value net: 4x64
Policy net: 6x96
Search algorithm: MCTS/PUCT
Learning: RL Self-play games (800 node play-outs)
ELO: 2500-2600
Training time: 268,000 games / 350 hours.
Creation date: 20-02-2019 at 2:26 am. Chess Fighter became self-aware a few hours later and then started to display unusual signs of an aptitude towards chess.

Acknowledgements:
Davies E King, author of the dlib C++ machine learning library.
Deep Mind for making public the methods used in AlphaZero.
Author of the Vice chess engine for making the excellent youtube series on programming a chess engine in C.

If you're looking to beat Stockfish you probably might need 1000's of GPU's but if you want to create a GM level engine (or possibly up to 3000 ELO) that plays very natural moves then you can definitely do it in the comfort of your own bedroom!

I will post some of the Chess Fighter games in a bit.

Alex

dkappe
Posts: 147
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: Chess Fighter Neural Net

Post by dkappe » Fri Mar 15, 2019 2:08 am

Excellent news. The more the merrier.

supersharp77
Posts: 588
Joined: Sat Jul 05, 2014 5:54 am
Location: Southwest USA

Re: Chess Fighter Neural Net

Post by supersharp77 » Fri Mar 15, 2019 5:01 am

Alexander Lim wrote:
Fri Mar 15, 2019 12:10 am
Hi everyone,

I would like to announce a new chess engine: Chess Fighter! It's a neural net engine based on AlphaZero although there are many many changes in my implementation. It's written in C++ and uses Dlib for the neural net. The project is private and the source code (and some of its novel techniques) will remain private for now. It does not use any Stockfish or Leela code.

It's probably around ELO 2500-2600 and although it's still training, its possible it may not go much further using my current methods and network size. It's trained entirely on self-play games from random weights and this has been done all on one PC with one 1080ti GPU!

Chess Fighter learns very fast: it takes about 1.5 minutes for one iteration and each iteration is about 19.2 games. Its had many many training runs which I've stopped and started and abandoned as I discovered new bugs and ideas. The current run (which I'm going to try to see to the end) is on iteration 14,000 == 268,000 games == 350 hours.

Generation 9852 (approx 190,000 games) won a 10 game match against AnMon (ELO 2537) +4-2=4, 2 min + 3 sec. And (I think) it started to have the occasional wins against 2500 engines around gen 6000 or so. There was a major bug discovered around gen 7000 that had the effect of CF not caring too much about being a pawn down. And another minor bug relating to the inputs was found later. Fortunately both issues were recoverable through further training (so no restart needed!) and there was a noticeable increase in strength (especially as it stopped giving away free pawns!)

It does use custom input planes in addition to the pieces though I do have a version that takes only the pieces as input and it trains just as fast. The fully zero version is on hold for now whilst I finish of this semi-zero version.

There is one very noticeable difference between Chess Fighter and Leela (aside from strength) and that is Chess Fighter does not troll! It is strictly a no-troll engine :mrgreen: . Of course in some situations when it can't find the way forward it may shuffle a bit but in general it always goes for the win (including in endgame play) in a very efficient manner just like a classical engine.

Here are some details:

Name: Chess Fighter
Other names: Chess Fighter Zero
Gender: Male (sorry guys)
Value net: 4x64
Policy net: 6x96
Search algorithm: MCTS/PUCT
Learning: RL Self-play games (800 node play-outs)
ELO: 2500-2600
Training time: 268,000 games / 350 hours.
Creation date: 20-02-2019 at 2:26 am. Chess Fighter became self-aware a few hours later and then started to display unusual signs of an aptitude towards chess.

Acknowledgements:
Davies E King, author of the dlib C++ machine learning library.
Deep Mind for making public the methods used in AlphaZero.
Author of the Vice chess engine for making the excellent youtube series on programming a chess engine in C.

If you're looking to beat Stockfish you probably might need 1000's of GPU's but if you want to create a GM level engine (or possibly up to 3000 ELO) that plays very natural moves then you can definitely do it in the comfort of your own bedroom!

I will post some of the Chess Fighter games in a bit.

Alex
Interesting project...you mean it played 270,000 games in one month? (less than a month) based on alpha0 or leela0
(or both)? no code on github?.....opening book? Been playing games online? Self play only? Whats the objective for your 'project'? Thx AR :D :wink:

Alexander Lim
Posts: 16
Joined: Sun Mar 10, 2019 12:16 am
Full name: Alexander Lim

Re: Chess Fighter Neural Net

Post by Alexander Lim » Fri Mar 15, 2019 6:16 am

Interesting project...you mean it played 270,000 games in one month? (less than a month) based on alpha0 or leela0
(or both)?
Yes that sounds about right though I didn't have it running all the time otherwise it would of been allot quicker! It churns out around 12-13 games per minute which includes the training as well. The main bottleneck turns out to be the training process itself. Game generation has to stop whilst it's actually training on the data.
Remember the nets I'm using are quite small (4x64). The whole process can easily double or triple when larger nets are used.
no code on github?
No. I'm not a professional programmer. This is a hobby.
.....opening book?
What is it with you and opening books?? (your prev post). Anyway, I'm not sure what your getting at in the context of this post. Please clarify I would like to answer.
Been playing games online?
Show me how! Chess Fighter would love to play online :D .
Seriously, Chess Fighter has not played online and I don't (yet) know how to implement that kind of stuff. Though I hope to get some help through this forum.
Self play only?
Yes.
Whats the objective for your 'project'? Thx AR :D :wink:
Is that a serious question?

User avatar
AdminX
Posts: 5075
Joined: Mon Mar 13, 2006 1:34 pm
Location: Acworth, GA
Contact:

Re: Chess Fighter Neural Net

Post by AdminX » Fri Mar 15, 2019 9:41 am

How does it perform tactics-wise? Do you mind sharing some sample games?

Thanks and best wishes.

UPDATE: I just saw your other post "Chess Fighter Games" :oops:
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers

corres
Posts: 1188
Joined: Wed Nov 18, 2015 10:41 am
Location: hungary

Re: Chess Fighter Neural Net

Post by corres » Fri Mar 15, 2019 10:22 am

Congratulations.
Bat what you mean:
"...and that is Chess Fighter does not troll. It is strictly a no-troll engine."?

Damir
Posts: 2015
Joined: Mon Feb 11, 2008 2:53 pm

Re: Chess Fighter Neural Net

Post by Damir » Fri Mar 15, 2019 10:28 am

he means unlike Leela that masturbates in endgames where it plays 300 moves in won game and does not go for the fastest win. Chess Fighter does not do that... :) :) :D

Daniel Shawul
Posts: 3593
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: Chess Fighter Neural Net

Post by Daniel Shawul » Fri Mar 15, 2019 3:24 pm

I have had a similar frustrating experience with reinforcement learning before i deemed it too big a project for one man.

What input planes do you use besides piece placement? I use attack tables and piece counts as additional inputs and they
seem to help accelerate learning.

Do you use replay buffer in your training and how much does it help to stabilize ? I suspect this was one of the key things
I missed when i was doing RL. I was also using value net only (no policy) at the time that makes matters worse. The 6x64 value net
was not improving after 300k games or so.

Good luck.
Daniel

Albert Silver
Posts: 2821
Joined: Wed Mar 08, 2006 8:57 pm
Location: Rio de Janeiro, Brazil

Re: Chess Fighter Neural Net

Post by Albert Silver » Fri Mar 15, 2019 6:28 pm

Daniel Shawul wrote:
Fri Mar 15, 2019 3:24 pm
I have had a similar frustrating experience with reinforcement learning before i deemed it too big a project for one man.

What input planes do you use besides piece placement? I use attack tables and piece counts as additional inputs and they
seem to help accelerate learning.

Do you use replay buffer in your training and how much does it help to stabilize ? I suspect this was one of the key things
I missed when i was doing RL. I was also using value net only (no policy) at the time that makes matters worse. The 6x64 value net
was not improving after 300k games or so.

Good luck.
Daniel
Why use only the value net? IIRC, DeepMind said that one of the key changes in AGZ that led to a big increase was combining both value and policy nets.
"Tactics are the bricks and sticks that make up a game, but positional play is the architectural blueprint."

Daniel Shawul
Posts: 3593
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: Chess Fighter Neural Net

Post by Daniel Shawul » Fri Mar 15, 2019 6:34 pm

Albert Silver wrote:
Fri Mar 15, 2019 6:28 pm
Daniel Shawul wrote:
Fri Mar 15, 2019 3:24 pm
I have had a similar frustrating experience with reinforcement learning before i deemed it too big a project for one man.

What input planes do you use besides piece placement? I use attack tables and piece counts as additional inputs and they
seem to help accelerate learning.

Do you use replay buffer in your training and how much does it help to stabilize ? I suspect this was one of the key things
I missed when i was doing RL. I was also using value net only (no policy) at the time that makes matters worse. The 6x64 value net
was not improving after 300k games or so.

Good luck.
Daniel
Why use only the value net? IIRC, DeepMind said that one of the key changes in AGZ that led to a big increase was combining both value and policy nets.
The dual vs separate resnet is a different question than using only value net.
Sharing the body of resnet and using policy/value heads, instead of two separate resnets for value and policy, helps as they confirmed.
I used to have only value net and used qsearch() for policy when i did selfplay RL -- that has changed now however.
It seems policy net contains a lot of positional knowledge, though it could be inferior to qsearch() interms of tactics.

Post Reply