Game Boy Diffusion
A 1.08M-parameter MLP diffusion model (784 → 512 → 512 → 784) runs end-to-end on an unmodified Game Boy Color, generating a 28×28 doodle in ~85 seconds via 16 DDIM steps. The model is quantized to int8 weights, 4-bit activations, and 16-bit accumulators with quantization-aware training that mimics the ROM’s exact integer arithmetic. Because the Game Boy’s Z80-derived CPU has no multiply instruction, every multiply-add becomes two lookups in a 24 KB WRAM product table plus a 16-bit add (18 cycles). The project is a concrete demonstration that pixel-space diffusion can be pushed into kilobyte-class hardware without architectural novelty — just aggressive quantization and lookup-based arithmetic.
Key claims
Section titled “Key claims”- A 784 → 512 → 512 → 784 MLP ε-predictor trained on 880,000 Quick, Draw! sketches (8 classes × 110k) at 28×28 generates recognizable doodles in 16 DDIM steps from pure noise on a Game Boy Color [project page].
- 2 MB cartridge ROM holds the quantized weights; none of the training drawings are stored on cart (the model generates from fresh noise each run) [project page].
- Int8 weights + 4-bit activations + 16-bit sums with quantization-aware training reproduce the Python reference bit-for-bit when checked by an emulator across all 8 classes [project page].
- A 24 KB WRAM product table turns every MAC into two table lookups plus a 16-bit add in 18 CPU cycles, working around the absence of a hardware multiply [project page].
- The implementation requires Game Boy Color double-speed mode and the GBC’s extra WRAM banks; a stock DMG Game Boy would not fit the ROM or memory budget [project page].
- Per-image compute is ~8.8M MACs; wall-clock is ~85 s per drawing at ~16 denoising steps [project page].
Method
Section titled “Method”The generator is a two-hidden-layer MLP ε-predictor operating on flattened 28×28 pixel vectors (no VAE, no convolutions, no attention), coupled with a DDIM update rule that removes a fraction of the predicted noise each step. Training uses Google’s Quick, Draw! dataset (CC BY 4.0, 8 classes). The non-trivial engineering is a two-step quantization pipeline: (1) QAT during training with integer-exact simulation of what the ROM will later execute, and (2) a lookup-table arithmetic backend on the device — because the Game Boy CPU lacks a multiply instruction, every weight×activation product is realized as two table reads (indexed by the two operands) and a 16-bit addition into a running accumulator. An emulator-side regression harness compares the ROM’s output tensors against the Python reference at every DDIM step, for every class, and reports bit-equivalence.
Results
Section titled “Results”- 16 DDIM denoising steps per image, ~85 seconds wall-clock on a Game Boy Color.
- 8.8 million multiply-adds per generated image.
- 1.08 million model parameters.
- 2 MB cartridge, almost entirely occupied by quantized weights.
- Bit-exact match between ROM output and Python reference across all 8 classes under emulator testing.
Why it’s interesting
Section titled “Why it’s interesting”Sits at the extreme-low-compute end of the Pixel-space diffusion design space. The filed literature’s pixel-space thesis — “the gap vs latent diffusion was the loss function and training cost, not the encoder” (PixelGen: Improving Pixel Diffusion with Perceptual Supervision) — is tested here from the opposite direction: skip latents not for quality but because the hardware target cannot host a VAE. A 1.08M-param MLP on 28×28 pixels is roughly nine orders of magnitude smaller in compute than PixelDiT-XL at ImageNet-256 (PixelDiT: Pixel Diffusion Transformers for Image Generation), yet it preserves the structural recipe (predict-the-clean-image + DDIM step). Also an existence proof for aggressive integer quantization + lookup-table arithmetic as a complete substitute for floating-point matmul on CPUs without hardware multiply — of interest to anyone thinking about on-device inference where even int8 vectorized SIMD is unavailable.
See also
Section titled “See also”- Pixel-space diffusion — same architectural family (no VAE, MLP/DiT on raw pixel grid), extreme-small-scale datapoint
- PixelGen: Improving Pixel Diffusion with Perceptual Supervision — the pixel-space-diffusion canonical reference; gb-diffusion is the hobby-scale analogue
- PixelDiT: Pixel Diffusion Transformers for Image Generation — the opposite extreme (1024² NVIDIA T2I in pixel space)