cs.CLMar 18, 2026

Attention-Based Sampler for Diffusion Language Models

Authors: Yuyan Zhou, Kai Syun Hou, Weiyu Chen, James Kwok

Organizations: Department of Computer Science and Engineering, The Hong Kong University of Science and Technology

Abstract

Auto-regressive models (ARMs) have established a dominant paradigm in language modeling. However, their strictly sequential sampling paradigm imposes fundamental constraints on both inference efficiency and modeling flexibility. To address these limitations, diffusion-based large language models (dLLMs) have been proposed, offering the potential for parallel sampling and flexible language modeling. Despite these advantages, current dLLMs sampling strategies rely primarily on token level information, which fails to account for global sequence structure and often yields suboptimal results. In this paper, we study the sampling order selection problem from the perspective of log-likelihood maximization. We show that this problem is NP-hard and propose an optimal sampling-rank-based approximation that makes the objective computationally tractable. We further prove that the tractable objective is optimized by sampling tokens in descending order of their attention-matrix column sums. This finding provides a principled justification for attention-guided sampling and offers a theoretically grounded alternative to greedy search. We instantiate this theoretical insight in a new training-free sampling algorithm, termed Attn-Sampler, and further propose dynamic attention thresholding for practical acceleration. Extensive experiments across multiple benchmarks validate the effectiveness of our proposed method, demonstrating that it achieves superior generation quality while enhancing the sampling parallelism.

Figures & tables

Explore similar work

CardsList
  1. NI Sampling: Accelerating Discrete Diffusion Sampling by Token Order Optimization

    Apr 20, 2026Enshu Liu, Xuefei Ning, Yu Wang +1Few-Step Diffusion SamplingDiffusion Language Model Decoding

  2. Fork-dLLM: Avoiding the Flexibility Trap in Diffusion Language Models

    Sep 30, 2026Stipe Frković, Metod Jazbec, Christian A. NaessethMasked Diffusion ModelsSpeculative Decoding for Diffusion Language Models

  3. Rethinking the Generation Order of Block Diffusion Language Models

    Jul 27, 2026Kai Syun Hou, James KwokDiffusion Model SamplingBlockwise Diffusion Language Models