GeminiChess, an LLM built engine

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

Moderator: Ras

User avatar
towforce
Posts: 12590
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: GeminiChess, an LLM built engine

Post by towforce »

glav wrote: Wed Oct 01, 2025 10:24 am[pgn]Event "?"]
[Site "?"]
[Date "2025.09.30"]
[Round "1"]
[White "GeminiChess_v2.5"]
[Black "GeminiChess_v2"]
[Result "1-0"]
[ECO "B01"]
[GameDuration "00:02:20"]
[GameEndTime "2025-09-30T13:05:09.136 CEST"]
[GameStartTime "2025-09-30T13:02:48.530 CEST"]
[Opening "Scandinavian (centre counter) defense"]
[PlyCount "80"]
[Termination "adjudication"]
[TimeControl "60/60+1"]

1.e4
{+0.23/11 1.6s}
1...d5
{-1.68/10 1.6s}
2.exd5
{+0.49/11 1.6s}
2...Qxd5
{-1.84/10 1.6s}
3.Nf3
{+0.48/11 1.6s}
3...Qe4+
{-1.68/10 1.6s}
4.Be2
{+0.34/12 1.6s}
4...Qg6
{-1.97/10 1.6s}
5.Rg1
{+0.49/10 1.6s}
5...Bd7
{-1.58/9 1.6s}
6.d4
{+0.44/10 1.6s}
6...Nc6
{-1.56/11 1.6s}
7.Bf4
{+0.41/10 1.6s}
7...O-O-O
{-1.38/10 1.6s}
8.Nc3
{+0.06/10 1.6s}
8...Nb4
{-1.22/10 1.6s}
9.Rc1
{+0.17/10 1.6s}
9...Qf5
{-1.35/9 1.6s}
10.Be3
{+0.24/10 1.6s}
10...Nd5
{-1.20/11 1.6s}
11.Ne5
{+0.28/11 1.7s}
11...Nxe3
{-1.03/10 1.7s}
12.fxe3
{+0.16/11 1.7s}
12...Nh6
{-0.99/10 1.7s}
13.Bd3
{+0.32/10 1.7s}
13...Qe6
{-1.05/10 1.7s}
14.Qf3
{+0.38/9 1.7s}
14...Be8
{-0.98/9 1.7s}
15.Qe4
{+0.25/8 1.7s}
15...f5
{-0.91/10 1.7s}
16.Qf3
{+0.25/10 1.7s}
16...g6
{-0.76/10 1.7s}
17.h3
{+0.11/8 1.7s}
17...c5
{-0.55/10 1.7s}
18.Bc4
{+0.19/9 1.7s}
18...Qb6
{-0.35/11 1.7s}
19.Nd5
{+0.19/8 1.7s}
19...Qxb2
{-0.10/11 1.7s}
20.Nd3
{-0.21/10 1.7s}
20...Qa3
{-0.11/10 1.7s}
21.Rb1
{-0.66/9 1.7s}
21...Bc6
{-0.12/9 1.7s}
22.dxc5
{+0.05/8 1.8s}
22...Rd7
{+0.20/9 1.8s}
23.N3b4
{-1.76/9 1.8s}
23...Qa5
{+0.25/10 1.8s}
24.Kf1
{-1.41/9 1.8s}
24...Qxc5
{+0.31/10 1.8s}
25.Bb3
{-1.67/11 1.8s}
25...Bxd5
{+0.31/8 1.8s}
26.Bxd5
{-1.24/11 1.8s}
26...Qb6
{+0.32/10 1.8s}
27.Rb3
{-0.99/10 1.8s}
27...e6
{+0.43/11 1.8s}
28.Nd3
{-1.35/12 1.8s}
28...Qa6
{+0.37/13 1.8s}
29.Rc3+
{-1.33/12 1.8s}
29...Kd8
{+0.28/11 1.8s}
30.Bb3
{-1.42/11 1.8s}
30...Bg7
{+0.35/9 1.8s}
31.Rc4
{-1.12/11 1.9s}
31...Re7
{+0.15/9 1.9s}
32.Ra4
{-0.90/9 1.9s}
32...Qb6
{+0.17/11 1.9s}
33.Rb4
{-0.84/11 1.9s}
33...Qa6
{-0.48/11 1.9s}
34.Bc4
{-0.73/11 1.9s}
34...Qc6
{-1.10/12 1.9s}
35.Qxc6
{-0.17/13 1.9s}
35...bxc6
{-1.06/12 1.9s}
36.Nc5
{-0.15/12 1.9s}
36...Kc8
{-1.10/11 1.9s}
37.Nxe6
{-0.03/10 1.9s}
37...Bf6
{-1.17/11 1.9s}
38.Kf2
{+0.62/11 2.0s}
38...Rhe8
{-1.37/10 2.0s}
39.Rd1
{+3.64/14 2.0s}
39...Rxe6
{-4.74/12 2.0s}
40.Ba6+
{+5.01/18 2.0s}
40...Kc7
{-6.62/18 2.0s, White wins by adjudication}
1-0
[/pgn]

