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…
Where did you source the commentary dataset?
Show HN: ChessCoach – A neural chess engine that comments on each player's moves
71–80 of 92 posts
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#72> 3... e6: "A solid move, and I have never seen it before. It has been played by many strong players, including GMs, Zvjaginsev, and others. It seems quite good overall, but occasionally there are fun AI-isms like this :)
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#73Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#74One bug found: https://lichess.org/NvbQTf2O/black
> PlayChessCoach 23. Nc7: "The point of White's previous move. The knight on d7 is trapped and the rook on a8 is not protected."
There is no knight on d7 or no knight that could be moved there. (Or so it seems to me.)
In that same game this was funny banter:
> PlayChessCoach careful not to get mated in the long run."
Thank you for writing architectural overview, enjoying it!
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#75I'm particularly interested in the second neural net that generates explanations. Is it only a neural net to generate the natural language using artifacts from the original engine net, or is it actually inspecting the state of the engine net to derive the insights?
It's an interesting application of explainability of AI algorithms that Christian talks about in his chapter on transparency. In particular, he discusses "saliency" of algorithms (knowing what parts of the input were most important in producing a prediction) and "multitask nets" that output multiple predictions (so, maybe here, one output is the best move, and another output is the explanation).
The writeups are fantastic reading. I see almost no sources in common with the bibliography in The Alignment Problem (which has a 50 page bib) which makes them nice complements. Only common citations I could find were Sutton 1988 (Temporal Differences) and Silver et al 2016 (AlphaGo), 2017 (AlphaGo Zero) and 2018 (AlphaZero).
There's a note (44) from chapter 5 entitled "Shaping" where Christian talks about "meta-reasoning: the right way to think about thinking. When you play a game–for instance, chess–you win because of the moves you chose, but it was the thoughts you had that enabled you to choose those moves...Figuring out how an aspiring chess player–or any kind of agent–should learn about its thought process seemed like a more important but also dramatically harder task than simply learning how to pick good moves." This note might as well be direct inspiration for this project. It goes on to quote Stuart Russell about "a computation that changes your mind about what is a good move to make...reward that computation by how much you changed your mind...so you could change your mind in the sense of discovering that what was the second-best move is actually even better than what was the best move." That's in the context of a cautionary tale where only optimizing for those "changes of mind" doesn't necessarily find a correct outcome, and that you have to "arrange these internal pseudorewards so that along a path, they add up to the same as true, eventually." This sounds pretty much like the task of a coach.
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#76This 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…
Can you have it play more games by giving it less time per turn (~2500 rating is plenty good for an opponent/coach) and playing games concurrently while it waits for human to play? how much does a game cost in CPU time money? How do I get the commentary for a game I played? Oh, it's in Analysis page. It plays chess very well, but the commentary is incoherent and doesn't match the game well -- The attacks described ar…
Agreed, this looks superficially like commentary on the game, but honestly it doesn't seem more pertinent to the game score than a Markov chain trained on all the commentary would be (presumably this isn't true, and the author started with something like that Markov chain and the current version is way better in terms of some fitness function).
I wonder if there just is not enough training data available. GPT-3 overcomes this by harvesting a ridiculous amount of training data. AlphaZero, and the chess engine here, which is excellent, overcome it by generating their own training data through self play. But that's not applicable to the task of generating commentary.
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#77Earlier quoted context omitted.
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 o…
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#78This 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…
Where did you source the commentary dataset?
To me it's probably OK to train a model on this, at least for hobby purposes, though some GitHub Copilot critics might disagree. And a large part of ChessBase's business model is based on ripping off other people's IP and presenting it as their own [1]. But still, I can see why the author might want to be coy about answering this question.
[0] https://en.chessbase.com/post/new-mega-database-2021
[1] https://lichess.org/blog/YCvy7xMAACIA8007/fat-fritz-2-is-a-r...
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#79Remarkably 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?
Re: Show HN: ChessCoach – A neural chess engine that comments on each player's moves
#80That's overall less general than "feed position network output into a transformer", but presumably less data-constrained.