Two experiments that mix the two ways of making a network, both on Walled In. First, PPO training continued from a network written by hand. Then the reverse: a network trained only with PPO, studied and edited by hand. PPO is a standard reinforcement learning method: it plays many games and nudges every weight towards the moves that led to better results. The numbers below come from the weights and results files.
Scores below are percentages: a won game counts 1, a draw ½ and a lost game 0, averaged over 1,000 games, so 50% means even. A score against the three opponent programs is the average of the scores against each of them. A score against another network, such as the original, uses the same rule on the games between the two.
The starting point is flood-fill attempt 2, which scores 75.8% against the three opponent programs. It gives each possible move a score and picks the highest. The score adds up five parts, each multiplied by one output weight: the cells the network would reach before the opponent, the cells the opponent would reach first, and three adjustments for crashing, a possible head-on crash and free neighbouring cells.
PPO trained it for 500k more steps, in 41 minutes on one core, with the same settings used to train other networks from scratch. A step is one move in one game, so this is roughly 500,000 moves of practice.
Training adjusts weights in the direction that reduces its error, and that direction comes from the slope of each unit's activation. The handwritten units were built to be firmly on or off, so their inputs sit around ±10, where tanh is completely flat. In 32-bit numbers the slope there is exactly zero, so nothing reaches those weights at all.
Only the 5 output weights, which mix the cell counts into a score, have no tanh after them. So PPO could only re-weigh the counts. It couldn't change how the board is filled.
These are the five output weights that make up each move's score. Before training, a cell of territory counted exactly 1, so the weights are in cells: crashing costs as much as 1,000 cells. The parts are explained in more detail on the Walled In page.
Every change is a few percent. The clearest one is that the opponent's cells now count about 4% more than the network's own.
Yes, a little. Both versions played the same 3,000 games, so they can be compared one game at a time. Only 110 games had a different result: 75 better and 35 worse, a gain of 1.33 percentage points with a standard error of 0.28. Against attempt 2 directly the two are even, at 50.5%, but the fine-tuned version does slightly better against the strongest players.
The starting point is the 32-unit PPO network, which scores 39.2% against the three opponent programs. It has the small shape used for all three games, two hidden layers of 32 units each, and PPO trained it from random weights for 10M steps. The goal: change its weights by hand so it beats its original.
The network's input describes the board as four layers of 100 cells, called channels: its own head, the opponent's head, its own walls and the opponent's walls. Each cell of a channel is 1 if it holds that thing, and 0 otherwise. A first-layer unit has one weight for every cell of every channel, 400 in all. It adds up the weights of the cells that are 1, plus a fixed bias: a large positive sum turns it on, a large negative one turns it off, and sums near zero give something in between.
Below is one of the trained network's units next to one unit of the handwritten network of the same size. That handwritten network follows a fixed route around its half of the board, and this unit is one of its sensors: it fires when the head is on one stretch of the route and an opponent wall lies on the cells just ahead, so the network can step aside. The handwritten weights are discrete: on each channel they take just two values, 0 or one fixed number, such as 800 on the head cells this sensor covers. The trained weights are much noisier, as expected from training: almost every cell gets a different small value, between about −0.6 and 0.6, with no clean levels to read. Each map shows a unit's 100 weights for one channel, each drawn at its cell. They're weights, not outputs. Pick a channel. Blue weights push the unit on and orange push it off: on the "My head" map, the colour at a cell shows how the unit reacts when the network's head is there.
The handwritten sensor reads a few chosen cells with large weights. The trained unit reads every cell a little, like all 32 of its units, so no single unit has a job you can name. Reading the weights alone wasn't enough here, so the analysis also watched it play.
The analysis watched the network play against a copy of itself. Each game has a number, called its seed, that fixes everything random in it: the starting cells and the random draws each network makes when choosing a move. The same seed always replays the same game, so seeds keep separate sets of games apart. The games used to study the network and build the edit, called development games, have seeds 9,000,000 and up. Games used for scoring have other seeds.
Where its avoidable crashes happen
The arrow is the fatal move, and a stronger colour means more crashes, in 1,000 development games against itself. The counts are in the table. Moving up from row 7, column 4 caused 40% on its own.
For example, the check for the most common crash, moving up from row 7, column 4, has just three non-zero weights out of 400: +10 for the network's head being on that cell, and +10 each for its own wall and for the opponent's wall on the cell above, row 6, column 4. Its bias is −15. When the head is there and the cell above holds a wall, the sum is +5 and the unit turns on. Otherwise the sum is −5 or −15 and it stays off.
A second version, the control, frees the same units but adds no checks. Comparing the two shows how much of the effect comes from the checks themselves.
Positions from the original playing itself in games that aren't development games, so the edit never saw them.
Board, row 0 at the top
Against its original, yes, clearly. The control shows part of the reason: just freeing the units, without adding checks, changes its play enough that the two copies no longer run out of room on the same step. But the checks add much more.
Against everyone else, no. Those games reach different positions, where the checks rarely apply, and freeing units costs a little.