Abstract
Diffusion Transformers (DiTs) have emerged as the state-of-the-art backbone for high-fidelity generative models. However, their massive parameter counts and iterative sampling process present significant deployment challenges. This paper introduces Hierarchical Timestep Grouping (HTG), a post-training quantization (PTQ) framework specifically engineered for DiTs. By addressing the temporal instability of activation outliers through constrained hierarchical clustering and re-parameterization, HTG achieves near-lossless 8-bit quantization (W8A8) and establishes a new state-of-the-art for aggressive 4-bit weight quantization (W4A8).
Introduction
As generative AI scales, Diffusion Transformers (DiTs) are replacing U-Nets in flagship models like Stable Diffusion 3 and Sora. While powerful, these models are computationally intensive. Quantization—reducing numerical precision to 8-bit or 4-bit integers—is a primary strategy for edge deployment. However, standard quantization techniques often fail on DiTs due to unique architectural behaviors. This research identifies and solves the "moving target" problem of activation outliers in the diffusion process.
The Challenge: Temporal Instability and Moving Outliers
Unlike standard Transformers used in LLMs, DiTs exhibit two distinct challenges during quantization:
- Channel-specific Outliers: Specific activation channels contain extreme values that disproportionately consume the available dynamic range, reducing precision for the rest of the data.
- Temporal Instability: The distribution, magnitude, and even the polarity of these outliers shift drastically across different denoising timesteps.
As shown in the figure above, a channel that is highly positive at the start of the generation process (timestep 99) may become highly negative by the end (timestep 0). A static quantization strategy that works at the beginning of the generation will inevitably fail as the process evolves.
The Hierarchical Timestep Grouping (HTG) Framework
To overcome these challenges, the authors propose the HTG framework, which optimizes the quantization process without adding inference overhead.
Temporally-grouped Channel-wise Shifting
To handle asymmetric outliers, HTG shifts activation distributions to be zero-centered. To avoid the prohibitive storage cost of saving unique shift vectors for every timestep, the authors use constrained hierarchical clustering. This groups adjacent timesteps with similar distributions into a small number of clusters (e.g., 10 groups for 100 steps), significantly compressing the required metadata.
Temporally-aggregated Channel-wise Scaling
HTG utilizes an Exponential Moving Average (EMA) to calculate a global scaling vector. This technique, inspired by SmoothQuant, migrates quantization difficulty from activations to weights. By aggregating outlier information across the entire denoising trajectory, the weights remain robust and consistent throughout the process.
Re-parameterization for "Free" Inference
A critical innovation of HTG is the absorption of these shifting and scaling parameters into the preceding Adaptive Layer Norm (AdaLN) modules. This re-parameterization ensures that the model benefits from sophisticated per-channel adjustments with zero additional computational latency or "bit operations" during the actual inference pass.
Experimental Results
The researchers evaluated HTG using the DiT-XL/2 model on the ImageNet dataset at 256×256 and 512×512 resolutions. The results demonstrate significant improvements over existing methods like PTQ4DiT and Q-Diffusion:
- W8A8 (8-bit Weight & Activation): HTG achieved an FID score of 5.14 on ImageNet 256x256, nearly matching the full-precision (FP32) baseline of 5.02.
- W4A8 (4-bit Weight & 8-bit Activation): HTG set a new benchmark with an FID of 6.73, substantially outperforming the previous state-of-the-art (7.75).
- Efficiency: The method adds negligible storage overhead (~1% of model size) and maintains the original inference speed through its re-parameterization trick.
Conclusion
Hierarchical Timestep Grouping effectively tames the temporal instability of Diffusion Transformers. By recognizing that while distributions change, they do so smoothly, HTG provides a mathematically sound and computationally efficient path toward deploying high-quality generative models on resource-constrained devices. Future work remains to address the extreme sensitivity of attention mechanisms to enable 4-bit activation quantization (W4A4).
Summary updated