What an ABSOLUTE JOY to see chess engines playing like Harry at the pub! :D
Human chess is partly about tactics and strategy, but mostly about memory
User avatar
Sylwy
Posts: 4897
Joined: Fri Apr 21, 2006 4:19 pm
Location: IAȘI - the historical capital of MOLDOVA
Full name: Silvian Rucsandescu

Re: GeminiChess, an LLM built engine

Post by Sylwy »

glav wrote: Wed Oct 01, 2025 10:24 am I let Gemini do to some more work on the engine during the weekend. Basically the work was split in two parts, i.e., debug and adding more features.
I guess it is now playing around 2000 points.
I enclose the program for download. Any comment is very welcome.
Super ! Thank you a lot !
glav
Posts: 79
Joined: Sun Apr 07, 2019 1:10 am
Full name: Giovanni Lavorgna

Re: GeminiChess, an LLM built engine

Post by glav »

Gemini just spitted out a new version of the program implementing null move pruning, plus LMP and LMR. However, this time was though since it was systematically skipping the tests that the driver script was asking to do. As a result, It went wandering for over 40 iterations without producing the required code, but claiming to have done so, just because it simply skipped the tests! However, once I figured out a prompt that compelled it to do what was supposed to do, less than 30 iterations were sufficient to have a fully functional and well tested code. Since I had asked to the script run for 40 iterations, the LLM went on also to implement a feature I didn't ask to add, it called it 'aspiration widening', that of course wasn't specifically tested, but the same made a sensible increase in program strength, at least judging by the match tests. This whole experience let me think that, rather then programming using models that claim to have a volatile memory able to focus for 30 hours or so, we should learn first how to write better prompts. Another take home lesson is that, at least for me, it is important to "freeze" things as soon we have tested them and remove them from the volatile LLM memory, otherwise later on they will get messed up and won't it even compile anymore.

Anyway, I digressed. As a result of this new code, GeminiChess gained a few hundred points and it now is playing on par with camel-v1_6_0, a program which was rated 2246 on the recent CCRL list. Still playing a little bit like Harry at the pub, though... :)

[pgn][Event "?"]
[Site "?"]
[Date "2025.10.04"]
[Round "1"]
[White "GeminiChess_v2.6_30_122"]
[Black "camel-v1_6_0-linux-x86-64"]
[Result "1-0"]
[ECO "B02"]
[GameDuration "00:01:50"]
[GameEndTime "2025-10-04T07:55:23.530 CEST"]
[GameStartTime "2025-10-04T07:53:33.470 CEST"]
[Opening "Alekhine's defense"]
[PlyCount "46"]
[Termination "adjudication"]
[TimeControl "30/60+1"]
[Variation "Saemisch attack"]

