Sebastian-Ion Nae has put two small neural networks on a Raspberry Pi Pico 2 W, and published the project on GitHub. One network is a world model: given the current frame and an action, it predicts the next frame and the reward. The other is an actor that looks at the dreamed frame and picks the next action. Neither ever touches the real game.
The world model is a single transformer block with one set of weights, applied one to four times, with the input added back before each pass. More loops means better frames and slower play, so the firmware runs two on the Pico. Weights and activations are int8, trained with quantization aware training so the int8 model is the model that was trained. Games include Breakout, Pong, Flappy Bird, Pac-Man lite and a Doom-lite with a 3D view and a minimap.
Both networks run on core 1 of the RP2350 while core 0 handles USB and an optional ST7789 Display Pack. Pac-Man is the largest at 600 KB of flash and 460 KB of SRAM.…