基于注意力的扩散语言模型采样器
Attention-Based Sampler for Diffusion Language Models
AI总结:
针对扩散语言模型采样中忽略全局序列结构的问题,提出基于注意力矩阵列和的采样顺序优化方法,实现无训练的高质量并行采样。
摘要:
自回归模型(ARMs)已在语言建模中建立了主导范式。然而,其严格的顺序采样范式对推理效率和建模灵活性施加了根本性限制。为解决这些限制,提出了基于扩散的大语言模型(dLLMs),提供了并行采样和灵活语言建模的潜力。尽管有这些优势,当前dLLMs的采样策略主要依赖于token级别的信息,未能考虑全局序列结构,往往产生次优结果。在本文中,我们从对数似然最大化的角度研究采样顺序选择问题。我们证明该问题是NP难的,并提出一种基于最优采样秩的近似方法,使目标在计算上可行。我们进一步证明,通过按注意力矩阵列和降序采样token可以优化该可行目标。这一发现为注意力引导采样提供了原则性依据,并提供了贪婪搜索的理论基础替代方案。我们将这一理论见解实例化为一种新的无训练采样算法,称为Attn-Sampler,并进一步提出动态注意力阈值以实现实际加速。在多个基准上的大量实验验证了我们方法的有效性,表明它在增强采样并行性的同时实现了更优的生成质量。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。