Baduk project note

AI Go, from game records to scoring

The model has no memory yet

On every move the model looks only at the board as it is at that moment. It does not remember which stones were captured a few moves ago, where a ko arose, or what rules were agreed at the start. So it sometimes proposes a point that is already occupied, a suicide, or retaking a ko immediately after it was taken.

For now the rule engine on the web fills that gap. If the coordinate the model picks breaks the rules, it goes on a rejection list and the model is asked again; if no legal move comes back even then, the error is shown as is. We never quietly swap in a random move.

Every move of a game is recorded on the server. But the model does not read that record before it plays. Writing something in a notebook is different from remembering it.

That does not mean we plan to leave memory to a single model. Research showing that RAG and an LLM alone cannot solve this kind of problem comes out quite regularly. So we are trying to build memory by dividing roles among several engines.

  • Moves that are never allowed, such as retaking a ko at once or suicide, are blocked by the rule engine. Even if you write them in the prompt, the model can ignore them. This part already works today.
  • Things that can be recalculated from the board and the move order, such as ladders, dame and shapes that can make two eyes, are computed afresh on every move by an analysis engine. Anything remembered would go stale once the board changes.
  • Only what is not visible on the board, such as the rules agreed at the start, plans in progress and earlier mistakes, is recorded as events. Each event has a move when it appeared and a point when it expires, and just before asking, only the events relevant to the current board are put into the prompt.
  • The same notes are attached to the training data as well. A model that has never seen a board with notes cannot make good use of them during a game.

Completing this structure is the homework MariaGO still has to finish.

MariaGO Go at a glance

Standard 19×19 board · human Black / AI White · no time limit per move · every move saved automatically · step back and forth through the record · continue from any move · manual and double-pass scoring.

Safer judgement of ladders and tiger's mouths

On September 28, 2026, we fixed two cases where the AI would choose a tactically losing move as is. The coordinate proposed by the model is checked again against the stones and liberties on the board, and if it is a futile escape of a stone caught in a ladder or a move into a tiger's mouth where it would be captured at once, another legal move is chosen.

Ladders: avoiding futile escapes and hasty passes

We follow the sequence to read whether a stone in atari, after escaping one point, is chased by successive ataris and captured in the end. If there is no ladder breaker and it cannot get out, that escape is removed from the candidates. We also stopped the AI from passing to avoid a ladder when there were still places to play, so that it chooses another legal move on the board.

Tiger's mouths: knowing when to enter and when to fill

The AI does not enter a tiger's mouth surrounded on three sides by opponent stones, where it would be in atari right after playing. It also avoids filling a tiger's mouth made by its own stones without a special reason. However, if that move captures opponent stones or nearby friendly stones are short of liberties, it may be the necessary tactic, so it stays a normal candidate.

Current scope

These fixes apply at the AI's final move-selection stage. They are not general reading that solves every ladder or life-and-death problem perfectly, and we keep recording and patching exceptions found in real games.

Development log, September 2026

We worked through problems found in real games, with passing, illegal moves and tactical choices, and added per-user ranks. The changes below are separate from the model's own training performance; they apply to the server and web rules that check the model's answers and run the games.

No more hasty passes in a game still in progress

If enough empty areas and unresolved fights remain, a pass answered by the model is not accepted right away; urgent legal candidates are evaluated again. Conversely, a final pass when the board is truly settled and nothing worth playing remains is allowed, and is distinguished from a normal double-pass ending.

Double-atari and cutting risks included in candidate evaluation

We check for shapes where stones are connected only diagonally, so that if the opponent cuts in between, one of the two groups ends up in atari. Advances that let the opponent create a double atari with their next move are penalised, and moves that connect weak stones or save them first are preferred.

Ko and capturing after filling told apart by the current board shape

We fixed a problem where a coordinate rejected once stayed forbidden for all later moves. A forbidden coordinate now applies only to the current board and turn, and when stones are captured and the board shape changes, legality is calculated again. So a ko that immediately recaptures to recreate the same board is blocked, but a legal move on a point that opened up after filling a liberty and capturing is allowed.

