AI NewsModels & agentsAnnouncement
Tiny world model runs five games on a $7 Raspberry Pi microcontroller
A developer trained a 131,000-parameter transformer to generate Pac-Man and four other games on a Raspberry Pi Pico 2 W. The project reached 148 points on Hacker News.
Image: GitHub
Why it mattersA world model built for a $7 chip tells a developer how small the floor really is. The weights fit in half a megabyte, with games playing on 460 KB of RAM.
A world model that fits on a $7 chip is new. The author says the work runs on a Raspberry Pi Pico 2 W. That is a microcontroller with 4 MB of flash and 512 KB of RAM. The chip has two Arm cores and a floating-point unit. SheepSeb trained a tiny transformer to generate frames for five classic games on it. A second network plays them. The repository is called tinyworldformer. It reached 148 points on Hacker News on 29 October, with 97 comments.
The world model is a looped transformer at int8. SheepSeb says it has between 26,000 and 131,000 parameters, depending on the game. The actor is a small two-layer MLP with 9,000 to 16,000 parameters. Both networks run on one core of the Pico 2 W. Breakout fits in 361 KB of flash and 299 KB of SRAM. Pac-Man, the largest, needs 600 KB of flash and 460 KB of SRAM. That is still inside the chip's main memory map.
How the frames come out
The author says the world model splits each frame into token patches. One transformer block runs several times with the same weights, instead of stacking different layers. Three rules decode a frame. Background cells use the top prediction. Single moving pieces land after a random pick. Sprites are stamped from their state cells. The author reports exact frame accuracy of 99.99 percent on Breakout and 100 percent on Flappy Bird. Pac-Man scores 86.4 percent and mini Doom scores 83.6 percent.
How the agent learns
SheepSeb says the actor learns with Stream AC(λ) from Elsayed, Vasan and Mahmood (2024). It learns one step at a time, with no replay buffer, no batches and no target network. Each game trains between one and three million steps. The world model was trained on an RTX 4060 and then loaded onto the Pico. The actor can also learn from scratch on the device itself.
What the author did not do
The author says each game has its own weights. They say merging them into one model would be feasible, but they did not do it. They also say the Doom-lite game, at 83.6 percent frame accuracy, is where the error shows most. One commenter on Hacker News called out the use of looped transformers as a point of interest. Another suggested the method could help with procedural generation in games built the usual way.
The project is a demonstration, not a product. For a team that builds with models, it is a reference point for how small the floor is. A model with 131,000 parameters and 460 KB of memory is a different unit of work from a frontier model.
Source
tinyworldformer on GitHub, with a longer write-up at sheepseb.github.io.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
