Temporal Feature Matters: A Framework for Diffusion Model Quantization

Yushi Huang, Ruihao Gong, Xianglong Liu, Jing Liu, Yuhang Li, Jiwen Lu, Dacheng Tao

TL;DR

This paper introduces a specialized post-training quantization (PTQ) framework for diffusion models that focuses on protecting "temporal features"—the embeddings that guide the multi-step denoising process. By combining a novel Temporal Information Block (TIB) optimization strategy with offline feature caching, the authors achieve nearly lossless 4-bit quantization and significant hardware speedups (up to 5.76x) across diverse image and video generation tasks.

What Problem Does This Paper Address?

Diffusion models are the current state-of-the-art for generative tasks, but their iterative nature makes them computationally expensive and memory-intensive. Quantization—reducing the precision of model weights and activations (e.g., from 32-bit floats to 4-bit integers)—is a standard way to speed up inference.

However, standard quantization techniques often fail for diffusion models. The authors identify a critical bottleneck: temporal feature disturbance. Diffusion models rely on a timestep $t$ to navigate the denoising trajectory. This timestep is encoded into "temporal features" that are hypersensitive to noise. When these features are quantized poorly, the model suffers from "temporal information mismatch"—it essentially loses track of where it is in the generation process, leading to significant image quality degradation.

Temporal features are significantly more sensitive to noise than other activations.

Methods

The authors propose a three-pronged framework to maintain the integrity of these sensitive temporal features:

  1. TIB-based Maintenance: The authors define a Temporal Information Block (TIB), grouping all modules responsible for generating temporal features. They introduce Temporal Information-aware Reconstruction (TIAR) to optimize weights specifically to minimize temporal feature error, rather than general block-wise error. They also use Finite Set Calibration (FSC), which creates separate quantization parameters for each discrete timestep, acknowledging that these activations vary wildly but predictably over time.
  2. Cache-based Maintenance: Since temporal features only depend on the timestep $t$ (which is a finite set, e.g., 1 to 1000) and not the input image data, they can be pre-computed. The authors pre-calculate, quantize, and cache these features offline. During inference, the model simply reloads the high-quality cached features, bypassing the noisy online generation entirely.
  3. Disturbance-aware Selection (DS): Not all features benefit equally from caching vs. TIB optimization. The framework includes a fine-grained selection strategy that evaluates the error for every single temporal feature and chooses the best maintenance method for each, ensuring the lowest possible disturbance.
Overview of the proposed framework showing TIB-based maintenance, Cache-based maintenance, and the selection strategy.

Datasets

The framework was rigorously tested across a wide variety of benchmarks:

  • Unconditional Image Generation: CIFAR-10, LSUN-Bedrooms, LSUN-Churches, CelebA-HQ, and FFHQ.
  • Class-conditional Generation: ImageNet (256x256).
  • Text-to-Image (T2I): MS-COCO, utilizing foundational models like Stable Diffusion v1.4, SD-XL, SD-XL-turbo, and the recent FLUX.1-Schnell.
  • Video Generation: OpenSora.

Key Insights and Ideas

  • Hypersensitivity of Time: Temporal features are the "clock" of the diffusion process. Even small quantization errors here cause the model to import "wrong" information from different timesteps, derailing the denoising trajectory.
  • Independence from Data: A crucial observation is that temporal features are independent of the noisy image input $x_t$. This allows them to be optimized in isolation (TIB) or even pre-computed (Cache), a luxury not available for standard image features.
  • Finite Activation Sets: Because the number of timesteps is fixed and finite, the authors can treat activation calibration as a discrete optimization problem rather than a statistical estimation problem, leading to much more accurate quantization.
Quantization error causes temporal information mismatch, where the model's features at timestep t align more closely with full-precision features from a different timestep.

Key Results

  • Superior Quality: On SD-XL (W4A8 configuration), the framework reduced the FID score by 5.61 compared to previous state-of-the-art methods, achieving nearly lossless generation.
  • Hardware Acceleration: The authors demonstrated significant real-world speedups by deploying quantized models:
  • 5.76x speedup on NVIDIA H800 GPUs for SD-XL.
  • 2.20x speedup on Intel Xeon CPUs.
  • Successful deployment on edge devices like the NVIDIA Jetson Orin Nano (2.85x speedup) and iPhone 15 Pro Max (1.98x speedup).
  • Visual Fidelity: Qualitatively, the method avoids the "washed out" or structurally incorrect artifacts common in low-bit quantized diffusion models.
Visual comparison showing how temporal feature quantization preserves the denoising trajectory compared to standard methods.

Limitations and Future Work

  • Scope of Features: The authors acknowledge that while temporal features are critical, other semantic features in conditional models (like text embeddings) might also possess unique physical significance and sensitivity that this framework doesn't yet address.
  • PTQ vs. QAT: The current work focuses on Post-Training Quantization. The authors suggest that extending these insights to Quantization-Aware Training (QAT) could push the limits even further, potentially enabling stable 2-bit generation.
  • Memory Overhead: While Cache-based maintenance is efficient, it does introduce a small memory overhead to store the cached features, which might be a constraint for extremely memory-limited devices if the timestep count is very high.

Summary updated

BibTeX
@article{huang2025temporal,
  author = {Yushi Huang and Ruihao Gong and Xianglong Liu and Jing Liu and Yuhang Li and Jiwen Lu and Dacheng Tao},
  title = {{Temporal Feature Matters: A Framework for Diffusion Model Quantization}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2025},
  doi = {10.1109/tpami.2025.3585692},
}
Figure