Gradivex
  • Home
  • Academy
  • Arena
  • Visualizer
  • Models
Log in
Deep Learning/Generative Models/Lesson 4

Diffusion models

Module 4 · Lesson 4 of 5 · 7 min read
Theory

Learn destruction, then run it backwards

The idea behind DALL·E, Midjourney and Stable Diffusion sounds, on first hearing, like a prank: teach a network to DESTROY images, then run the destruction in reverse.

The forward half needs no learning at all. Take a real photo and add a whisper of random noise. Again. And again, hundreds of times, until nothing remains but pure static. Boring, mechanical, irreversible-looking, every image ends as noise.

The learning happens on the way back. Train a network on ONE tiny skill: given an image at some noise level, undo a single step, make it slightly LESS noisy. Not "denoise everything", just one small step backwards. That is an easy, stable, well-posed learning problem: the network always knows exactly what noise was just added, so it always has a precise target.

Now the payoff. Once the network can undo any single step… start from PURE RANDOM STATIC and apply it hundreds of times. Each step, the static gets slightly less noisy, faint structure appears, sharpens, becomes unmistakable, until a brand-new image stands where noise was. The model never copies a training image; it walks noise backwards into the shape of the data it learned. Watch both directions:

Interactive

Destroy, then create

Forward: noise the picture step by step until nothing is left. Then flip it: start from FRESH static and let the trained denoiser walk backwards into a brand-new sample.

Forward diffusion: noise step 0/10
Theory

Why diffusion took the crown

Within about two years of maturing, diffusion had dethroned GANs as the default for image generation. The reasons map cleanly onto everything this module taught you:

  • Stable training: the objective is plain denoising: predict the noise, minimize the error. No adversary to keep balanced, no arms race to referee. Compare the GAN lesson's pain list.
  • No mode collapse: nothing rewards finding one perfect trick; the model must learn to denoise EVERYWHERE in the data distribution, so variety comes built in.
  • Steerable, step by step, this is the deep reason text-to-image works: at every denoising step, the text prompt's representation nudges WHICH image the noise resolves toward. "A castle at sunset" is not a filter applied after, it is a hand guiding all thousand steps.

The honest cost: SPEED. A GAN creates in one forward pass; diffusion needs dozens to hundreds of passes per image. Making diffusion fast (fewer steps, distilled models) is one of the field's liveliest research fronts right now.

And connect it to the VAE lesson: Stable Diffusion runs this entire denoising walk inside a VAE's compact latent space rather than on raw pixels, cheaper by orders of magnitude, which is why it runs on a gaming GPU. The module's architectures are not rivals so much as parts bins: modern systems are assembled from all of them.

Interactive

Check your understanding

What single skill does a diffusion model actually learn during training?

Takeaway

What to remember

  • ✓Forward process (no learning): add noise step by step until any image becomes pure static.
  • ✓The learned skill: undo one small noising step. Easy target, stable training, the anti-GAN.
  • ✓Generation: start from fresh static, apply the undo hundreds of times, noise walks backwards into a new sample.
  • ✓Won the crown via stability, built-in variety, and per-step steerability (that is how your prompt guides the image). The price: many passes = slow sampling.
  • ✓Stable Diffusion denoises inside a VAE's latent space, the module's ideas compose. One lesson left: put GAN, VAE and diffusion side by side and choose like an engineer.
Mentor-0

Stuck on something in this lesson? Ask.

0/1000

Every lesson is free to read. Log in to save your progress, complete lessons, and earn Compute and XP.

Log in free
VAEs: variational autoencodersComparing approaches
Gradivex

Understand AI from the inside, read it, see it, prove it.

Platform

AcademyVisualizerRoadmapsModels

Community

DiscordLeaderboard

Company

PrivacyTerms

© 2026 Gradivex. All rights reserved.