在掩码扩散语言模型解码中停止收敛令牌的计算
Stopping Computation for Converged Tokens in Masked Diffusion-LM Decoding
AI总结:
本文提出SureLock方法,通过锁定稳定位置以减少计算开销,提升解码效率,实验证明在LLaDA-8B上节省30-50%的FLOPs同时保持生成质量。
摘要:
Masked Diffusion Language Models通过迭代采样生成序列,逐步解掩码令牌。然而,它们仍为每个令牌位置重新计算注意力和前馈块,即使许多解掩码令牌已固定,导致计算浪费。我们提出SureLock:当后验在位置稳定(我们的确定条件)时锁定该位置,之后跳过其查询投影和前馈子层,同时缓存其注意力键和值,使其他位置能继续关注它。这将主导每次迭代的计算成本从O(N²d)降低到O(MNd),其中N是序列长度,M是未锁定令牌位置数,d是模型维度。在实践中,M随着迭代进展而减少,带来显著节省。在LLaDA-8B上,SureLock相对于无锁定的相同采样器减少了30-50%的算法FLOPs,同时保持可比的生成质量。我们还提供理论分析以证明SureLock设计的合理性:仅监控锁定步骤的局部KL足以界定点概率的偏差。我们的项目页面可在https://daioba.github.io/surelock访问。
英文摘要:
Masked Diffusion Language Models generate sequences via iterative sampling that progressively unmasks tokens. However, they still recompute the attention and feed-forward blocks for every token position at every step -- even when many unmasked tokens are essentially fixed, resulting in substantial waste in compute. We propose SureLock: when the posterior at an unmasked position has stabilized across steps (our sure condition), we lock that position -- thereafter skipping its query projection and feed-forward sublayers -- while caching its attention keys and values so other positions can continue to attend to it. This reduces the dominant per-iteration computational cost from $O(N^2d)$ to $O(MNd)$ where $N$ is the sequence length, $M$ is the number of unlocked token positions, and $d$ is the model dimension. In practice, $M$ decreases as the iteration progresses, yielding substantial savings. On LLaDA-8B, SureLock reduces algorithmic FLOPs by 30--50% relative to the same sampler without locking, while maintaining comparable generation quality. We also provide a theoretical analysis to justify the design rationale of SureLock: monitoring only the local KL at the lock step suffices to bound the deviation in final token probabilities. Our project page is available at https://daioba.github.io/surelock .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。