Diffusion Models (DMs) have revolutionized generative AI, yet their massive computational requirements remain a significant barrier to widespread deployment. While Post-Training Quantization (PTQ) is a standard technique for model compression, it often results in severe quality degradation in diffusion tasks. This degradation occurs because quantization errors are not isolated; they accumulate and amplify across hundreds of iterative denoising steps.
Researchers at ByteDance have addressed this bottleneck by introducing TCEC (Timestep-aware Cumulative Error Compensation). This framework provides a theoretical foundation for understanding error propagation and a practical algorithm to cancel these errors in real-time with negligible overhead.
The Challenge: Cumulative Error Propagation
In diffusion models, images are generated by iteratively refining pure noise. When a model is quantized (e.g., from 16-bit to 4-bit), a small error introduced at one timestep changes the input for the next. This "step-wise" error snowballs into a "cumulative" error, leading to structural collapse, blurry textures, or color shifts in the final output. Unlike prior work that focused on improving the accuracy of individual steps, TCEC manages the accumulation across the entire generation trajectory.
Methods: The TCEC Framework
The authors' approach rests on two critical mathematical insights that enable real-time correction:
- Jacobian Negligibility: The model is relatively insensitive to tiny local changes, allowing the researchers to simplify complex mathematical derivations without sacrificing accuracy.
- Temporal Locality (The "Two-Step" Rule): They proved that the cumulative error at any given step is primarily influenced by the errors of the immediately preceding two steps. This discovery eliminates the need to track the entire generation history, making compensation computationally efficient.
Implementation
The TCEC algorithm observes that quantization error is highly correlated with the model's output, particularly in high-frequency areas like edges. During a brief offline calibration phase using 1,024 random prompts from the COCO dataset, the system pre-calculates a channel-wise scaling matrix ($K_t$). During inference, the model uses this matrix to estimate and subtract the predicted error from the output at each timestep. Because this involves simple channel-wise multiplication, the added latency is less than 0.5%.
Key Results and Performance
TCEC demonstrates significant improvements across various models, including SDXL, SDXL-Turbo, and PixArt-Σ. On the SDXL (W4A4) benchmark, TCEC improved the PSNR from 20.7 to 21.9.
Beyond static images, TCEC also excels in video generation. In tests with OpenSora (W4A8), it outperformed previous state-of-the-art methods like ViDiT-Q across multiple VBench metrics, specifically in imaging quality and subject consistency.
Conclusion
By providing the first closed-form mathematical solution for cumulative error in diffusion, TCEC enables high-quality generation at low bit-widths. The method allows a 12B parameter model to achieve a 3.5x reduction in memory footprint compared to FP16, making it possible to run state-of-the-art generative models on consumer-grade hardware like laptop GPUs without sacrificing visual integrity.
Summary updated