LaCache: Exact Caching and Precision-Adaptive Inference for Diffusion Large Language Models
SourceFull paper
Article overview
Verdict
LaCache is a practical training-free framework for accelerating semi-autoregressive denoising in DLLMs. Caching alone provides a small gain, while most of the benefit comes from combining fine-grained FP8 with existing accelerators. Acceleration generally preserves comparable accuracy, but depends on sequence length and FP8-capable hardware.
Main idea
Exploit token invariance within a denoising block: reuse cached token-wise, positional, and attention states for unchanged tokens, compute only the active block, and accelerate FFNs with grouped FP8 and fused operations.
Mechanism
State variables: token embeddings, first-layer RoPE/pre-attention outputs, and for attention the row maximum, normalizer, output accumulator, cached output, and logsumexp; cached blocks are written to HBM. Operation order: (1) identify the active/changing block and Q/K overlap indicators; (2) compute token-wise operators only for changing tokens and reuse EmbedCache and RoPECache elsewhere; (3) for FlashAttention, reuse row states and skip tiles wholly outside the active block; (4) update attention accumulators, normalized outputs, and cache blocks in HBM; (5) apply per-group FP8 with step-adaptive activation scales in the FFN using fused Tensor Core operations, AddNorm, and SwiGLU; (6) restrict sampling and extra computation to the active block. Exact caching is mainly available in the first layer; broader layer coverage and longer update intervals increase speed but worsen accuracy. Reproduction requires a DLLM with semi-autoregressive denoising, cache and tiled-FlashAttention implementations, native FP8 kernels/hardware, and comparisons of Vanilla, caching-only, FP8, and combinations with parallel decoding/DPad on GSM8K, MATH, HumanEval, and MBPP. Loss functions, training targets, and training-data construction are absent because the method is training-free.
What this is useful for
The method is most useful for DLLM inference with repeated unchanged tokens, long prompts or generation sequences, batch inference, and GPUs with native FP8 support. It composes with parallel decoding, DPad, and Fast-DLLM-V2 and was evaluated on GSM8K, MATH, HumanEval, and MBPP with LLaDA-base and LLaDA-1.5.
Risks / not proven
Caching alone provides only about 3% speedup, so much of the result depends on FP8 and compatible hardware kernels. Exact caching is mainly limited to the first layer; more aggressive caching creates a speed–accuracy trade-off. Short sequences yield smaller gains. The supplied records do not provide a full account of memory cost, hardware coverage, or exhaustive accuracy results for every configuration.
Full abstract
Diffusion-based Large Language Models(DLLMs) enable parallel generation via Semi-Autoregressive (SAR) decoding in text generation. However, current methods suffer from severe operator-level redundancy: they recompute the entire sequence during denoising steps, ignoring that the prefix and masked suffix remain invariant within a block. We propose LaCache, a training-free acceleration framework that alleviates this redundancy through lossless caching and mixed precision. Specifically, LaCache employs Lossless State Memoization (LSM) by caching three types of intermediate results: (i) EmbedCache for embedding outputs, (ii) RoPECache for token-wise pre-attention states, and (iii) FACache for the online softmax statistics within FlashAttention. These caches allow the model to skip redundant computation on unchanged tokens without altering the output. To further alleviate memory-bandwidth bottlenecks, LaCache inegrates a per-group FP8 quantization strategy for FFN layers, tailored to step-dependent activation distributions across the diffusion process. Experiments demonstrate that LaCache alone achieves approximately 1.3X end-to-end speedup over vanilla DLLM. When combined with existing acceleration methods, LaCache reaches up to 40.2X end-to-end speedup while maintaining comparable task accuracy.