Mask Tokens as Prophet: Fine-Grained Cache Eviction for Efficient dLLM Inference

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Huang, Jianuo, Zhang, Yaojie, Yang, Yicun, Huang, Benhao, Qi, Biqing, Liu, Dongrui, Zhang, Linfeng
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918158198112256
author Huang, Jianuo
Zhang, Yaojie
Yang, Yicun
Huang, Benhao
Qi, Biqing
Liu, Dongrui
Zhang, Linfeng
author_facet Huang, Jianuo
Zhang, Yaojie
Yang, Yicun
Huang, Benhao
Qi, Biqing
Liu, Dongrui
Zhang, Linfeng
contents Diffusion large language models (dLLMs) present a promising alternative to dominant autoregressive models (ARMs) by the ability of parallel decoding at the expense of substantial computation and memory costs. Specifically, the cache mechanism for bidirectional attention in dLLMs demands large memory footprint, restricting their ability to handle long contexts under resource-limited settings. Existing cache eviction strategies are designed for ARMs and ignore the unique characteristics of dLLMs, thus leading to unsatisfactory performance. To address these challenges, we introduce MaskKV, a training-free cache eviction framework tailored to dLLMs, focusing on the effect of mask tokens in dLLMs. MaskKV is built on two key innovations: (1) a mask-query guided scoring mechanism that leverages attention weights to identify and evict less critical prompt tokens for each head; (2) an adaptive cache budgeting strategy that improves efficiency by reducing allocation in intermediate layers and concentrating resources on prompt-preferring heads. On LLaDA with MaskKV, compressing the KV cache to only 256 pairs (less than 5% of tokens) retains 94% of the full-cache performance on LongBench and achieves up to 31x acceleration at 32k prompt length. The code is publicly available at: https://github.com/jianuo-huang/MaskKV
format Preprint
id arxiv_https___arxiv_org_abs_2510_09309
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Mask Tokens as Prophet: Fine-Grained Cache Eviction for Efficient dLLM Inference
Huang, Jianuo
Zhang, Yaojie
Yang, Yicun
Huang, Benhao
Qi, Biqing
Liu, Dongrui
Zhang, Linfeng
Computation and Language
Diffusion large language models (dLLMs) present a promising alternative to dominant autoregressive models (ARMs) by the ability of parallel decoding at the expense of substantial computation and memory costs. Specifically, the cache mechanism for bidirectional attention in dLLMs demands large memory footprint, restricting their ability to handle long contexts under resource-limited settings. Existing cache eviction strategies are designed for ARMs and ignore the unique characteristics of dLLMs, thus leading to unsatisfactory performance. To address these challenges, we introduce MaskKV, a training-free cache eviction framework tailored to dLLMs, focusing on the effect of mask tokens in dLLMs. MaskKV is built on two key innovations: (1) a mask-query guided scoring mechanism that leverages attention weights to identify and evict less critical prompt tokens for each head; (2) an adaptive cache budgeting strategy that improves efficiency by reducing allocation in intermediate layers and concentrating resources on prompt-preferring heads. On LLaDA with MaskKV, compressing the KV cache to only 256 pairs (less than 5% of tokens) retains 94% of the full-cache performance on LongBench and achieves up to 31x acceleration at 32k prompt length. The code is publicly available at: https://github.com/jianuo-huang/MaskKV
title Mask Tokens as Prophet: Fine-Grained Cache Eviction for Efficient dLLM Inference
topic Computation and Language
url https://arxiv.org/abs/2510.09309