Chip Foundry Services Request Assessment

Diffusion Model Denoising

Diffusion Models are generative models that learn to reverse a gradual noise-addition process, training a neural network to predict and remove noise at each step — generating high-quality images, audio, and video by iteratively denoising random Gaussian noise into structured data through a learned reverse process.

Forward Process (Noise Addition):
- Gaussian Noise Schedule: given data sample $x_0$, gradually add Gaussian noise over $T$ timesteps ($T=1000$ typically); at timestep $t, x_t = \sqrt{\bar\alpha }_t \cdot x_0 + \sqrt{1-\bar\alpha_t} \cdot \epsilon $ where $\epsilon \sim N(0,I)$ and $\bar\alpha_t$ decreases from 1 to $\sim 0$; the forward process is fixed (not learned), only the reverse is trained
- Noise Schedule Design: linear schedule ($\beta_t$ from 0.0001 to 0.02) was original DDPM; cosine schedule provides more gradual corruption in early steps, preserving image structure longer and improving sample quality; $\mathrm{VP} (\text{variance-preserving})$ vs $\mathrm{VE} (\text{variance-exploding})$ formulations provide different mathematical treatments
- Signal-to-Noise Ratio: $\mathrm{SNR}(t) = \bar\alpha_t / (1-\bar\alpha_t)$ decreases monotonically; early timesteps (high SNR) capture global structure; late timesteps (low SNR) capture fine details; training loss can be weighted by SNR to emphasize different generation aspects
- Continuous Time: discrete timesteps $T\to \infty $ converges to a stochastic differential equation $(\mathrm{SDE})$; enables theoretical analysis through SDE/ODE solvers and provides a unified framework for score-based and DDPM models

Reverse Process (Denoising):
- Noise Prediction: neural network $\epsilon _\theta (x_t, t)$ predicts the noise $\epsilon $ added at timestep $t$; equivalently, predicts the score function $\nabla_x \log p(x_t)$ — both formulations are mathematically equivalent and lead to the same training objective
- Training Objective: minimize $E[\lVert{\epsilon - \epsilon _\theta (x_t, t)}\rVert^2]$ — simple mean squared error between predicted and actual noise; this denoising score matching objective is remarkably simple yet produces state-of-the-art generative models
- Architecture (U-Net): standard DDPM uses a U-Net with residual blocks, spatial attention, and timestep conditioning (via sinusoidal embeddings + FiLM conditioning); downsampling/upsampling path with skip connections captures multi-scale features
- Conditioning: text conditioning via cross-attention (inject CLIP text embeddings into U-Net attention layers); classifier-free guidance $(\mathrm{CFG})$ trains with conditional and unconditional objectives, interpolating at inference: $\epsilon_{\text{guided}} = \epsilon_{\text{uncond}} + w\cdot (\epsilon_{\text{cond}} - \epsilon_{\text{uncond}})$ with guidance scale $w=7-15$

Sampling Acceleration:
- DDIM (Denoising Diffusion Implicit Models): deterministic sampling using non-Markovian reverse process; skips timesteps ($1000\to 50$ steps) with minimal quality loss; enables interpolation in latent space and deterministic generation from fixed noise
- DPM-Solver: $\text{high-order} \mathrm{ODE}$ solver (2nd/3rd order) for the probability flow ODE; achieves high-quality samples in 10-25 steps — $40-100\times $ faster than original $1000-step \mathrm{DDPM}$
- Distillation: progressive distillation (Salimans & Ho 2022) trains student to match teacher's two-step output in one step; repeatedly halving steps achieves 4-8 step generation; consistency models (Song et al. 2023) enable single-step generation

Latent Diffusion (Stable Diffusion):
- Architecture: encodes images to a compressed latent space via $\mathrm{VAE} (8\times $ spatial compression); diffusion operates in latent space rather than pixel space — $64\times $ less computation than pixel-space diffusion
- Components: VAE encoder/decoder + U-Net denoiser + CLIP text encoder; modular design enables swapping components (different VAEs, different text encoders, custom U-Nets)
- ControlNet: auxiliary networks that add spatial conditioning (edges, poses, depth maps) to pre-trained diffusion models without modifying the base model; enables precise compositional control
- SDXL/SD3: SDXL adds second text encoder and refiner network; SD3 replaces U-Net with DiT (Diffusion Transformer) backbone achieving better text-image alignment and composition

Diffusion models are the dominant generative paradigm of the $2020s$ — their mathematical elegance, training stability, and unprecedented output quality have displaced GANs in image generation and enabled revolutionary applications in text-to-image, video generation, molecular design, and protein structure prediction.