Ranks and overall records per client ID

Even users who are not logged in have their wins, losses, draws and total games saved under their browser's client ID. Game results are processed in a transaction so that the same result is never counted twice.

Current rankPromotion / demotion rule
18 kyu – 11 kyuPromoted at +3 points, demoted at −3
10 kyu – 5 kyuPromoted at +5 points, demoted at −5
4 kyu – 1 kyuPromoted at +10 points, demoted at −10
DanPromoted at +15 points, demoted at −15

On promotion or demotion the points for that band reset to 0, and you never drop below 18 kyu. Draws do not change points and are only recorded in the overall record.

Less centre scattering by the evaluation heuristic

The old evaluation opponent tended to scatter stones by randomly picking candidates near the centre whenever there was nothing to capture. We replaced it with scoring that combines corner openings on the third and fourth lines, captures, escaping atari, connections, pressure on the opponent's weak stones and avoiding self-atari. MIX R5 won all of the first three games, but R5's average captures by move 80 fell from 5.98 in the last 100 earlier games to 3.0.

Reading the evaluation results

Heuristic games are currently stopped at move 80 and given a provisional count, so they cannot be read as an official win rate or rank. An accurate difference in strength needs a separate long evaluation with full games alternating colours and life-and-death judgement.

The heuristic, R5, and Gemma 4 were recorded separately

On October 9, 2026 three kinds of games were kept apart: boards where a shared score function chose the move, and boards where the model moved on its own. Area totals are listed next to KataGo, because dead stones inflate an area count.

Heuristic versus R5, five games with no move limit

Black was the monitor heuristic and White was R5. All five games ended with two passes. The heuristic won one. White's score includes 6.5 komi.

Game 1R5 · Black 61 · White 95.5 · 336 moves
Game 2R5 · Black 60 · White 68.5 · 344 moves
Game 3R5 · Black 53 · White 73.5 · 318 moves
Game 4Heuristic · Black 129 · White 65.5 · 356 moves
Game 5R5 · Black 76 · White 97.5 · 350 moves

R5 played five illegal moves, all of them ko: one in game 1, one in game 4, and three in game 5.

Gemma 4 versus R5 was not a model-versus-model match

Only games 2 and 3 finished normally. KataGo had Black ahead by 88.7 and 75.2. Of the moves that reached the board, Gemma 4's own suggestion was played once in 803 tries and R5's thirteen times in 796. The score function on both servers chose the rest. Games 1 and 5 stopped after Gemma 4 repeated an illegal ko, and game 4 stopped the same way for R5. With only two finished games, that set was not used for training.

After Gemma 4 studied the moves the heuristic actually played

Gemma 4 was trained on 1,476 moves chosen by the score function. For the test, that function was turned off. The monitor heuristic took Black and Gemma 4 took White for three games with no move limit. All three ended on two passes. KataGo had Black ahead by 76.2, 74.0, and 69.7. The area score of 361 to 6.5 counted White's dead stones as Black territory.

The chosen AI applies only to that visit

The play screen offers Gemma 4, Local AI, and R5. Local AI is the heuristic and does not call a model server. The choice is stored in that browser, and only that visitor's move requests use it. The server is not switched over to one model for everyone.

The heuristic keeps a lesson book too

The heuristic is not a neural net. It stores the opponent's captures, atari saves, and ladder chases as bonuses. Those three games were added to the book. Each bonus was already capped at 40, so the heuristic's move choice did not change. The heuristic's own useful moves were added to the R5 side of the book, and captures there rose from 5,326 to 5,784. Gemma 4 is being trained again on the heuristic's moves, and five unlimited games will follow. Each of those games is written into the same book.

How we taught the AI 19×19 coordinates

The training data starts from SGF records played by strong amateurs and professionals. Instead of memorising whole games, we pair the board just before each move with the actual next move. Winners' records are preferred, positions that need tactical judgement such as atari are included more often, and duplicates are removed so the same board does not repeat.

