Towards demystifying the creativity of diffusion models

Towards demystifying the creativity of diffusion models

Concept 1: What is a Diffusion Model and What Does "Creativity" Mean?

The Basic Setup

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)

The "Creativity" Problem

Here is the key tension:

BehaviorWhat it meansIs it desirable?
MemorizationModel only reproduces training images❌ Not creative
GeneralizationModel 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?


Concept 2: The Score Function — The "Force Field" of Denoising

The Analogy

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:

  • Which direction to move
  • How strongly to move
Noisy Particle → [Score Function] → Direction of Pull → Moves toward meaningful data

What a "Perfect" Score Function Does

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:

  • Everything left of 0 → pulled to -1
  • Everything right of 0 → pulled to +1

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.


Concept 3: Score Smoothing — Where Creativity is Born

The Imperfection of Neural Networks

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

What Smoothing Does to Particles

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.

The Strength of Regularization Matters

Weight DecaySmoothnessInterpolation ZoneCreativity
LowLess smoothNarrowLess creative
HighVery smoothWideMore creative

Concept 4: The Data Manifold — Extending to the Real World

The Problem with High Dimensions

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:

  1. Infer the shape of this hidden manifold from finite training samples
  2. Generate new points on the manifold

Two Directions of Movement

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)
DirectionPerfect SF behaviorSmoothing effectResult
Toward manifoldAlready smooth (straight line)Little changeParticles still reach manifold quickly ✅
Along manifoldSharp cliff (like 1D example)Significant smoothingParticles slow down, interpolate between training points ✅

The Balance Achieved

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.


Concept 5: Putting It All Together — The Full Picture

The Complete Chain of Causation

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

A Concrete Example

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)

Summary Table

ConceptKey Idea
Diffusion ModelLearns to reverse noise corruption to generate new data
Score FunctionThe "force field" guiding noisy particles toward meaningful data
Perfect SFCauses memorization — particles collapse onto training points
Score SmoothingNeural network regularization blurs the SF, creating interpolation zones
Data ManifoldThe thin "sheet" of meaningful data in high-dimensional space
Direction-dependent smoothingSmoothing slows movement along manifold (novelty) but not toward it (quality)
CreativityA 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.

More to study