Introduction
Diffusion models have revolutionized generative AI, producing high-fidelity images that often surpass the capabilities of Generative Adversarial Networks (GANs). However, their iterative nature—requiring dozens or hundreds of sequential denoising steps—imposes a significant computational burden. Each step $t$ depends on the output of step $t+1$, preventing parallelization and leading to high latency and energy consumption. This makes deploying such models on edge devices or in real-time applications a major challenge.
Exploiting Temporal Value Similarity
The core innovation of Ditto is a hardware-software co-design that exploits "temporal value similarity." The researchers observed that because an image is only incrementally denoised at each step, the internal activations of the neural network remain remarkably consistent between consecutive iterations.
As shown in the data, the average temporal cosine similarity across models like DDPM, Stable Diffusion (SDM), and Diffusion Transformers (DiT) consistently exceeds 0.96, often reaching as high as 0.99. This suggests that the network performs nearly identical computations at each step.
The Ditto Methodology
Ditto capitalizes on this redundancy through several key mechanisms:
- Difference Processing: Instead of re-computing full matrix multiplications, Ditto computes the initial step normally and subsequently processes only the differences (deltas) between steps.
- Dynamic Precision & Zero-Skipping: The differences between steps are significantly smaller than the original activations. By applying 8-bit quantization, approximately 44.5% of these deltas become zero, allowing the hardware to skip these operations entirely. The remaining non-zero deltas are often small enough to be processed using 4-bit math.
- Execution Flow Optimization (Defo): To mitigate the memory overhead of loading previous activations, the "Defo" runtime profiles the network during the first two steps. It dynamically identifies layers where the memory cost of difference processing outweighs the compute savings and reverts them to standard processing.
- Custom Hardware Accelerator: The authors developed a specialized architecture featuring an Encoding Unit for real-time delta calculation and a Compute Unit capable of seamless mixed-precision (4-bit/8-bit) operations.
Visualizing Internal Redundancy
The high degree of similarity is not just a statistical abstraction but is clearly visible in the network's internal state.
As illustrated in the activation maps, the features extracted by the network (e.g., the conv-in and up.0.0.skip layers) change very little between adjacent time steps. By focusing only on the changes, Ditto avoids redundant work.
Key Results and Impact
Ditto achieves a 1.5x speedup over standard integer-based architectures while reducing energy consumption by 17.7%. Crucially, these gains come with negligible impact on image quality, as measured by Frechet Inception Distance (FID) and CLIP scores. An enhanced version, Ditto+, further incorporates spatial similarity (redundancy between adjacent pixels) to push energy savings to nearly 23%.
While difference processing introduces a fundamental tension between compute savings and memory access, the selective application via Defo ensures a net gain in efficiency. Future work may explore dynamic adaptation strategies to handle fluctuating similarity levels throughout the generation process.
Summary updated