NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

d$^2$Cache: Accelerating Diffusion-Based LLMs via Dual Adaptive Caching

Yuchu Jiang, Yue Cai, Xiangzhong Luo, Jiale Fu, Jiarui Wang, Chonghan Liu, Xu Yang

TL;DR

Diffusion-based Large Language Models (dLLMs) offer a promising alternative to standard autoregressive models, but their bidirectional attention makes traditional KV caching impossible, leading to sluggish inference. d²Cache introduces a training-free, two-stage adaptive caching strategy that updates only the most "critical" tokens at each step, achieving an average 3.5x speedup (and up to 48x in parallel settings) while actually improving generation quality.

The Bidirectional Bottleneck in dLLMs

Standard Large Language Models (like GPT-4 or LLaMA) are autoregressive (ARMs): they generate text one token at a time, from left to right. Because each new token only looks at the "past," we can use a Key-Value (KV) cache to store previous computations and save massive amounts of time.

Recently, diffusion-based LLMs (dLLMs) have emerged. Instead of going left-to-right, they start with a sequence of "mask" tokens and iteratively refine them into text. This allows for bidirectional attention, where every token can look at every other token. While this helps dLLMs capture global context better and avoid certain reasoning traps, it creates a massive efficiency nightmare: every time a single token changes, the context for every other token changes. This forces the model to recompute the entire sequence's KV states at every single step, making dLLMs significantly slower than their autoregressive cousins.

Comparison of causal attention, bidirectional attention, and the d²Cache token selection strategy.

Introducing d²Cache

To solve this, the authors propose d²Cache (Dual aDaptive Cache), a framework that identifies which tokens actually need an update and which can safely reuse their old KV states. It works in two stages:

  1. Stage 1: Certainty Prior-Guided Selection (for Masked Tokens): The authors discovered that masked tokens go through three phases: a gradual change, a "rapid-change" phase just before they are decoded into real words, and a stable phase afterward. d²Cache uses a "certainty prior"—a measure of how many "known" tokens are nearby—to predict which masked tokens are entering that critical rapid-change phase and updates only those.
  2. Stage 2: Attention-Aware Selection (for Prompt/Decoded Tokens): For tokens that are already "known," the model uses attention rollout. This algorithm identifies a small subset of "salient" tokens that the model is actually paying attention to. Only these high-influence tokens get their KV states updated; the rest are pulled from the cache.

Crucially, this is training-free. You can drop d²Cache into an existing dLLM without any fine-tuning.

Key Insights and Discoveries

PCA visualization of KV state evolution and the distribution of decoded tokens based on sequence distance.
  • The Three-Phase Evolution: One of the most interesting findings is the visualization of KV states using PCA (Principal Component Analysis). Masked tokens don't change uniformly; they have a distinct "U-turn" trajectory where most of the meaningful representational shift happens right before the token is finalized.
  • The "Chicken-and-Egg" Decoding Problem: To know which token to update, you need to know which one will be decoded next. The authors found a "localized" pattern: dLLMs tend to decode tokens near existing, known tokens (as seen in the sequence distance plot where 90% of tokens are decoded close to existing ones). By measuring local density, they can predict the decoding order effectively.
  • Less is More: Counterintuitively, the authors found that updating fewer tokens sometimes leads to better results. By focusing computation only on critical tokens, d²Cache mitigates "premature overconfidence"—a common dLLM failure where the model gets too "sure" of tokens at the end of a sequence before the beginning is even settled.
  • Uneven Attention: Much like in ARMs, attention in dLLMs is highly sparse. Queries consistently attend to a tiny subset of key positions, meaning the vast majority of KV recomputation in vanilla dLLMs is essentially wasted effort.

Performance and Results

The researchers evaluated d²Cache using two representative dLLMs: LLaDA-8B and Dream-7B across six diverse benchmarks (GSM8K, MBPP, HumanEval, Math-500, GPQA, and MMLU-Pro).

  • Speedups: d²Cache achieved an average 3.5x speedup in throughput across all benchmarks compared to vanilla dLLMs. In semi-autoregressive parallel decoding settings, the speedup reached a staggering 48.3x.
  • Quality Gains: Unlike many "approximate" methods that trade accuracy for speed, d²Cache often increased the task scores. For example, on the Dream-Inst model using the MBPP benchmark, the score rose from 52.0 to 58.0 while running 4.6x faster.
  • Efficiency: It consistently outperformed other recent dLLM acceleration methods in both speed and accuracy.

Limitations and Future Work

  • Scaling: The current study focused on 7B and 8B parameter models. As dLLMs scale to 70B+ parameters, the bidirectional attention bottleneck will become even more severe, and more efficient approximations of the "attention rollout" might be needed.
  • Rollout Depth: Currently, computing the attention rollout across all layers adds some overhead. The authors experimented with using only the first five layers to compute this, which worked well for coding but slightly degraded math performance.
  • Scoring Functions: The "certainty prior" currently uses a Gaussian function to weight nearby tokens. More context-adaptive or learned scoring functions could further refine which tokens are selected for updates.

Summary updated

BibTeX
@inproceedings{jiang2026d,
  author = {Yuchu Jiang and Yue Cai and Xiangzhong Luo and Jiale Fu and Jiarui Wang and Chonghan Liu and Xu Yang},
  title = {{d$^2$Cache: Accelerating Diffusion-Based LLMs via Dual Adaptive Caching}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=SjInfpK5RM},
}
Figure