Getting Leela to analyse and play in the style you want! Part 2 – Introducing Crazy Leela’s GROB Semi Slav?!?!

February 22, 2024 Matthew Sadler 4 comments

In a previous post, I described how to set up the new Leela feature called WDL Contempt (described here by the Leela team: The Lc0 v0.30.0 WDL rescale/contempt implementation – Leela Chess Zero (lczero.org)) In this post I look at one of the opening discoveries I made using a Leela optimised to search for promising lines against a prospective (fictitious!) opponent rated 400 ELO points below me! (A roughly 2700 ELO vs 2300 ELO scenario)

Obviously, you can get Leela to search from move 1 but my opening repertoire – even now – still stretches a bit deeper than that! So I decided my fictitious opponent liked to play the Slav or Semi-Slav and let Leela generate ideas against the opening moves 1.d4 d5 2.c4 c6

Position after 1.d4 d5 2.c4 c6

I’m not sure what I was expecting but it definitely wasn’t…THIS:

Squint a little bit at the first 2 lines and you’ll see that after analysing for a very long time, Leela wants:

Position after 1.d4 d5 2.c4 c6 3.Nc3 Nf6 4.Nf3 e6 5.g4!?!?

Since it doesn’t have a name, we will call it the Grob Semi-Slav! A further spicy point was that Leela thought that capturing the pawn was not necessarily Black’s best move!

As I always do, I put together a list of possible positions from 5.g4!?!? onwards and gave it to Stockfish and Komodo to play out. For example, here is a small sample of the lines I threw at these boys:

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. g4 Nxg4

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. g4 dxc4

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. g4 c5

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. g4 Nbd7 6. Bf4

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Nf3 e6 5. g4 Nbd7 6. g5 Ne4 7. Qc2 Bb4

The results were mixed (you will see this in the associated pgn). The big problem for Komodo and Stockfish is that neither of them are playing with Leela’s contempt! So they see an on-the-edge pawn sacrifice and just work hard to bring the position back to dull equality. That’s not what we want!

But we have another ace up our sleeve! Using Nibbler, we can play against Leela (with the same WDL Contempt settings used to generate the idea) ourselves with the black pieces and let Leela show what it was thinking! As described in the previous post, this is done by setting the “ContemptMode”: “play” in the engines.json file which tells Leela to play rather than analyse!

Purely for your entertainment, I offered myself up to take on Leela in some games… It was pretty brutal and pretty impressive! The notes to the games are the ones I wrote while the game was being played: they haven’t been altered by engine-checking! There is a specific reason for doing this. Since the purpose of this experiment was to unearth lines that might work practically against human opponents, I felt it was most useful to describe how the game felt to me, rather than how it went objectively. If you want the definitive engine-powered verdict, then take a look at the associated pgns which are available from the normal place: http://cloudserver.chessbase.com/MTIyMTYx/replay.html I also cover these games in a video on my Silicon Road YouTube channel: https://youtu.be/u9i71vdm_Ew

Game 1: Leela 100K nodes and WDL Contempt 400 ELO – GM Matthew Sadler

1.d4 d5 2.c4 c6 3.Nc3 Nf6 4.Nf3 e6 5.g4 Nxg4 6.Rg1 Nf6

Position after 6…Nf6

Chosen without thinking further about plans.

7.Bf4 dxc4

A) 7…g6 was the other move that most appealed to me but I couldn’t see anything immediately wrong with taking the c4–pawn.

B) 7…Bb4 8.a3 (8.Rxg7 Nh5 9.Rg4 e5 might be promising in some active way.) 8…Bxc3+ 9.bxc3 I didn’t like the feeling that White had very long-term compensation on those dark squares!

C) 7…Be7 doesn’t really lose the g7–pawn, but I didn’t think I really wanted to castle kingside! 8.Qc2 followed by 0–0–0 and e4 I guess (8.Rxg7 Nh5)

8.e4 b5 9.Qc2

9.Qe2 looks to turbo-charge d4–d5 by placing the queen already on the e-file

9…Nbd7 10.0–0–0 Bb7

Position after 10…Bb7

Various options now. I spent some time thinking about 11.d5 before deciding on 7…dxc4 during my evening walk! Leela followed my main line. I had a number of thoughts for White though I focused most of course on the most violent option! I quite liked 11.Ng5 with idea of sacrificing on f7/e6 or following up with Bh3 (the quick development of the bishop to h3 is another advantage to having played g4!).

11.Kb1

This took me by surprise though it’s obviously not an unusual move to play after castling queenside.

