Manuscript Offprint

arXiv:2610.17868

Prefilling-dLLM v2: Learned Chunk Routing for Long-Context Diffusion Language Models

Qi Han, Jing Xiong, Ziyuan Zhang, Ngai Wong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Diffusion language models apply bidirectional attention over the whole context at every denoising step, so a longer context makes each step substantially more expensive. Sparsifying only at inference leaves the pretrained weights unchanged, so the model is never trained under the sparse pattern it runs with. We propose Prefilling-dLLM v2, which continues training a diffusion language model so that it routes with its native mask token. One mask is appended at the end of each chunk, and a learned role offset marks it as a routing slot. On every fourth layer, a query keeps a bidirectional local window and the top-K chunks scored from that mask; the other layers use a bidirectional sliding window. Starting from Dream-v0-Base-7B extended to 16K with YaRN, we compare Prefilling-dLLM v2 with bidirectional NSA, DSA, and SWA under the same layout, key budget, and dense initialization, using the same Fast-dLLM decoder. With the YaRN factor scaled to the evaluation length, Prefilling-dLLM v2 leads the other sparse methods on all three RULER tasks from 16K to 128K. Its mean accuracy at 128K is 7.4 points above NSA, the next sparse model, while DSA and SWA remain near zero. At the same length, decoding is 172×172\times faster than with full dense attention.

1 INTRODUCTION

Diffusion language models (dLLMs) generate text by iteratively unmasking tokens under bidirectional attention, rather than by left-to-right next-token prediction (Austin et al., 2021; Sahoo et al., 2024; Nie et al., 2025; Ye et al., 2025). At every denoising step, each query can attend to the whole context, so a longer context makes that step substantially more expensive.

Sparse attention in autoregressive models allocates a limited budget with a local window, a learned token-level route, or a mixture of compressed and selected blocks (Jiang et al., 2023; Yuan et al., 2025; DeepSeek-AI, 2025). These designs focus on causal attention, whereas efficient dLLM inference is studied mainly in a training-free regime. Fast-dLLM reuses keys and values across denoising steps and decodes blocks in parallel; it accelerates serving but does not sparsify attention (Wu et al., 2025b). Sparse-dLLM evicts cache entries (Song et al., 2025), SparseD builds a head-specific block-sparse mask at

Figure

Figure 1: Mean accuracy of the four sparse methods on the three RULER tasks. The YaRN factor scales with the evaluation length.

inference time (Wang et al., 2025), and Prefilling-dLLM scores prefix chunks and reuses a static top-K cache (Xiong et al., 2026). Sparsifying only at inference restricts which tokens are visible and leaves the pretrained dense attention weights unchanged, so the model runs under a sparse pattern it was never trained with. Training a dLLM under a sparse attention budget has received comparatively less study.

Our key insight is that a mask token is trained to absorb the context needed to predict an unknown token. Fixed at the end of a chunk, it can summarize that chunk and indicate which remote chunks a query should read. We therefore propose Prefilling-dLLM v2, a sparse attention method learned by continued training, which selects remote chunks with these summaries. Figure 2 contrasts the re-

Figure

Figure 2: What query q can see. Each chunk is three cells, and q sits in the middle so the local window extends both ways. Teal cells are the local window and orange cells are selected. The bar above each NSA chunk is its summary. DSA reads scattered tokens, and Prefilling-dLLM v2 marks the last cell of every chunk as a mask.

sulting visibility with bidirectional adaptations of Native Sparse Attention (NSA), DeepSeek Sparse Attention (DSA), and sliding-window attention (SWA).

Specifically, Prefilling-dLLM v2 appends the model's native mask token at the end of each chunk. A binary indicator marks that position as a routing position rather than one to be generated, and a learned role offset is added only there. Through the shared query and key projections, the offset changes how the routing mask attends, while a mask marked for generation remains a token to be predicted. The routing mask's query attends over the tokens in its chunk and pools their keys into a summary. The pooling weights are a softmax over the content keys, and a chunk score adds the entropy of those weights to the similarity between the query and the summary. Each query keeps the highest-scoring chunks. The same scores are then normalized together with the local branch, and the resulting weights assign attention mass to each selected chunk and to the bidirectional local window. Each of the other layers applies a bidirectional sliding window around the query. Routing positions are omitted from the language-model targets and from the value stream, so the summary is used to choose tokens rather than being predicted or copied into the answer.

Starting from a Dream-v0-Base-7B checkpoint extended to 16K with YaRN (Peng et al., 2023), we compare Prefilling-dLLM v2 with NSA, DSA, and SWA under the same layer layout, key budget, and dense initialization, using the same Fast-dLLM decoder at evaluation (Wu et al., 2025b). The benchmarks are LongBench-v1 (Bai et al., 2023) and three RULER tasks: single-needle retrieval, multi-key multi-query, and variable tracking (Hsieh et al., 2024). Figure 1 plots the mean accuracy on the three tasks with the YaRN factor scaled to the evaluation length: Prefilling-dLLM v2 reaches 53.8 at 16K and 47.7 at 128K. NSA, the next sparse model, scores 42.7 and 40.3, so the margins are 11.1 and 7.4 points. DSA and SWA stay below 13 points at both lengths. Single-needle accuracy is 100.0 at 16K and 95.0 at 128K, against 81.0 and 83.0 for NSA. With the YaRN factor fixed at its training value, single-needle accuracy is 100.0 at 16K and 64K, and 99.0 at 32K and 128K. Component and routing-token ablations are reported in Appendix B and are not part of this comparison. Our contributions are as follows:

• Our core contribution is Prefilling-dLLM v2, a sparse attention method for dLLMs, learned by continued training, that summarizes each chunk with a native mask token and trains the model to select remote chunks from those summaries.

• We introduce mask-summary scoring, which marks that mask as a routing position with a binary indicator and a learned role offset, pools the chunk keys into a summary, and normalizes the scores with the local branch to assign attention mass.

• On three RULER tasks, with the YaRN factor scaled to the evaluation length, Prefilling-dLLM v2 leads the other sparse methods on every task from 16K to 128K. The three-task mean is 11.1 points above NSA at 16K and 7.4 points above NSA at 128K.

References (50)