TL;DR
CLQ is a new post-training quantization (PTQ) framework that successfully compresses Diffusion Transformers (DiTs) down to ultra-low W4A4 (4-bit weights and activations) precision. By combining cross-block calibration, orthogonal smoothing, and cross-layer parameter searching, it achieves nearly 4x memory savings and speedups with almost no loss in visual generation quality.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have revolutionized visual generation, powering state-of-the-art models like Open-Sora and PixArt-$\alpha$. However, their massive size makes them incredibly expensive to run. For instance, generating a short 512x512 video can take over 50 seconds on an enterprise-grade A100 GPU and consume more than 10GB of VRAM.
To deploy these models on consumer edge devices, we need quantization—converting high-precision floating-point numbers into low-bit integers. While this works well for Large Language Models (LLMs), DiTs are notoriously difficult to quantize. They contain extreme "outliers" (values far outside the normal range) that are much more impactful than those in LLMs. Standard quantization methods either blow up the rounding error to accommodate these outliers or clip them and lose critical generative information, leading to "collapsed" models that output nothing but noise.
Methods
The authors propose CLQ (Cross-Layer Guided Orthogonal-Based Quantization), which consists of three primary innovations:
- Cross-Block Calibration (CBC): Standard PTQ uses full-precision data to calibrate quantization parameters. However, as you move deeper into a network, quantization errors from earlier layers accumulate, creating a mismatch. CBC ensures that when calibrating a specific block, all preceding blocks are already quantized, providing a more "honest" distribution of activations.
- Orthogonal-Based Smoothing (OBS): To handle outliers, CLQ uses a static approach involving Hadamard matrices. It identifies "heavy" channels with extreme values and swaps them to pair with "light" channels. Then, it applies a block Hadamard transform to rotate the activations, effectively spreading the outlier energy across multiple channels. This makes the distribution easier to quantize without the heavy computational overhead of dynamic smoothing.
- Cross-Layer Parameter Searching (CLPS): Instead of just minimizing the error within a single layer, CLPS looks ahead. It identifies the "most influenced" subsequent layer (the one where a disturbance causes the biggest shift) and optimizes the current layer's quantization bounds ($l$ and $r$) to minimize the error at that downstream target.
Datasets
The researchers evaluated CLQ on two primary tasks:
- Image Generation: Using the PixArt-$\alpha$ model, evaluated via the GenEval benchmark (which tests for object counting, color, position, and attribute binding).
- Video Generation: Using Open-Sora 1.2, evaluated via VBench (which measures motion smoothness, aesthetic quality, and background consistency).
Key Insights and Ideas
- Outliers are Features, not Bugs: Unlike some models where outliers can be clipped, the authors found that in DiTs, these extreme values encode essential information for the generative process.
- The "Target Layer" Stability: A fascinating discovery was that the "most influenced" layer for a given module is remarkably stable across the model architecture. For example, in Open-Sora, the most sensitive target for an attention layer is almost always the projection layer in the next block.
- Static is Better than Dynamic: While dynamic rotation matrices are common in LLM quantization, CLQ proves that a static, offline-calculated Hadamard approach is sufficient for DiTs, significantly reducing inference latency.
Key Results
CLQ represents a significant leap over existing SOTA methods like SmoothQuant, QuaRot, and ViDiT-Q, especially at the ultra-low W4A4 level:
- Efficiency: Achieved a 3.98x memory saving and a 3.95x speedup in real-world deployment tests.
- Quality: While other methods (like Q-DiT or SmoothQuant) completely collapsed at W4A4—producing either black images or random static—CLQ maintained visual quality nearly identical to the full-precision (FP16) original.
- GenEval Score: On image generation, CLQ (W4A4) achieved a total score of 0.509, vastly outperforming the next best competitor, ViDiT-Q, which scored only 0.085 at the same bit-width.
Limitations and Future Work
The authors note that while W4A4 is a major milestone, there is still room to push further. Future work will focus on:
- Lower Bit-Widths: Exploring if DiTs can survive W2A2 or even binary quantization.
- Further Optimization: Refining the search space for CLPS to reduce the time required for the post-training calibration process.
- Broader Architectures: Testing CLQ on a wider variety of transformer-based generative models beyond the current DiT implementations.
Summary updated