TinyWorldFormer runs generated games on a Raspberry Pi Pico 2 W
A developer demonstrated TinyWorldFormer running two compact neural networks simultaneously on a Raspberry Pi Pico 2 W: a world model generates the next frame and reward, while an actor selects actions from the generated frames. The world model uses a looped, int8-quantized transformer, and the actor supports streaming reinforcement-learning inside the generated environment; both run on the RP2350’s first core. The project includes five small games, quantization details, benchmark data, source code and instructions for reproducing the results.
The demonstration shows that world-model generation and online control can operate together on a low-cost microcontroller, providing a compact implementation with published details and reproduction steps.
Using 2 small neural networks to generate and play the game at the same time on a Raspberry Pi Pico 2 W. The first one creates the game: given the current frame and the action, it predicts the next frame and the reward. The second one plays that game: it uses the generated frame and picks an action.
Every frame above was sampled by the world model network, and the actions were taken by the actor network.
Why
I got interested in looped transformers, where one transformer block is applied several times with the same weights instead of stacking different layers. Reusing weights is cheap on memory, so I wanted to see if a looped world model could be small enough to run on a microcontroller. I picked the Pico 2 W because it is cheap and has an FPU, and small games because I could write the real versions directly into numpy and check every generated frame against them. Later I added a streaming RL agent so the board could also learn to play inside its own dream.
Some source content is omitted. Continue reading on the original site.