Playing against Leela (bot)

Learning to play go. Practicing against computer go program Leela.

Recorded game- 2 kyu level. Feel free to comment on game play.

2 kyu game - Leela wins!

2 Likes

You’re playing too fast and not reading. This led to blunders, like ignoring a crucial ko, or dying in gote in the upper left.

Give yourself enough time to consider more than just one move each turn. Think about what the outcome might be for each one, and only then make your move.

4 Likes

You should to try to play slightly slower and think ahead.

1 Like

Thanks! I’ll give it a try.

Here’s an update- 2 kyu handicap game, Leela wins by 15.
https://youtu.be/XoeF2G_Dnro

1-In the opening, play on 3rd and 4th lines: Ignore any move it makes above 4th line early on (like, don’t respond to tengen and take an enclosure) and play a 3rd-4th line move yourself.
2-Your first instinct is to respond to it. Try and see if you have any sente moves (even in other parts of the board) before you do.
3-When it 3-3s, try picking different josekis, especially ones that get you sente, like stretching twice instead of hane. That sente in opening is incredibly valuable in handi, since you are not likely to take sente in the later parts of the game.

2 Likes

Howdy Joe

Do you have some idea of what your actual kyu rating might be? In other words, your rating on the Leela program was influenced by the number of handicap stones you got. I took a look at a few of your OGS games, and I’m guessing your actual rating may be different?

I only ask because my recommendations may vary depending on your actual rank. Anyway - for now I’ll just do my best flying blind.

I find the Leela AI to be a very useful and flexible learning tool, but it did take me some time to figure out HOW to best learn from her, given that she’s a 4 dan and I am an DDK. I was ~18-17kyu when I started learning from Leela, and I’ve worked my way up to about ~14kyu, mostly through observation learning.

Quick caveat: please NEVER use Leela’s analysis/heat-maps against any human players on OGS, especially in ranked games. This is forbidden by the OGS rules, and I figure you know that, but I just always want to throw out this disclaimer in case anyone else raises the issue.

So, the problem for me in learning from Leela is that a lot of her guidance is too high-level for me. The choices she makes and the game-strategy she uses are way more risky and fight heavy than I can relate to.

When I tried to turn on Leela’s heatmaps and play non-handicap games against her, I was very aware that she was doing most of the driving, and I was mostly a passive observer, along for the ride. It taught me a lot about how a higher-level player approaches the stages of the game, but it was so far ahead of my level that I couldn’t apply it in my own games.

The learning regimen that finally worked for me was to find a much weaker AI that could still beat me, and then play alternating games against it - with and without Leela’s help.

So what I do is I open up this browser based AI opponent over here called COSUMI
https://www.cosumi.net/en/

It plays at about 7-8 kyu, and I like it because it plays fairly interesting and human-like moves. I play against it un-assisted, and then review my games to see where I make mistakes. Right now - my 3 biggest issues are

  • securing small things rather than taking big risks in the transition to midgame
  • not connecting well enough in midgame and getting cut/captured
  • assuming my loose enclosures are safe when they can still be destroyed

Then, once I get a sense of COSUMI’s style, I play it again, but I enter those moves in a Leela window, and turn on her probability heat maps so that I can get the benefit of her analysis layer. I’ve heard this referred to as Centaur Go - so here Leela is the horse, and I’m the human stuck on top.

If I just let Leela drive the whole time, she beats COSUMI by a huge margin and I do learn a little bit of strategy from that (i.e. to surround and capture weak groups early in the game). However, this leaves me with the same problem - her advice is so many years ahead of my level that it’s hard to retain when those training wheels are removed.

Instead, I focus on using the heatmaps in such a way that I can always relate to the moves, even if they’re not Leela’s top pick. If I want to secure/settle my stones and Leela wants to make a super-advanced attack, I just make the move I would make rather than taking the fork in the road that will lead me to be more confused.

This back and forth of playing on my own and then with assistance is a great way to hold up a mirror to my play-style, and show me where I can improve. Once I started absorbing some of those lessons, it became easier for me to

  • do my own analysis first
  • pick out the 3 top moves that I think would be best, and
  • only then check with the Leela heatmaps to see if I was on the right track

Over time, I found that I could guess correctly more often. As I began to absorb different lessons from my experience, I found it easier to apply that understanding to my own games when that assistance was removed.

Good luck!

3 Likes

