Abstract
Large-scale Diffusion Transformers (DiTs) have established state-of-the-art performance in high-fidelity image and video generation. However, their massive parameter counts pose significant challenges for deployment on resource-constrained hardware. This paper introduces TerDiT, a quantization-aware training (QAT) framework that compresses DiTs to ternary weights (approximately 1.58 bits). By identifying and addressing training instabilities caused by adaptive Layer Normalization (adaLN) modules, TerDiT achieves a 10x reduction in model size and an 8x reduction in memory usage. Our 4.2B parameter ternary model maintains competitive image quality, achieving an FID of 2.42 on ImageNet 256x256 while requiring less than 2GB of VRAM for inference.
Introduction
The rapid scaling of generative models has led to a "deployment dilemma": while larger models offer superior quality, their memory requirements (often exceeding 17GB for a 4B parameter model) exclude them from consumer-grade hardware. While 8-bit or 4-bit quantization is common, pushing precision to 1 or 2 bits typically results in catastrophic performance collapse. TerDiT overcomes these barriers, providing the first successful implementation of ternary weights for large-scale Diffusion Transformers.
Methodology: The RMS-adaLN Fix
TerDiT utilizes a Quantization-Aware Training (QAT) approach, training models from scratch using an absmean quantization function. Weights are normalized and rounded to $\{-1, 0, 1\}$, then scaled by a learnable parameter $\alpha$.
The core technical challenge identified in this work is the instability of the adaptive Layer Normalization (adaLN) modules used for conditioning. Naive ternarization in these modules leads to massive activation spikes that prevent convergence. To stabilize training, TerDiT introduces an RMS Norm layer within the adaLN module, following the MLP. This modification constrains the activation range, allowing the ternary model to converge smoothly.
Experimental Results
Models were evaluated on the ImageNet benchmark at 256x256 and 512x512 resolutions. The results demonstrate that TerDiT significantly outperforms existing low-bit baselines like BitNet b1.58 and EfficientDM.
Efficiency and Quality
- Compression: The TerDiT-4.2B model checkpoint is reduced from 16GB (FP32) to just 1.1GB.
- Memory Footprint: Inference VRAM usage drops from 17GB to approximately 2GB, enabling high-end generation on entry-level GPUs.
- Generative Performance: TerDiT-4.2B achieved an FID score of 2.42, remarkably close to the 2.10 score of the full-precision baseline.
Key Insights
- Resilience through Scale: Larger models exhibit greater resilience to quantization. The performance gap between ternary and full-precision versions narrows as the total parameter count increases.
- Conditioning Stability: The primary bottleneck for low-bit DiTs is not the transformer blocks themselves, but the injection of conditioning information. Proper normalization in the conditioning path is essential for photorealistic synthesis.
- Precision Redundancy: The success of TerDiT suggests that the structural information required for high-resolution diffusion is effectively captured even at 1.58-bit precision.
Conclusion and Future Work
TerDiT proves that giant diffusion models can be compressed to ternary weights without sacrificing significant image quality. While current inference speeds are limited by the lack of native ternary hardware support, the massive memory savings represent a major step toward local deployment of state-of-the-art generative AI. Future research will focus on hardware-software co-design to unlock the full latency potential of ternary matrix multiplication.
Summary updated