Tiny World Model Plays Games on Pico 2 W
A researcher implemented a dual-network system that generates and plays games entirely on a Raspberry Pi Pico 2 W microcontroller. One network predicts the next frame and reward given the current frame and action; the second network plays by choosing actions based on the generated frames. Both run on the same processor core while the other core manages USB and display output.
The system uses a looped transformer architecture: a single transformer block containing attention and a ReLU multilayer perceptron is applied repeatedly with the same weights, rather than stacking different layers. This weight-reuse reduces memory demands. Games render as grids of token identifiers divided into patches—2×2 cells in Breakout, 4×4 in Doom-lite, Flappy Bird, and Pong, and 6×6 in Pac-Man. The model performs 1 to 4 passes per frame; the Pico implementation uses 2 passes to maintain playable frame rates. Weights are quantized to 8-bit integers during training.
The system validates learned game rules by extracting state from predicted frames, applying actual game logic, and verifying consistency. Five games (Pac-Man, Breakout, Doom-lite, Flappy Bird, Pong) run entirely from generated frames—real game code never executes on the microcontroller. Agents learn through a one-step-at-a-time algorithm without replay buffers or batch processing, using separate policy and value networks, each with two hidden layers of 64 units (32 on the Pico). Button presses allow players to take control and play the generated world directly.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.