Thanks Tony, that’s great advice. I didn’t know that Leela had a heat map/analysis layer. Pretty innovative to introduce another computer go program to play against/learn from. Thanks for the pointers. At one time I had 12 kyu on KGS but over time the players became too advanced for me and my rank dropped. It’s been a few years since I played regularly, so I haven’t established a rank on OGS yet. Thanks for the advice!

1 Like

You’re welcome - glad to help.

I’m a writer by avocation, so - for me - it really helped to make a narrative out of the various options. To say that Black wants THIS or is afraid of THAT. The more I was able to put words to that story, the better I was able to relate to that story, and weigh those priorities more carefully.

Leela helped me break it down into a Choose Your Own Adventure story where I had to make choices between the super-complicated path, and the one I could relate to. It also held my hand to show me how to do some of those maneuvers in those circumstances. So yeah, it’s a really multi-purpose learning tool.

The AI analysis here on OGS is also incredibly helpful in this regard. If you review your game with AI move suggestions, it’ll show you where you made critical errors in judgment - then give you an 8-stone demonstration of a different move that could have gone better. And it reviews your whole game that way - making better suggestions every step of the way.

Good luck!

3 Likes

After reading the posts by @tonybe I wanted to rediscover the feeling of playing against a strong bot, so I immediately went off and challenged the full-strength KataGo. For reference, my OGS rank is 4 – 5k.

I’m playing Black here.

I decided to choose a solid, territorial opening so I started on the 3-4s. Now, the shape you see in the lower right corner stems from https://online-go.com/joseki/12073. In a tonyesque analogy, if https://online-go.com/joseki/339 is a medium-sized train station like Cambridge, with several routes onwards; and https://online-go.com/joseki/484 is a huge station like Paddington, my choice is a small town stop. In the top right and lower left are very solid, well-known shapes that have been around for over fifty years.

Now, to pause here, it seemed like things were alright for me. White has more influence but Black’s territory is more secure. Black has sente. Alright, says the SDK mind – we shall continue to play corners, sides, centre; the only interesting side is the left side. The SDK mind also takes great note that White has omitted a honte move at the triangle and that this has left some weakness in his shape.

However, it is now that KataGo takes control of the game. He discards the three stones in order to take the triangled moves elsewheere on the board. It is crucial to understand that I wasn’t interested in the top left stones for the points of capturing them – with no other ideas of progession into the middlegame, I wanted to construct a position on the left side using natural techniques. And Kata allows me this. He lets me have D8 and D10, giving me exactly what I asked for – in order to better advance his own plans elsewhere. This is something that kyus and low dans are very bad at!

Finally, White surrounds a vast stretch of centre with a single move - it is now, given the skill difference between us, impenetrable and KataGo has won. I look at the winrate graph. My winrate declines very smoothly with no sudden pitfalls. I’m left wondering if I allowed White too much influence to start with, or whether I was too fixated on disposal stones.

In summary, the feeling of playing a strong bot at 5k is a sense of wry amusement at its smoothness of play.

3 Likes

Hey bugcat! Thanks for the shout-out :wink:

Your game intrigued me, so I looked it up on OGS and did a bit of my own analysis. I feel a bit weird as a 14k speaking up to a 4k about analyzing a game, because you’ve got way more experience than me. However, my goal here isn’t to put on my glasses and sound like a Smarty-pants. I figure the more I can talk about strategy the better I can increase my own understanding, so I’m going to give it a shot.

Two of the things I’m working on right now in my own learning are

  1. Trying to play a balanced opening so that my opponent can’t get an early lead
  2. Paying very close attention to the transition between opening and midgame, because this is where my opponent usually develops a big moyo before I even notice it.

Because I’ve got those 2 things on my mind - please take my analysis with a grain of salt.

So, first of all - I was surprised when you played C4 for move 3. Going up against a stronger opponent I figured you would play in the top left rather than initiating a cross-cut game. From my limited experience, when two players of different skill levels meet, a cross-cut game increases the chances that one of them will grab and early lead, because it’s harder for both to make large extensions in the opening. My first thought was “either he’s really brave or he’s going to get in trouble.”

a1
Next is the 3-3 invasion at C17. Now, on one hand I understand why you’d want to try and grab all 4 corners - but here it sort of worked against you. By invading from the inside, you allowed Katabot to develop the upper middle, and then approach your upper right corner in a way that creates a large extension. What more, now that Katabot has fenced in your upper left group, it will be more difficult for you to make a large extension down to the lower left stone at C4.
a2
If you had approached from the outside - you could have developed the potential for a larger extension, even if Katabot defended the corner aggressively. In this situation, preventing White’s large top extension seems more important to me than stealing the corner.