11…Qa5

I want to play …b4 and …c5 to free my light-squared bishop but that feels rather risky with the queen still on d8. …Qa5 gives Black the escape route …0–0–0 at least!. It strengthens …b4 and indeed one of the ideas is …b4, Ne2 …Qxa2+!, Kxa2 …b3+.

12.a3

12.Bh3 Nb6 was one line I liked, doubling down against the d5–break and really threatening …b4 by stopping Na4

12…c5

Obviously the move Black wants. I was a touch worried, but I couldn’t see a clear refutation though there was a rather dangerous piece sacrifice!

A) 12…0–0–0 13.Ng5 is very painful!

B) 12…b4 13.axb4 Bxb4 14.Rxg7 Nh5 15.Rg5 is a portent of what was to come!;

C) 12…g6 which covers the g7–pawn and

D) 12…h6 which stops Ng5 and maybe even prepares …g5–g4 were two moves that I considered seriously, but I was in a more aggressive mood!

13.d5 b4 14.Na4

In all fairness, I had thought of this move earlier, but forgot to look at it again in detail when deciding on 12…c5! I had a few …Nb6–related ideas in my head (looking to open the a-file for counterplay after Nxb6 …axb6) but they turned out to fall short when I came to analyse them.

14.dxe6 fxe6 15.Ng5 bxc3 16.Bxc4 e5 was what I decided on at 12…c5 which seemed like a big mess!

14…c3

Position after 14…c3

14…bxa3 had been another thought, but I became worried about switchbacks like Bd2 when the queen’s retreat is not good news for Black’s attacking prospects.;

14…exd5 15.exd5 Nxd5 16.Bxc4 Nxf4 17.Bxf7+ looked horrifying for Black!

15.Bc4 Ba6

It’s at moments like this that you wonder about 10…Bb7!

15…cxb2 16.dxe6 fxe6 17.Bxe6 Nb6 was my main idea, but I couldn’t find anything better than a losing line! 18.Ng5 Nxa4 19.Bf7+ Ke7 20.Bd6+ Kd8 21.Bxc5+ Bd5 Brilliant I thought, with the threat of …Nc3+ while 22.axb4 is met by .22..Nc3+! 22.Ne6+ Kd7 (22…Kc8 23.Bxb4+) 23.Nxf8+ with check! 23…Rhxf8 24.Bxb4 and it’s all falling apart. This was just what I thought of during my evening walk by the way: there are many improvements along the way as you will see in the associated pgn!

16.axb4

A clever intermezzo, stopping Black from burying the light-squared bishop with …c4 after it retreats. By opening up the 5th rank further, it also introduces a very painful idea for Black.

A) 16.Bxa6 Qxa6 is fine for Black

B) 16.Bb3 c4

16…cxb4 17.Bb3

17.dxe6 Bxc4 18.exd7+ Nxd7 19.Rxd7 b3

17…Rc8

Was the first move I thought of. I certainly didn’t fancy anything to do with …ed and castling queenside as Ng5 is very hard to deal with. Again though I’m getting nervous about 18.de and 19.Rg5

17…Nb6 feels tempting (with the idea of …Bb5 or …Bc4) but 18.dxe6 fxe6 19.Rg5 demonstrates another advantage to the early opening of the g-file!

18.dxe6 fxe6 19.Rg5! Ouch!

Position after 19.Rg5

19…Nc5 The best I could think of!

20.Nxc5 Rxc5 21.Rxc5 Bxc5 22.Ng5 Ke7 23.Nxe6 1–0 I’d seen enough!

So far so interesting! On to Game 2!

Game 2: Leela 100K nodes and WDL Contempt 400 ELO – GM Matthew Sadler

1.d4 d5 2.c4 c6 3.Nc3 Nf6 4.Nf3 e6 5.g4 Nxg4 6.Rg1 Nf6 7.Bf4 dxc4 8.e4 b5 9.Qc2 Nbd7 10.0–0–0 Bb7 11.Kb1 Qa5 12.a3 h6

Position after 12…h6

This move had occurred to me during the previous game. I’d thought of it as a way of stopping Ng5 (which might make …0–0–0 more palatable) as well as possibly introducing the idea of …g5–g4. After the previous game, I also appreciated stopping Rg5! The big drawback is that g6 is weakened: for example, after a subsequent d5xe6, the white queen has a soft spot on g6 to aim at.

13.h4 b4

