Vol. XII · No. 05 · May 2026
Jake Cuth.

Noise, guided back
to structure it never knew.

A toy diffusion model in two dimensions. Place points on a canvas, watch the forward process dissolve them into Gaussian noise, then guide the reverse process step by step until structure re-emerges. The core idea behind Stable Diffusion, DALL-E, and every modern image generator.

The canvas below runs a simplified diffusion process. You draw a simple shape (or pick a preset). The forward pass adds noise according to a beta schedule. The reverse pass uses an oracle denoiser to predict and subtract noise at each step. Twenty steps from chaos to coherence. All in your browser.


The most powerful image generators do not paint. They unerase.

Instead of learning the probability of an image directly. A problem so vast it is practically intractable. Diffusion models learn the opposite: how to take a noisy image and make it slightly less noisy. Repeat this guess thousands of times and you can turn static into a photograph. The insight, first formalized by Sohl-Dickstein et al. in 2015 and later refined by Ho et al. in 2020, is that adding noise is easy. Learning to undo it is hard, but tractable.

The forward process is pure physics. At each step, a small amount of Gaussian noise is added to the image. After enough steps, the original signal is drowned in randomness and the result is indistinguishable from pure noise. The reverse process is where the model lives. It learns to estimate the noise that was added, the score function, and subtracts it, walking backward from chaos toward structure one careful step at a time. What looks like generation is really guided reconstruction.

The demo below strips this down to its skeleton. A 32-by-32 grid, a fixed beta schedule, and an oracle denoiser that cheats by remembering the exact noise it added. The result is not DALL-E. But every concept is there: the forward corruption, the iterative reverse walk, the re-emergence of form from noise. Watch it once and the papers will read differently.


Click cells to toggle them, or pick a preset. The forward pass dissolves your drawing into noise. The reverse pass walks back step by step. The denoiser is an oracle. It knows the exact noise that was added, so the reconstruction is perfect. Real diffusion models learn this instead.

Click to draw · or pick a preset
Preset

Fig. A · The forward pass

Corrupt with grace

Starting from a clean image x0, the forward process adds a small amount of Gaussian noise at each timestep. The amount is controlled by a beta schedule. After T steps, the image is mathematically indistinguishable from pure noise. The key trick is that xt can be sampled in one shot from x0. No need to simulate every intermediate step.

Fig. B · Learn the score

Estimate the noise

A neural network is trained to look at a noisy image xt and predict the noise ε that was added. This is equivalent to learning the score function of the data distribution, the gradient of log-probability with respect to the image. In this toy demo, the oracle knows ε exactly. Real models learn it from millions of examples.

Fig. C · The reverse walk

Walk back from chaos

With the noise predicted, the model estimates x0, then re-noises it to the previous timestep's distribution. Repeating this T times walks from pure Gaussian noise back to a structured image. The walk is stochastic. Run it twice and you get two different results. That randomness is the source of diffusion's creative range.


The same image, noised under two different beta schedules. Linear spreads noise evenly. Cosine front-loads it, preserving structure longer and collapsing faster at the end. Nichol and Dhariwal showed that the cosine schedule improves sample quality and training stability.

Linear schedule
MSE vs clean: --
Cosine schedule
MSE vs clean: --

Forward steps
20
Resolution
32×32
Beta range
1e-4 to 0.02
Algorithm
DDPM simplified
Inference time
<50 ms / step
Denoiser
Oracle (cheats)

Engine

Pure JavaScript running in a single Canvas 2D context. No WebGL, no WASM, no server. The diffusion math is implemented directly from the DDPM equations using Float32Arrays for the 32×32 grid. Beta schedules are precomputed; the forward pass samples xt in closed form; the reverse pass uses the stored noise vector as an oracle predictor. Everything updates in real time.

Model spec

32×32 binary grid input, values in {0, 1}. T = 20 timesteps. Linear schedule: βt ranges from 1×10-4 to 0.02. Cosine schedule: improved schedule from Nichol & Dhariwal 2021 with offset s = 0.008. Noise ε ~ N(0, 1) drawn once per session with Box-Muller. Forward and reverse are deterministic given the seed.

Reading list

Ho et al. · Denoising Diffusion Probabilistic Models (NeurIPS 2020) ↗
Nichol & Dhariwal · Improved Denoising Diffusion Probabilistic Models (2021) ↗
Sohl-Dickstein et al. · Deep Unsupervised Learning using Nonequilibrium Thermodynamics (ICML 2015) ↗

Limitations

The oracle denoiser is not a learned model. It cheats by using the exact noise vector from the forward pass. Real diffusion models must learn this from data, which is why they need millions of images and days of GPU time. The 32×32 resolution is far below production image generators. Only two beta schedules are shown; there are dozens of variants (sigmoid, polynomial, learned) with subtle trade-offs.