Asking KataGo to solve tsumego: context matters!

For discussing go computing, software announcements, etc.
Post Reply
xela
Lives in gote
Posts: 652
Joined: Sun Feb 09, 2014 4:46 am
Rank: Australian 3 dan
GD Posts: 200
Location: Adelaide, South Australia
Has thanked: 219 times
Been thanked: 281 times

Asking KataGo to solve tsumego: context matters!

Post by xela »

Getting KataGo to solve tsumego is an interesting game! Often, if you put a life and death problem in a corner and leave the rest of the board empty, KataGo will just tell you that the first move in an empty corner is bigger. The challenge is to construct a whole-board position where the tsumego is hotter than anything else. But it's worse than that. Even if you can persuade it to pick the "right" corner, KataGo will suggest different moves depending on the whole-board context.

Does anyone have tips for this kind of analysis?

Here's an example from the Hitachi tsumego.
Click Here To Show Diagram Code
[go]$$B Black to play and kill
$$ --------------------
$$ | . . . . . . X . . .
$$ | O O . . . O O X . .
$$ | X X O . . O X O X .
$$ | . X O O O X X . . ,
$$ | . . X . X . . . . .
$$ | . X . . X . . . . .
$$ | . . . . . . . . . .[/go]
Solution
Click Here To Show Diagram Code
[go]$$B Black to play and kill
$$ --------------------
$$ | . . . . . . X 3 . .
$$ | O O 2 1 . O O X . .
$$ | X X O . . O X O X .
$$ | . X O O O X X . . ,
$$ | . . X . X . . . . .
$$ | . X . . X . . . . .
$$ | . . . . . . . . . .[/go]
On a first look, I missed :b3: -- and indeed this is where KataGo also gets stuck.
Click Here To Show Diagram Code
[go]$$B failure
$$ --------------------
$$ | . . . . 3 4 X 6 . .
$$ | O O 2 1 . O O X . .
$$ | X X O . 5 O X W X .
$$ | . X O O O X X . . ,
$$ | . . X . X . . . . .
$$ | . X . . X . . . . .
$$ | . . . . . . . . . .[/go]
This choice of :b3: feels more intuitive, but fails because :w6: is atari. This is where :wc: comes into play.
Alternative variation
Click Here To Show Diagram Code
[go]$$B Black cuts off the tail
$$ --------------------
$$ | . . . 6 . 5 X . . .
$$ | O O . 2 1 O O X . .
$$ | X X O 4 3 O X O X .
$$ | . X O O O X X . . ,
$$ | . . X . X . . . . .
$$ | . X . . X . . . . .
$$ | . . . . . . . . . .[/go]
In some contexts, KataGo quite likes this choice of :b1:, capturing three stones. Often it will suggest that white should tenuki, but there's the option of living later on.
I've constructed three full-board positions:
  • Balanced: black can win if and only if black kills the top left group.
  • Ahead: black can win without killing (but killing is still presumably the best move)
  • Behind: killing makes the game close, and is still the best option, but white is ahead
In the first situation, KataGo solves it quickly. But in the others, it has a surprising amount of trouble finding the key move, and prefers the alternative variation.







Note: I'm still on KataGo 1.3.2 with a 20-block network, too lazy to upgrade at the moment! Please post here if you get different results with newer versions.
Attachments
hitachi-10int_black_wins.sgf
(186 Bytes) Downloaded 993 times
hitachi-10int_black_loses.sgf
(187 Bytes) Downloaded 967 times
hitachi-10int.sgf
(175 Bytes) Downloaded 967 times
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: Asking KataGo to solve tsumego: context matters!

Post by akigo »

You can restrict KataGo's analysis to a range of coordinates (for a prescribed number of moves).

If you do it via GTP command kata-analyze, the syntax is described here: https://github.com/lightvector/KataGo/b ... ensions.md

If you use a GUI, most of them support this in some way.

If you analyze a board with your corner stones only and restrict the analysis for 20 moves to the smallest rectangle that includes all stones, KataGo will quickly find the right move and continuation (with a 40b network, 20b doesn't get it right).
hnishy
Beginner
Posts: 8
Joined: Mon May 07, 2018 3:18 am
Rank: about 3d
GD Posts: 0
Universal go server handle: hnishy
Location: Tokyo
Been thanked: 2 times

Re: Asking KataGo to solve tsumego: context matters!

Post by hnishy »

I just uploaded a short article about a tsumego solving AI on the Sensei's Library: https://senseis.xmp.net/?PandaSensei
Post Reply