I wondered whether to try 13…c5 – would the inclusion of …h6 and h4 help Black? I could think of ways in which it might… maybe a later game! I got attracted to the text as with the inclusion of …h6 and h4, a subsequent Rxg7 can be well met by …Nh5. Therefore, I can look to include my dark-squared bishop in my queenside play.

14.axb4 Bxb4 15.Na2

Position after 15.Na2

Not expected.

15.Bxc4 Bxc3 Capturing when e4 is undefended to force White to recapture with the pawn and expose the king with the queens on 16.bxc3 c5 Threatening …Bxe4 (16…Nb6 I was also looking at this) 17.d5 Nb6 18.Nd2 Na4 (18…Nxc4 19.Nxc4 Qb5+ 20.Nb2 looks odd for White but c4 is coming!) 19.Rg3 0–0 20.Bxh6 Rfb8 was the type of drama I was looking for!

15…c3

This felt consistent. 16.bc Be7 or 16…Ba3 felt like it might be reasonable for Black – after all that knight on a2 is not doing much now. 16.b3 also feels OK for Black: at least the c-pawn is going to be an irritation now rather than just being captured on c4.

16.Ne5

With 2 nasty threats: Nc4 winning a piece and Rxg7 (as Rxf7 is in the air).

16…Nxe5 17.Bxe5

17.dxe5 Nd7 18.Rxg7 didn’t worry me too much: the blocking of the h2–b8 diagonal is quite pleasant for Black as it gives the black rooks access to b8 and also makes queenside castling a bit safer.

17…c5 18.d5 0–0–0 19.Rxg7

19.Nxc3 was somewhat worrying for me. White looks pretty solid and Rxg7 is still a threat

19…Nxe4

Position after 19…Nxe4

was my idea… well shall we say hope(!) with 20.Qxe4 Rxd5 and hopefully plenty of play!

20.bxc3

I’ll freely admit that there were various alternative paths that caused me some concern 🙂 but nothing else really made me happy as Black. I hadn’t expected Leela’s strong continuation at all I confess!

20…Ba3

20…Bxd5 looked interesting at first to meet However 21.Nxb4 (21.cxb4 with 21…Qxa2+ 22.Qxa2 Bxa2+ 23.Kxa2 Rxd1) 21…cxb4 22.cxb4+ is rather embarrassing!

21.c4

A very unpleasant move: the e4–knight is loose and the bishop on e5 now covers b2! Meanwhile Rxf7 (with the threat of Rc7+ is still in the air!)

21…Nd6 22.Bh3

Position after 22.Bh3

1–0 Black is bound hand and foot! I’d seen enough here too!

Aagh, I’m getting kinda marmelised! Could I stop the rot in Game 3?

Game 3: Leela 100K nodes and WDL Contempt 400 ELO – GM Matthew Sadler

1.d4 d5 2.c4 c6 3.Nc3 Nf6 4.Nf3 e6 5.g4 Nxg4 6.Rg1 Nf6 7.Bf4 g6

Position after 7…g6

Not my favourite type of move, but it looked very sensible!

8.Qc2 Bg7

It always feels un-grandmasterly to simply castle without doing something useful first with other development but I couldn’t decide on what that should be! So castle first it is!

9.0–0–0 0–0 10.h4

Position after 10.h4

Well this move I guessed! It isn’t 100% clear for White either how to proceed so Leela throws in a rook’s pawn, with a potential h4–h5 always in the air from now on.

10…b5

Since White was making threatening gestures on the kingside, I felt I should offer a sacrifice of my own on the queenside. This is a very typical idea in the Semi-Slav.

11.c5

Leela keeps the queenside closed.

11…b4

This felt like the right moment to do it: the knight is forced to a4 which gives me e4 for my knight and the possibility to activate my light-squared bishop and chase the knight with …Ba6–b5

12.Na4 Ba6 13.Bd6 Re8

I vaguely wondered about sacrificing the exchange but I couldn’t see or feel the need for it yet.

14.Ng5

Position after 14.Ng5

Ok… so what’s going on here then? I found this move slightly confusing because it seemed to me that I was going to develop some tactical opportunities. I can play 14…Nbd7 to threaten …e5 and after 15.f4 to clamp down, I have 15…Nb6!? exploiting the fact that the bishop on d6 is protected by the c5–pawn, I couldn’t see anything particularly wrong with it.

14…Nbd7 15.f4 Nb6

Position after 15…Nb6

As planned. I was quite positive here! I have ideas like …Bb5 doubling down on the knight on a4 and I also have serious threats of …Nc4 hitting d6 and e3. White never wants to play Nxb6 because I open the a-file after …axb6.

