Life In 19x19
http://lifein19x19.com/

Asking KataGo to solve tsumego: context matters!
http://lifein19x19.com/viewtopic.php?f=18&t=18939
Page 1 of 1

Author:  xela [ Sat Oct 22, 2022 8:19 pm ]
Post subject:  Asking KataGo to solve tsumego: context matters!

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 582 times
hitachi-10int_black_loses.sgf [187 Bytes]
Downloaded 573 times
hitachi-10int.sgf [175 Bytes]
Downloaded 579 times

Author:  akigo [ Sun Oct 23, 2022 8:20 am ]
Post subject:  Re: Asking KataGo to solve tsumego: context matters!

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/blob/master/docs/GTP_Extensions.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).

Author:  hnishy [ Sat Nov 05, 2022 9:55 pm ]
Post subject:  Re: Asking KataGo to solve tsumego: context matters!

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

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/