<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa" -->

---
title: A tiny world model running games on a Raspberry Pi Pico 2 W
description: A looped transformer world model runs on a Raspberry Pi Pico 2 W, generating game frames while a second small network plays them. The world model (26k-131k...
canonical: https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A tiny world model running games on a Raspberry Pi Pico 2 W | daily.dev
og:description: A looped transformer world model runs on a Raspberry Pi Pico 2 W, generating game frames while a second small network plays them. The world model (26k-131k...
og:url: https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa
og:image: https://api.daily.dev/og/posts/T1zQSdEsA.png
og:image:alt: A tiny world model running games on a Raspberry Pi Pico 2 W
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A tiny world model running games on a Raspberry Pi Pico 2 W

**[Hacker News](https://daily.dev/sources/hn)** · 20 min read · 0 upvotes · 0 comments

## Summary

A looped transformer world model runs on a Raspberry Pi Pico 2 W, generating game frames while a second small network plays them. The world model (26k-131k parameters, int8 quantized) predicts the next frame and reward from the current frame and action; the actor (9k-16k parameters) picks actions from generated frames. Five games (Breakout, Doom-lite, Flappy Bird, Pong, Pac-Man lite) run entirely inside the dream, with held-out frame accuracy from 83.6% to 100% depending on the game. Agents train with Stream AC(λ), a buffer-free reinforcement learning method, both in the real game and inside the dream. The project also compiles to WebAssembly and runs in a browser at 1-5ms per frame.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/SheepSeb/tinyworldformer>

## Questions this post answers

### How many parameters does a world model need to generate playable game frames like Breakout or Pong on a microcontroller?

Between 26,000 and 131,000 parameters, depending on the game's complexity. Breakout needs only 26k parameters and 4.3M multiply-adds per frame at 99.99% exact held-out frame accuracy, while Pac-Man lite needs 131k parameters and 8.2M multiply-adds for 86.4% exact frame accuracy, run as an int8-quantized looped transformer applied twice per frame.

_Anyone sizing a tiny transformer for an embedded device can compare real parameter-to-accuracy tradeoffs like this on daily.dev._

### What reinforcement learning algorithm works without a replay buffer or batches for training an agent one transition at a time?

Stream AC(λ), introduced by Elsayed, Vasan and Mahmood in 2024, learns from a single transition at a time with no replay buffer, no batches, and no target network. It uses eligibility traces to carry credit back in time and ObGD to shrink any update step that would overshoot the TD target, making it suitable for on-device learning on constrained hardware like a microcontroller.

_Developers evaluating lightweight RL approaches for edge devices can track algorithms like this on daily.dev._

### How do you fit int8 matrix multiplication efficiently on an RP2350 microcontroller like the Raspberry Pi Pico 2 W?

Int8 dot products use the SMLAD instruction, which performs two multiply-adds in one cycle after SXTB16 unpacks packed bytes into 16-bit halves from a single 32-bit load. Attention uses UXTB16 instead since it multiplies uint8 probabilities by int8 values. Norms, the exp table lookup, and final scaling stay in float32 on the chip's FPU, with a frame costing 2 to 8 million multiply-adds.

_Engineers optimizing quantized inference on microcontrollers can dig into instruction-level tricks like these on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 15 comments across hackernews (as of 2026-10-30).

**TL;DR:** Commenters are impressed that a tiny world model can run playable game dreams on microcontroller-class hardware, with most discussion focused on curious technical questions (per-game models, hallucination handling, state representation) rather than criticism.

**Sentiment:** 70% positive · 25% mixed · 5% skeptical

**The case for**

- Seen as impressive that this works given the extremely constrained hardware (a microcontroller, not even a full computer).
- The hallucination-fixing trick (noisy input, clean target) was called clever.
- Viewed as a potentially useful technique for procedural generation in more traditional games.

**The pushback**

- Some noted it's actually a separate model per game rather than one shared world model, which is less impressive than it first appears.
- One commenter suggested a single model that could generalize or dream up new games between training games would be more compelling.

**By community**

- hackernews (positive): Enthusiastic and curious reception, with detailed technical questions about training, state representation, and hallucination handling rather than pushback.

**Open questions**

- How exactly do the agents infer ball direction/velocity in Pong or Breakout from generated frames (e.g. via faded prior shadows)?
- How is Pac-Man's mouth direction or Doom's facing direction encoded/grokked by the agent from frame state?
- Could the separate per-game models be merged into one model that generalizes across games?

**Highlights**

> Not the poster you responded to... Your Singleton hack was clever. In some ways it brings game design back into the equation, in that it mirrors the special cases that most game code has to deal with. You alluded to something in the docs that I was curious about, which is state. From reading it, I gathered that both agents interpret the direction of the Pac Man based on the position of its mouth in the previous frame. And one of your graphics seems to imply that the Doom state of where you are and which direction you're facing is magically grokked by the agent reading the map in the corner. Is that so? In that case, I wanted to ask, in pong or breakout, what is it using to figure out the direction and velocity of the ball? Faded prior shadows in other cells, maybe?
> — [noduerme on hackernews](https://news.ycombinator.com/item?id=50300975)

> Yes, there were some hallucinations, e.g: in breakout hitting a corner would destroy more blocks than expected, in doom-lite it could shoot from miles away and get a kill. The fixed was add some noise to the input frame and keep the target clean.
> — [sheepseb on hackernews · 1 comments](https://news.ycombinator.com/item?id=50300834)

> > Also, it's the same model for all the games, right It's a bit unclear but it looks like different models, since they all have different parameter and MAC counts. It would be much more impressive with a single world model that could maybe dream up new games inbetween the games in the training set.
> — [svantana on hackernews](https://news.ycombinator.com/item?id=50296584)

> Honestly fascinating. I almost feel like you'd be better off avoiding any discussion of the fact that this runs on a Raspberry Pi Pico 2 W because it takes away from the crazy world model capabilities (of course, the fact that this does run on a Pico 2 makes the whole thing much more impressive). There's gotta be a good way to incorporate this logic into a larger, more "traditional" game in a meaningful way. Seems like an approach for procedural generation that could solve some of the issues usually found with actual procedural generation.
> — [nater5000 on hackernews](https://news.ycombinator.com/item?id=50296197)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50295450) · 192 points · 15 comments

## Similar posts on daily.dev

- [GitHub - gizmo64k/soulplayer-c64: A real 25k-parameter transformer running on a Commodore 64\!](https://daily.dev/posts/github---gizmo64k-soulplayer-c64-a-real-25k-parameter-transformer-running-on-a-commodore-64--fbf9hfz8d) · Hacker News · 0 upvotes · 0 comments
- [Interactive world simulator for robot policy training and evaluation](https://daily.dev/posts/interactive-world-simulator-for-robot-policy-training-and-evaluation-j0dy0nfan) · Robohub · 0 upvotes · 0 comments
- [Running Generative AI On An RP2350](https://daily.dev/posts/running-generative-ai-on-an-rp2350-bdjzujrq0) · Hackaday · 0 upvotes · 0 comments

---

Tags: [#data-science](https://daily.dev/tags/data-science), [#rust](https://daily.dev/tags/rust), [#reinforcement-learning](https://daily.dev/tags/reinforcement-learning), [#transformers](https://daily.dev/tags/transformers)

[View this post on daily.dev](https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A tiny world model running games on a Raspberry Pi Pico 2 W","url":"https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa"},"datePublished":"2026-10-29T22:32:27.566Z","dateModified":"2026-10-30T08:07:27.086Z","description":"A looped transformer world model runs on a Raspberry Pi Pico 2 W, generating game frames while a second small network plays them. The world model (26k-131k...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4fd6e7e6ad3b5d8ab9d901c30c31f787?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4fd6e7e6ad3b5d8ab9d901c30c31f787?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"data-science,rust,reinforcement-learning,transformers","timeRequired":"PT20M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"A tiny world model running games on a Raspberry Pi Pico 2 W"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-tiny-world-model-running-games-on-a-raspberry-pi-pico-2-w-t1zqsdesa#faq","mainEntity":[{"@type":"Question","name":"How many parameters does a world model need to generate playable game frames like Breakout or Pong on a microcontroller?","acceptedAnswer":{"@type":"Answer","text":"Between 26,000 and 131,000 parameters, depending on the game's complexity. Breakout needs only 26k parameters and 4.3M multiply-adds per frame at 99.99% exact held-out frame accuracy, while Pac-Man lite needs 131k parameters and 8.2M multiply-adds for 86.4% exact frame accuracy, run as an int8-quantized looped transformer applied twice per frame. Anyone sizing a tiny transformer for an embedded device can compare real parameter-to-accuracy tradeoffs like this on daily.dev."}},{"@type":"Question","name":"What reinforcement learning algorithm works without a replay buffer or batches for training an agent one transition at a time?","acceptedAnswer":{"@type":"Answer","text":"Stream AC(λ), introduced by Elsayed, Vasan and Mahmood in 2024, learns from a single transition at a time with no replay buffer, no batches, and no target network. It uses eligibility traces to carry credit back in time and ObGD to shrink any update step that would overshoot the TD target, making it suitable for on-device learning on constrained hardware like a microcontroller. Developers evaluating lightweight RL approaches for edge devices can track algorithms like this on daily.dev."}},{"@type":"Question","name":"How do you fit int8 matrix multiplication efficiently on an RP2350 microcontroller like the Raspberry Pi Pico 2 W?","acceptedAnswer":{"@type":"Answer","text":"Int8 dot products use the SMLAD instruction, which performs two multiply-adds in one cycle after SXTB16 unpacks packed bytes into 16-bit halves from a single 32-bit load. Attention uses UXTB16 instead since it multiplies uint8 probabilities by int8 values. Norms, the exp table lookup, and final scaling stay in float32 on the chip's FPU, with a frame costing 2 to 8 million multiply-adds. Engineers optimizing quantized inference on microcontrollers can dig into instruction-level tricks like these on daily.dev."}}]}
```

