<story><title>Show HN: ChessCoach – A neural chess engine that comments on each player&apos;s moves</title><url>https://chrisbutner.github.io/ChessCoach/</url></story><parent_chain><item><author>cbutner</author><text>This took about a year and a half – a little over a year coding in between experiments and training.&lt;p&gt;It&amp;#x27;s a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero&amp;#x27;s, but it adds on a secondary &amp;quot;commentary decoder&amp;quot; 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.&lt;p&gt;You can watch it play on Lichess here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;@&amp;#x2F;PlayChessCoach&amp;#x2F;tv&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;@&amp;#x2F;PlayChessCoach&amp;#x2F;tv&lt;/a&gt; or challenge it here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;?user=PlayChessCoach#friend&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;?user=PlayChessCoach#friend&lt;/a&gt;, 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&amp;#x27;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&amp;#x27;s missing a couple pawns or a piece (Variant: From Position).&lt;p&gt;I ended up writing much more about it than I expected. If you&amp;#x27;re into the technical side of chess or machine learning, beyond the linked overview, there&amp;#x27;s:&lt;p&gt;High-level explanation: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;high-level-explanation.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;high-level-explanat...&lt;/a&gt;&lt;p&gt;Technical explanation: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;technical-explanation.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;technical-explanati...&lt;/a&gt; (including code pointers)&lt;p&gt;Development process: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;development-process.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;development-process...&lt;/a&gt; (including timelines, bugs and failures)&lt;p&gt;Data: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;data.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;data.html&lt;/a&gt; (including raw measurements and tournament PGN files)&lt;p&gt;And the code is here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;chrisbutner&amp;#x2F;ChessCoach&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;chrisbutner&amp;#x2F;ChessCoach&lt;/a&gt; (C++ and Python, GPLv3 or later)&lt;p&gt;Happy to answer any questions!</text></item></parent_chain><comment><author>mcyc</author><text>This is a fantastic project. Thanks for sharing!&lt;p&gt;I had a nice long conversation with two of the authors of [0] at ACL.&lt;p&gt;One thing we discussed was the reverse problem. That is, as a player, could I give commands to the model and have the engine figure the moves that would best satisfy them.&lt;p&gt;This ranges from concrete like &amp;quot;take the black square bishop&amp;quot; (there is still variability like which piece should take it or if it&amp;#x27;s even possible) to more complex positional stuff like &amp;quot;set up to attack the kingside.&amp;quot;&lt;p&gt;Any thoughts on this line of research?&lt;p&gt;[0] Automated Chess Commentator Powered by Neural Chess Engine (Zang, Yu &amp;amp; Wan, 2019) &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;arxiv.org&amp;#x2F;pdf&amp;#x2F;1909.10413.pdf&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;arxiv.org&amp;#x2F;pdf&amp;#x2F;1909.10413.pdf&lt;/a&gt;</text></comment>
<story><title>Show HN: ChessCoach – A neural chess engine that comments on each player&apos;s moves</title><url>https://chrisbutner.github.io/ChessCoach/</url></story><parent_chain><item><author>cbutner</author><text>This took about a year and a half – a little over a year coding in between experiments and training.&lt;p&gt;It&amp;#x27;s a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero&amp;#x27;s, but it adds on a secondary &amp;quot;commentary decoder&amp;quot; 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.&lt;p&gt;You can watch it play on Lichess here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;@&amp;#x2F;PlayChessCoach&amp;#x2F;tv&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;@&amp;#x2F;PlayChessCoach&amp;#x2F;tv&lt;/a&gt; or challenge it here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;?user=PlayChessCoach#friend&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;lichess.org&amp;#x2F;?user=PlayChessCoach#friend&lt;/a&gt;, 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&amp;#x27;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&amp;#x27;s missing a couple pawns or a piece (Variant: From Position).&lt;p&gt;I ended up writing much more about it than I expected. If you&amp;#x27;re into the technical side of chess or machine learning, beyond the linked overview, there&amp;#x27;s:&lt;p&gt;High-level explanation: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;high-level-explanation.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;high-level-explanat...&lt;/a&gt;&lt;p&gt;Technical explanation: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;technical-explanation.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;technical-explanati...&lt;/a&gt; (including code pointers)&lt;p&gt;Development process: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;development-process.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;development-process...&lt;/a&gt; (including timelines, bugs and failures)&lt;p&gt;Data: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;data.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;chrisbutner.github.io&amp;#x2F;ChessCoach&amp;#x2F;data.html&lt;/a&gt; (including raw measurements and tournament PGN files)&lt;p&gt;And the code is here: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;chrisbutner&amp;#x2F;ChessCoach&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;chrisbutner&amp;#x2F;ChessCoach&lt;/a&gt; (C++ and Python, GPLv3 or later)&lt;p&gt;Happy to answer any questions!</text></item></parent_chain><comment><author>modeless</author><text>Where did you source the commentary dataset?</text></comment>