1.e4
{+0.35/15 2.5s}
1...Nf6
{+0.02/11 0.92s}
2.e5
{+0.40/16 2.5s}
2...Nd5
{-0.09/12 1.2s}
3.Nc3
{+0.38/13 2.5s}
3...Nxc3
{-0.17/13 1.6s}
4.dxc3
{+0.36/15 2.5s}
4...Nc6
{-0.13/12 1.9s}
5.Nf3
{+0.23/15 2.6s}
5...d6
{-0.21/11 2.0s}
6.Bb5
{+0.32/14 2.6s}
6...a6
{-0.34/11 1.4s}
7.Bxc6+
{+0.85/14 2.6s}
7...bxc6
{-0.28/11 1.4s}
8.O-O
{+0.81/12 2.6s}
8...c5
{-0.28/10 2.0s}
9.Ng5
{+1.13/15 2.6s}
9...Bb7
{-0.86/12 2.0s}
10.e6
{+1.16/16 2.6s}
10...fxe6
{-0.98/13 1.4s}
11.Nxe6
{+1.08/15 2.7s}
11...Qc8
{-0.98/12 1.7s}
12.Re1
{+1.70/13 2.7s}
12...Kf7
{-1.09/11 1.2s}
13.Qg4
{+2.02/13 2.7s}
13...h6
{-1.29/11 2.1s}
14.Qc4
{+1.95/15 2.7s}
14...Kg6
{-1.50/11 1.9s}
15.b4
{+1.90/12 2.7s}
15...cxb4
{-1.52/11 1.9s}
16.cxb4
{+2.76/13 2.8s}
16...Rb8
{-1.54/10 2.9s}
17.a4
{+2.27/11 2.8s}
17...Kh7
{-1.63/10 3.0s}
18.Bxh6
{+3.84/14 2.8s}
18...Kg8
{-2.64/10 3.1s}
19.Bxg7
{+5.31/14 2.8s}
19...Bxg7
{-3.27/12 3.1s}
20.Nxg7+
{+5.97/16 2.9s}
20...d5
{-4.56/12 2.8s}
21.Qf4
{+5.96/16 2.9s}
21...Rh7
{-4.56/12 3.0s}
22.Ne6
{+6.45/13 2.9s}
22...Qe8
{-8.99/12 2.4s}
23.Ra3
{+10.41/14 3.0s}
23...Qf7
{-9.58/13 2.9s, White wins by adjudication}
1-0
[/pgn]
User avatar
Ajedrecista
Posts: 2144
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: GeminiChess, a LLM built engine.

Post by Ajedrecista »

Hello Giovanni:
glav wrote: Sat Oct 04, 2025 10:14 am[...]

[...] Still playing a little bit like Harry at the pub, though... :)

[pgn][Event "?"]
[Site "?"]
[Date "2025.10.04"]
[Round "1"]
[White "GeminiChess_v2.6_30_122"]
[Black "camel-v1_6_0-linux-x86-64"]
[Result "1-0"]
[ECO "B02"]
[GameDuration "00:01:50"]
[GameEndTime "2025-10-04T07:55:23.530 CEST"]
[GameStartTime "2025-10-04T07:53:33.470 CEST"]
[Opening "Alekhine's defense"]
[PlyCount "46"]
[Termination "adjudication"]
[TimeControl "30/60+1"]
[Variation "Saemisch attack"]

1.e4
{+0.35/15 2.5s}
1...Nf6
{+0.02/11 0.92s}
2.e5
{+0.40/16 2.5s}
2...Nd5
{-0.09/12 1.2s}
3.Nc3
{+0.38/13 2.5s}
3...Nxc3
{-0.17/13 1.6s}
4.dxc3
{+0.36/15 2.5s}
4...Nc6
{-0.13/12 1.9s}
5.Nf3
{+0.23/15 2.6s}
5...d6
{-0.21/11 2.0s}
6.Bb5
{+0.32/14 2.6s}
6...a6
{-0.34/11 1.4s}
7.Bxc6+
{+0.85/14 2.6s}
7...bxc6
{-0.28/11 1.4s}
8.O-O
{+0.81/12 2.6s}
8...c5
{-0.28/10 2.0s}
9.Ng5
{+1.13/15 2.6s}
9...Bb7
{-0.86/12 2.0s}
10.e6
{+1.16/16 2.6s}
10...fxe6
{-0.98/13 1.4s}
11.Nxe6
{+1.08/15 2.7s}
11...Qc8
{-0.98/12 1.7s}
12.Re1
{+1.70/13 2.7s}
12...Kf7
{-1.09/11 1.2s}
13.Qg4
{+2.02/13 2.7s}
13...h6
{-1.29/11 2.1s}
14.Qc4
{+1.95/15 2.7s}
14...Kg6
{-1.50/11 1.9s}
15.b4
{+1.90/12 2.7s}
15...cxb4
{-1.52/11 1.9s}
16.cxb4
{+2.76/13 2.8s}
16...Rb8
{-1.54/10 2.9s}
17.a4
{+2.27/11 2.8s}
17...Kh7
{-1.63/10 3.0s}
18.Bxh6
{+3.84/14 2.8s}
18...Kg8
{-2.64/10 3.1s}
19.Bxg7
{+5.31/14 2.8s}
19...Bxg7
{-3.27/12 3.1s}
20.Nxg7+
{+5.97/16 2.9s}
20...d5
{-4.56/12 2.8s}
21.Qf4
{+5.96/16 2.9s}
21...Rh7
{-4.56/12 3.0s}
22.Ne6
{+6.45/13 2.9s}
22...Qe8
{-8.99/12 2.4s}
23.Ra3
{+10.41/14 3.0s}
23...Qf7
{-9.58/13 2.9s, White wins by adjudication}
1-0
[/pgn]

