
A diffusion model is trained in two phases:
TRAINING PHASE:
Real Image → Add Noise → Add More Noise → ... → Pure Random Noise
(corruption process)
GENERATION PHASE:
Pure Random Noise → Remove Noise → Remove More Noise → ... → New Image
(denoising process)
Here is the key tension:
| Behavior | What it means | Is it desirable? |
|---|---|---|
| Memorization | Model only reproduces training images | ❌ Not creative |
| Generalization | Model produces new images never seen before | ✅ Creative |
The puzzle: If the model only learned from existing cat photos, how does it produce new cat photos that never existed?
💡 Core Question: Where does this creativity mathematically come from?
Think of the denoising process like gas particles in a room with a force field:
ROOM = all possible data points (pixel space)
PARTICLES = individual noisy data points being denoised
FORCE FIELD = the Score Function (SF)
The Score Function tells each particle:
Noisy Particle → [Score Function] → Direction of Pull → Moves toward meaningful data
Imagine a simple 1D world with only two training points: +1 and -1
Pull LEFT | Pull RIGHT
←←←←←←←←←←←←←←←←← | →→→→→→→→→→→→→→→→→
-1 0 +1
(training point) (sharp cliff) (training point)
The perfect score function creates a sharp cliff at 0:
Result: Every particle ends up at exactly -1 or +1 → Pure Memorization
💡 Key Insight: A perfect score function = a retrieval tool, not a creative engine.
Neural networks cannot learn perfectly sharp cliffs. Why?
Weight decay (regularization) during training penalizes complexity, forcing the network to learn smoother functions:
PERFECT Score Function: SMOOTHED Score Function (what NN learns):
| |
+1 |___ +1 |___
| | | \
| | ← sharp cliff | \ ← gentle slope
-1 | |___ -1 | \___
| |
-1 0 +1 -1 0 +1
PERFECT SF: SMOOTHED SF:
-1 ←← [0] →→ +1 -1 ← [SLOW ZONE] → +1
↑
Particles here slow down
and stop IN BETWEEN -1 and +1
= NEW data point generated!
The smoothed score function creates an "interpolation zone" between training points.
💡 Key Insight: Score smoothing = the mathematical origin of creativity. The model doesn't just pick existing points — it finds the space between them.
| Weight Decay | Smoothness | Interpolation Zone | Creativity |
|---|---|---|---|
| Low | Less smooth | Narrow | Less creative |
| High | Very smooth | Wide | More creative |
Real images live in high-dimensional pixel space, but most of that space is meaningless noise:
FULL PIXEL SPACE (billions of dimensions):
┌─────────────────────────────────────────┐
│ random noise random noise random │
│ noise [DATA MANIFOLD] noise │
│ random (thin sheet of random │
│ noise real images) noise │
│ random noise random noise random │
└─────────────────────────────────────────┘
The data manifold is like a thin sheet tucked inside this enormous space — it contains all meaningful images.
The model's challenge:
In high dimensions, score smoothing acts differently depending on direction:
DATA MANIFOLD
___________________
/ • • • • \ ← training data points
/___________________/
Direction 1: TOWARD the manifold (perpendicular)
Direction 2: ALONG the manifold (tangential)
| Direction | Perfect SF behavior | Smoothing effect | Result |
|---|---|---|---|
| Toward manifold | Already smooth (straight line) | Little change | Particles still reach manifold quickly ✅ |
| Along manifold | Sharp cliff (like 1D example) | Significant smoothing | Particles slow down, interpolate between training points ✅ |
Score Smoothing in High Dimensions:
Step 1: Particle moves TOWARD manifold (fast, unaffected by smoothing)
→ Ensures image looks REALISTIC
Step 2: Particle moves ALONG manifold (slowed by smoothing)
→ Settles in blank space BETWEEN training points
→ Ensures image is NOVEL
💡 Key Insight: Score smoothing doesn't blur images (which would happen if it slowed movement in ALL directions). It selectively slows movement along the manifold, enabling interpolation without sacrificing quality.
Neural Network Training
↓
Weight Decay / Regularization (explicit OR implicit from gradient descent)
↓
Neural Network cannot learn perfectly sharp score functions
↓
Score Smoothing occurs
↓
"Interpolation Zone" created between training data points
↓
In high dimensions: slows movement ALONG manifold only
↓
Generated data lands BETWEEN training points ON the manifold
↓
New, realistic, never-before-seen data = CREATIVITY
Training data: Score smoothing effect: Generated output:
Cat Photo A ──────────────────────────────────────→ New Cat Photo C
(interpolation along (combines features
Cat Photo B ──────────────────────────────────────→ of A and B in a
manifold) novel way)
| Concept | Key Idea |
|---|---|
| Diffusion Model | Learns to reverse noise corruption to generate new data |
| Score Function | The "force field" guiding noisy particles toward meaningful data |
| Perfect SF | Causes memorization — particles collapse onto training points |
| Score Smoothing | Neural network regularization blurs the SF, creating interpolation zones |
| Data Manifold | The thin "sheet" of meaningful data in high-dimensional space |
| Direction-dependent smoothing | Smoothing slows movement along manifold (novelty) but not toward it (quality) |
| Creativity | A predictable mathematical consequence of how neural networks learn, not a random fluke |
🎯 The Big Takeaway: Diffusion model creativity is not magic. It is the direct mathematical result of neural networks being imperfect learners — their inability to learn perfectly sharp functions forces them to interpolate between training data along the hidden data manifold, producing novel and realistic outputs.