When Katabot approached the lower left with E4, I would also be hearing alarm bells, because if you protect that corner and Katabot secures the middle, then they’ve got another large extension along the bottom.
a3
I’m usually not a big fan of pincer moves, but here it might have been worth it to prevent that large extension on the bottom.
a4
Instead White secures the middle with K4, and then you invade the right corner. As soon as I saw this, I was immediately reminded of the micro Chinese fuseki (yes, I know the stones are in different places - but the large extension is similar). As I understand it, the priority for Black in this case is to reduce and invade from the top, because White is planning on developing that potential moyo into the middle.

Once Katabot fenced in the lower right corner, preventing you from making a large extension to the upper right, you only had the potential for one large extension - which was capturing White’s upper left stones and developing the left side (which you did!)

The problem is - having grabbed 2 large extensions on top and bottom, Katabot is no longer following opening priorities. They’ve moved on to midgame priorities and are expanding their potential away from the edge.
a5
If you look at the OGS AI analysis of the game, it is advocating for jumping in with E7 on the left and then invading in the lower middle for move 41.
a6
I was also thinking that E6 may work better - anything to keep White’s lower middle moyo contained.

Instead Katabot used direction of play to “give you what you want” - a capture + a large extension on the left - in exchange for a monster lower middle moyo within the first 52 moves.

So yeah, for me - a big part of my learning has come down to hearing those alarm bells loud and early. If invading the corners is enabling your opponent to create a large extension, they should be ringing even louder.

That’s what I’ve learned from playing against AIs anyway…

My 2 cents - your mileage may vary - void where prohibited - some cars not for use with some sets.

2 Likes

You make a lot of good points here!

I think several times, I was affected a level of blindness.

First of all I expected KataGo to fix his shape in the upper left, which would have given me sente to play away – but it has become clear that he didn’t have to do this.

It should also be noted, in a theme you discussed a lot in your article on the opening, White achieved strong cooperation between his G16 tiger’s mouth and his full triangle at O17 whereas my stones were not cooperating.

I do agree that a pincer would have been better on the bottom side – I was too cagey about territory.

With the lower right, you instinctively don’t want to approach from O3 because of the kick (considering the K4 stone), so the 3-3 appears quite attracive – but in fact, this just puts off the problem, invading still being necessary. Aiming to build up the right side by approaching at R6 could have been an option.

Good analysis! I’ll make sure to keep a better lookout for incipient moyo in the future.

2 Likes

Thanks! One of the issues I’m working on is that my strategic analysis abilities seem more advanced than my tactical abilities to actually DO STUFF with stones on the board.

I see problems developing - or I see a chance to take an early lead in opening/midgame - but then I make tactical errors in timing or execution and screw up my attempts to do the right thing. Practice practice practice, I guess…

2 Likes

Hi- I’ve been able to win a series of handicap games against Leela, however I am stumped by this 8 stone handicap game. Leela is white, human player is black. Leela consistently opens in the middle point (tengen?) I’ve tried playing the corners, which was successful at higher stone handicaps. However, this strategy hasn’t worked. Are there joseki for playing against the tengen opening? Thanks!
Leela plays tengen opening in 8 stone handicap game

While I can’t hope to speak for Leela, tengen is influenced focused in the extreme. This reflects the nature of what white is generally forced to do in high handicap games; if you aim to play territorially as white, the amount of influence black will get makes winning very hard. So, in order to win a high handicap game, white generally has no choice but to aim for influence that allows him to control the fight (generally speaking, weaker players are far less confident in their fighting skills; and will often make more mistakes in the commonly complex positions that fighting results in).

Asking what joseki there are against the tengen opening with an 8 stone handicap is a bit like asking what opening you should play in chess when your opponent is missing his queen and both bishops. Joseki are generally considered in the exclusive case of an even game; not in the case where black has an overwhelming advantage. Having said that; I hopefully have some good suggestions for how to handle the tengen opening Leela is playing.

As mentioned before, tengen focuses influence to the extreme. So try to avoid getting boxed in too much, and giving away a lot of influence. Secondly, be wary of playing joseki that feature ladders. Tengen is in an excellent position to break a lot of corner josekis that are reliant on ladders. This doesn’t mean you can never play joseki that feature ladders, simply be aware that tengen is a very present ladder breaker.

Thanks for sharing your thoughts. I’ll try to put your advice into practice.