Sign in to follow this  
Followers 0
trenton

Testing my first chess AI: Four Pawn Game Solved

2 posts in this topic

I have recently taken an interest in programming chess computers. My dream is to one day combine a C++ model with a LLM to create an advanced chess computer that both finds the best move and can articulate complex strategic reasoning in terms a human can understand. One day this might become a universal chess coach that anybody can access. It would be cool if the method of reasoning were adapted to the player's reasoning style. This would have to combine a chat function similar to Claude or some other bot with a chess engine capable of deep and precise calculation combined with reinforcement learning. I tried to build a prototype of this using Claude programming, but something went wrong and I need to rethink the project. The usage limits are problematic and they slow my progress considerably. I might require a large database of annotated grandmaster games to teach the machine patterns in human reasoning. I am also looking for a team that might be able to help me with this kind of project. For now I scaled back the project to focus on solving something simple first.

This project I am submitting is based on a simple chess variant called the pawn game. This variant uses four pawns for each side. The pawns move the same way as in normal chess including en passant. The objective of this game is to get one of your pawns to the other side of the board. With perfect play, I believe white wins by force. Therefore, if you play against the computer as black, you should lose no matter what you do. I published a study on this chess variant on lichess.org. I originally solved it through human analysis and concluded that white should always win with either 1. e4 or 1. d4. the AI appears to agree with my analysis. My next attempt will be to expand this to the eight pawn game. Although I solved the simple version through my own analysis, the larger version is much more complex and I struggled. Apparently, white can win, but it is not with the intuitive central grab that I assumed. It might be with a flank pawn instead as it maintains flexibility with the central pawns.

Here is version 3 of this project. It might be a little slow to load up at first, but it is working for me.

https://claude.ai/public/artifacts/072e5c52-b844-41b1-b7ac-2d17e01aca50

Are you able to open the link? If so, feel free to test yourself against this computer as either color. If you find a line that allows you draw or win with black, then it indicates that this AI is probably broken or has a bug. I refuted versions 1 and 2 by winning with black. The line I used was as follows, but should no longer be possible in version 3.

1. d4 f5 2. e3 e6 3. f3 d6 4. f4 d5 5. c3 c6 6. c4 dxc4 7. e4 c3 8. d5 c2 9. dxc6 c1

Here is a link to my lichess study if you are interested.

https://lichess.org/study/ORdmNFQD/RcBMDy26

If you are able to access everything just fine, then what do you think of this sort of project so far? Personally, I find myself really sucked into this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0