In early experiments the model kept repeating coordinates in the lower right of the board. The training boards had numbers attached, but the spacing and alignment differed from those of the live game server, and the model misread everything from column 10 onwards, where the two-digit column numbers begin. It was not a case of “too few game records” but of mismatched input formats between training and play.

Today the same aligned grid, with rows and columns padded to two digits from 00 to 18, is used in both training and play. Before the main training, we run a coordinate test where the model has to find randomly placed stones, and look at the accuracy of the four quadrants, top left, top right, bottom left and bottom right, separately. Even if the overall average is good, collapsing in one corner becomes a directional bias in real games.

InputA 19×19 board with rows and columns 00–18 aligned, plus the current game conditions
TargetThe next move coordinate, or a pass, chosen in the actual record
TrainingGo move-selection patterns added to a base model with LoRA
ValidationCoordinate recognition, legal moves, directional bias, early passes and filling own territory observed

So MariaGO's AI is not a finished answer machine. It has learned the choices in game records, but in unfamiliar positions it can play bad moves or illegal coordinates. Keeping these failures in game logs and fixing the next data set and rule checks is an important part of the project.

Safe moves with no time limit

We use two-step moves so that a mistaken tap on a small smartphone screen is not committed. Tap an empty intersection once and a gold preview stone appears. Only when you tap the same point again or press the “Play” button on screen is the move saved on the server and the turn passed to the AI. Tapping another point just moves the preview.

There is no byo-yomi or time limit on the human's turn. Leaving the screen open for a long time will not cause an automatic pass. While the AI calculates its move, input pauses briefly to prevent duplicate requests, and response times may vary with network conditions.

There is no need to hurry. Pick a move, check the marked position, then confirm. Moves that are not allowed by the rules, such as suicide or ko, are explained at the confirmation step.

Game records do more than keep a log

When you start a game, a six-character game code and an access key are created. With every move, the board, the next player, captured stones, the ko point and the full move order are saved in the server database. In the same browser the most recent game in progress is loaded without any search, and on the records screen you can see past games with their time and number of moves.

During a game you can use the back and forward arrows to review past positions without changing the current move. Returning to the last move continues the original game. If you choose “Continue from here” while looking at a past move, the later moves are discarded and a new variation starts from that position. It connects reviewing a real game and exploring hypothetical variations on one screen.

Saved data is protected by a temporary browser identifier and an access key. Knowing a game code alone does not let you open someone else's board, and to continue on another device you need a link that includes the access key. Clearing browser data can make the device forget its identifier, so it is safer to keep links to important games in progress somewhere else.

What automatic scoring counts and what it misses

When both sides pass in a row or the user presses “Score”, MariaGO calculates a reference score close to Korean territory counting. It explores empty areas: if an area's border is made only of black stones it counts as Black's territory, and if only of white stones, as White's. Captured opponent stones are added, and 6.5 points of komi are added for White before the difference is shown.

The hard part is not counting empty points but identifying dead stones on the board. People agree that groups without two eyes or stones that cannot avoid capture are dead and remove them, but the current automatic scoring does not fully judge life and death. If dead stones remain on the board, the borders of nearby areas get mixed, so they may not count as territory or may produce a value different from the real result.

So mid-game scoring is a tool for roughly gauging the position, and the final result should not be taken as an official referee's verdict either. Especially when big endgame moves remain or both players' stones are mixed within one area, there are more neutral points that are not counted. In that case, checking the board itself matters more than the number.

How to read the score

Black's score = Black's surrounded territory + captured white stones. White's score = White's surrounded territory + captured black stones + 6.5 komi. Automatic life-and-death judgement is not supported yet, so if dead stones remain at the end of a game, treat the score only as a reference.

Before you start a game

  • Web games are played on a 19×19 board, with the human as Black and the AI as White.
  • Tap an empty point once, check the preview, then tap again to confirm.
  • There is no time limit on your moves, and the move order is saved with every move.
  • Reconnect in the same browser and you can continue your most recent game automatically.
  • Automatic scoring is a reference feature that does not fully judge life and death.