[...]
I wish I could play like Harry at the pub. :-) My next analysis is without using engines: I would never have thought about a trap like 9.- Ng5, apparently forgiving the e5 pawn. I understood quickly: 9.- ..., dxe5??; 10.- Qxd8+, Kxd8; 11.- Nxf7+, recovering the pawn and winning up the exchange.

I love those little fireworks at the opening. I would say it is my favourite phase of the game because I find amusing that such subtle traps can be available that early in the game, almost out of nowhere. Disgracefully, I am not that creative, as I said before.

Regards from Spain.

Ajedrecista.
glav
Posts: 79
Joined: Sun Apr 07, 2019 1:10 am
Full name: Giovanni Lavorgna

Re: GeminiChess, a LLM built engine.

Post by glav »

Ajedrecista wrote: Sat Oct 04, 2025 12:47 pm Hello Giovanni:
glav wrote: Sat Oct 04, 2025 10:14 am[...]

[...] Still playing a little bit like Harry at the pub, though... :)
I wish I could play like Harry at the pub. :-) My next analysis is without using engines: I would never have thought about a trap like 9.- Ng5, apparently forgiving the e5 pawn. I understood quickly: 9.- ..., dxe5??; 10.- Qxd8+, Kxd8; 11.- Nxf7+, recovering the pawn and winning up the exchange.

I love those little fireworks at the opening. I would say it is my favourite phase of the game because I find amusing that such subtle traps can be available that early in the game, almost out of nowhere. Disgracefully, I am not that creative, as I said before.

Regards from Spain.

Ajedrecista.
Thanks for spotting the variation. Now that I saw it, I realize that even 9)...h6 would have misfired, because of 10)Nxf7 and 11) Qf3. May be the program was only at its first few beers in the pub after all! :)
[d]r1bqkb1r/2p1pppp/p2p4/2p1P1N1/8/2P5/PPP2PPP/R1BQ1RK1 b kq - 1 9

Since you are an experienced programmer, if you don't mind I would like to take the chance to ask how would continue with this project. Would you keep asking to the model to identify some missing features, implement them and see if they make any sense? Or would you show the LLM some real stuff, say the stockfish source code, and ask to learn from it and come up with something similar? The first approach would be very generic, probably bound to let the model to have some hallucinations, but it is what I have done so far. The second approach is more specific and concrete, but I am afraid that it could produce, at the very best, just another stockfish clone.
User avatar
Sylwy
Posts: 4897
Joined: Fri Apr 21, 2006 4:19 pm
Location: IAȘI - the historical capital of MOLDOVA
Full name: Silvian Rucsandescu

Re: GeminiChess, an LLM built engine

Post by Sylwy »

glav
Posts: 79
Joined: Sun Apr 07, 2019 1:10 am
Full name: Giovanni Lavorgna

Re: GeminiChess, an LLM built engine

Post by glav »

Sylwy wrote: Sat Oct 04, 2025 3:38 pm viewtopic.php?p=983712#p983712
Wow! Nice. Thank you. May be a little bit of alcohol it's not so bad for your chess! :)