VizuaraVizuara AI Pods
← The Production Lab
The Dreamer · Production build

Dream to Catch

A from-scratch rebuild of IRIS: a tokenizer turns each frame into 16 tokens, a transformer dreams the next frame and its reward, and the policy trains only on imagined games. It touches the real environment for the first time at test — and catches every ball. Including the honest failure that almost sank it.

500 / 500
real games caught, matching the oracle
3 → 256
codebook codes rescued from collapse
~$3
total GPU cost, one A10G

The build, step by step

The exact path we followed — and the one you'll follow in the code kit.

1

Three small parts

A VQ-VAE tokenizer (0.8M params), a transformer world model (3.3M), and an actor-critic (0.8M). Five million parameters, end to end.

2

Train the dream

Every 64×64 frame becomes 16 discrete tokens. The transformer learns to predict the next tokens, the reward, and whether the episode ends — a language model for gameplay. The policy then trains purely inside its imagination.

3

The failure

Every metric looked healthy — reconstruction near-perfect, next-frame accuracy 98%. Yet the policy stayed exactly random. The tokenizer had collapsed to 3 of its 256 codes and quietly deleted the ball from every frame. A policy cannot learn to catch a ball that doesn't exist in its dream.

4

The fix

EMA codebook updates with dead-code revival, and one decisive change: weight the reconstruction loss toward the ball. Ball recall went to 1.00 on every seed.

5

Awake

On 500 fresh real games the imagination-trained policy caught the ball every single time — 1.00, matching a hand-coded oracle, against a 0.16 random baseline.

From the run

A dream rollout — only the first frame is real
A dream rollout — only the first frame is real
The paddle slides under the imagined ball
The paddle slides under the imagined ball
The world model fires the +1 — inside the dream
The world model fires the +1 — inside the dream
Checking access…