Skip to content
SQUARE MILE DESIGN®
CAT. 12 / Oct 2026

Branch Point

A dot learns to cross a maze. Q-learning or a language model on a Raspberry Pi drives it, and only one of them improves.

Stack
RASPBERRY PI 5 · OLLAMA · Q-LEARNING · JAVASCRIPT
Status
BUILT
Date
Oct 2026
Reference
CAT. 12

Context

Branch Point is a browser-based game for AI. A dot learns to cross an 8×8 grid to a goal, avoiding hazards, by trial and error. It started as a way to watch reinforcement learning work. It became a test bench for a different question: how does a small language model compare to a decades-old algorithm on the same task?

The board has two brains. One is Q-learning, which starts knowing nothing. The other is any model served by Ollama, which starts knowing a great deal. Both see the same maze and are scored the same way. The model does not have to run beside the browser. In this build it ran on a Raspberry Pi 5 on the desk, answering one move at a time over Wi-Fi.

What was built

The Pi runs Ollama as a lingering systemd user service, installed without root, so it survives a reboot. The board talks to it through a configurable endpoint. Each move is one HTTP request carrying the map the dot has discovered, its last six moves, and what it knows about each of the four directions. The model replies with a direction.

The measurement rig took more care than the models. The board uses a fixed layout so runs are comparable. The prompt got six live controls: move history, map window, route hint, visit counts, temperature and reply budget. Every setting is written into the per-episode CSV beside its result. Two unattended harnesses ran the long experiments overnight. A corridor board with no decisions in it was added late, to separate a model's ability to carry out a move from its ability to choose one.

On the main maze, Q-learning reached the goal in 925 of 1,406 episodes. The language models reached it once in 361 across two boards. One of them, a 3B model, walked the corridor 30 times out of 30 and the maze 0 times out of 30.

What was learned

Execution is intact. Judgment at the branch points is not. Better prompting removed the pacing and quadrupled the hazard deaths, because the pacing had been protecting the dot. A prior is not learning: the model knew where goals usually are, and Q-learning improved anyway.

The slower lesson was about measurement. The first day of data compared different mazes, and nothing threw an error to say so. The full account, including the experiment that overturned the thesis, is in the essay.