It is currently Thu Mar 28, 2024 10:46 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Offline
 Post subject: Asking KataGo to solve tsumego: context matters!
Post #1 Posted: Sat Oct 22, 2022 8:19 pm 
Lives in gote

Posts: 580
Location: Adelaide, South Australia
Liked others: 207
Was liked: 264
Rank: Australian 2 dan
GD Posts: 200
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 515 times
hitachi-10int_black_loses.sgf [187 Bytes]
Downloaded 507 times
hitachi-10int.sgf [175 Bytes]
Downloaded 511 times
Top
 Profile  
 
Offline
 Post subject: Re: Asking KataGo to solve tsumego: context matters!
Post #2 Posted: Sun Oct 23, 2022 8:20 am 
Lives with ko

Posts: 174
Liked others: 13
Was liked: 151
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).


This post by akigo was liked by: MagRes
Top
 Profile  
 
Offline
 Post subject: Re: Asking KataGo to solve tsumego: context matters!
Post #3 Posted: Sat Nov 05, 2022 9:55 pm 
Beginner

Posts: 7
Location: Tokyo
Liked others: 0
Was liked: 2
Rank: about 3d
Universal go server handle: hnishy
I just uploaded a short article about a tsumego solving AI on the Sensei's Library: https://senseis.xmp.net/?PandaSensei

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group