16.h5

OK… we have a caveman on our hands! What is that in aid of? So what do I do? Take the pawn and ask what on earth are you on? Or threaten back with something like 16…Nc4 (hitting d6 and e3) or even 16…Bb5!?

16…Nxh5

I had a few worries about allowing White to weaken e6 by taking on g6 and forcing …fxg6 so I decided to go for solidity

16…Nc4 17.hxg6 (17.Nxf7 Kxf7 18.hxg6+ Kg8 19.gxh7+ Kh8 or 19…Nxh7 looks like it should be OK?) 17…fxg6 Also looks sort of decent: I’m threatening both …Nxd6 and …Ne3 (17…hxg6 18.Nxf7 wins)

17.Rh1

Position after 17.Rh1

I am being surprised by all these moves! There is no denying White has a threat: Rxh5 …gxh5, Qxh7+ mate!

A) 17…Nf6 is normal but there are so many ideas…

B) 17…f5 to clamp down on the b1–h7 diagonal and the e4–square,

C) 17…h6 to chase away the knight from g5 (18.Rxh5 hxg5 19.Rxg5 Nc4 is the idea)

17…h6

A) 17…Nc4 18.Rxh5 Nxd6 19.cxd6 gxh5 20.Qxh7+ Kf8 21.Qxh5 is rather painful for Black;

B) 17…Nf6 18.e4 Bxf1 19.e5 started to worry me a little 19…Bb5 20.exf6;

C) 17…f5 was the best move I suspected but… it’s not going to lead to the most exciting game and I am a content creator 😉 And being a little honest too, it’s the sort of move that doesn’t come easy to me from the temperament point of view! I like calculating and I always back myself!

18.Nxf7

Position after 18.Nxf7

My main line

18.Rxh5 hxg5 19.Rxg5 Nc4 20.Rg3 Bb5 (20…Nxd6 21.cxd6 Qxd6 22.e3 followed by Nc5 looks pretty nice for White) 21.Be5 Bxe5 22.fxe5 Qh4 looked really strong for Black to me: I’ll have …Qf4/…Qg5+, …Bxa4, …Nd2+ ideas…

18…Kxf7 19.Rg1 g5

Position after 19…g5

The move I was relying on.

20.e3

Not my expectation

20.fxg5 Nxa4 21.Qxa4 (21.Qh7 Rh8 22.g6+ Ke8; 21.gxh6 Bxh6+ 22.Kb1 Rg8 23.Qh7+ Rg7 24.Rxg7+ Nxg7) 21…Bc4 22.Qc2 hxg5 23.Bh3 Qf6 24.Rdf1 Nf4 I thought this would sort of work for Black

20…Nc4

A) 20…Nxa4 21.Bxa6 looked quite embarrassing! That bishop might head back to d3 or e2!

B) 20…Bxf1 21.Rdxf1 It felt crazy to give White development like that for free

21.Be2

Position after 21.Be2

21.fxg5 was again my expectation, but this was one of the moves on my radar. That didn’t mean though that I had a good reply prepared!

21…Nf6 22.fxg5 hxg5 23.Rxg5

I’d seen the end by now but I didn’t really see an alternative!

23…Ne4 24.Bh5+ Kg8 25.Rxg7+

Position after 25.Rxg7+

25…Kxg7 26.Rg1+ Kh8 27.Qh2 1–0

That wasn’t great for me 😉 but it was pretty cool! I have never had this sort of experience against an engine before. In that risky and objectively dubious line, Leela didn’t try and bring the position back to 0.00 as quickly as possible (with exchanges if necessary – the normal engine behaviour) kept on playing to keep the tension at a maximum level until the opponent (me ☹)  blunders. Build up moves like Qc2 and Kb1 at key moments are good examples of this! I am truly deeply impressed by this and you can bet that I’ll be throwing “Crazy Leela” into the fray quite regularly from now on!

4 Comments on “Getting Leela to analyse and play in the style you want! Part 2 – Introducing Crazy Leela’s GROB Semi Slav?!?!

  1. Terrific post, again. The companion videos are no less compelling. I do feel as if I have learned something from your research (although doubtless Leela’s evaluation of my play may tend, inevitably, to be tantamount to the most derisive of mockery).

    Ah, well.

    Many thanks, Matthew

  2. This WDL idea is awesome and Nibbler is for sure the best GUI for it. If only others engines could offered it. Now i wait to see pawn g4 in the Vienna Gambit.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.