Live data from Hacker News

Show HN: ChessCoach – A neural chess engine that comments on each player's moves

chrisbutner.github.io

1–10 of 92 posts

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#2
This took about a year and a half – a little over a year coding in between experiments and training.

It's a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero's, but it adds on a secondary "commentary decoder" network based on Transformer architecture to comment on positions and moves. All of the code and data for training and search is from scratch, although it does use Stockfish code to generate legal moves and manage chess positions.

You can watch it play on Lichess here: https://lichess.org/@/PlayChessCoach/tv or challenge it here: https://lichess.org/?user=PlayChessCoach#friend, and see its commentary in spectator chat. It only plays one game at a time, so you may need to wait a little bit. It's fairly strong (~3450 rating, roughly on par with Stockfish 12 or SlowChess Blitz 2.7), but you can set up a position when challenging it so that it's missing a couple pawns or a piece (Variant: From Position).

I ended up writing much more about it than I expected. If you're into the technical side of chess or machine learning, beyond the linked overview, there's:

High-level explanation: https://chrisbutner.github.io/ChessCoach/high-level-explanat...

Technical explanation: https://chrisbutner.github.io/ChessCoach/technical-explanati... (including code pointers)

Development process: https://chrisbutner.github.io/ChessCoach/development-process... (including timelines, bugs and failures)

Data: https://chrisbutner.github.io/ChessCoach/data.html (including raw measurements and tournament PGN files)

And the code is here: https://github.com/chrisbutner/ChessCoach (C++ and Python, GPLv3 or later)

Happy to answer any questions!

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#3
post #2

This took about a year and a half – a little over a year coding in between experiments and training. It's a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero's, but it adds on a secondary "commentary decoder" network based on Transformer architecture to comment on positions and moves. All of the code and data for training and search is from scratch, although it does use Stockfish code…

I'm super impressed with what you've managed to create, do you have any further plans with this project? I'm curious now that it's finished and documented to such an extent will you try to bring it publicity and actual usage or was this just a passion project. Thanks

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#4
post #3
post #2

This took about a year and a half – a little over a year coding in between experiments and training. It's a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero's, but it adds on a secondary "commentary decoder" network based on Transformer architecture to comment on positions and moves. All of the code and data for training and search is from scratch, although it does use Stockfish code…

I'm super impressed with what you've managed to create, do you have any further plans with this project? I'm curious now that it's finished and documented to such an extent will you try to bring it publicity and actual usage or was this just a passion project. Thanks

Thank you! I do get that itch to jump in and improve things whenever I see it lose a game, but I don't have further plans (development or commercial) in the near-term. The goal originally was to see whether I liked ML, to decide on my next industry/career move, but there was a lot of "one more month".

I'm actually hopeful that some search techniques such as SBLE-PUCT[1] or better derivations can make their way into other open source projects, but they've had big teams working for a while on similar, often better ideas, so we'll have to see.

[1] https://chrisbutner.github.io/ChessCoach/high-level-explanat...

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#6

If I click on "Challenge", and set up a game with unlimited time control (or correspondence), the challenge is declined with: > This time control is too fast for me, please challenge again with a slower game. Is that expected?

Oh, that message is a little backwards, but the main bot only accepts challenges from 1+0 or 0+1 up to 15+10 time control.

You can challenge https://lichess.org/?user=chesscoachclassical#friend to 30+20.

Unfortunately, neither of them support correspondence.

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#7
Very cool - one bug, it seems to want to show line variations in the chat, but it only shows the last move, which is then linked to the actual move in the game.

e.g. on move 22

I don't know why black played this. As black, I would've played 27...Kf8 to protect f6 and e5.

the 27..Kf8 is a link ... but the game hasn't proceeded to move 27 yet, so the link goes nowhere.

Clearly it's trying to show some line that ends with 27....kf8 ?

Anyway, the commentary itself is pretty excellent, great job!

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#9

Very cool - one bug, it seems to want to show line variations in the chat, but it only shows the last move, which is then linked to the actual move in the game. e.g. on move 22 I don't know why black played this. As black, I would've played 27...Kf8 to protect f6 and e5. the 27..Kf8 is a link ... but the game hasn't proceeded to move 27 yet, so the link goes nowhere. Clearly it's trying to show some line that ends wi…

Yeah the auto-linking is just Lichess doing its best, even when the bot's talking nonsense sometimes.

And thank you!

Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves

#10

Remarkably cool. My only bit of feedback is that it's unfortunate so much of the commentary uses masculine pronouns (I found it distracting). Is that just a consequence of the training data?

Yeah, that's a massive problem with the natural language domain all across machine learning.

Unfortunately it's very difficult to track down training data for chess commentary in the first place, let alone trim down biases. For reference, I was able to gather about 1 million samples, but it really needs a billion.

Hopefully through data augmentation and better general intelligence models we can make better progress on bias issues soon, as that's a huge problem when we start trusting AI models too much in life.

Post reply on HN