arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.00612cs.CL
收藏

前瞻性验证:用于扩散大语言模型在无上下文自由文法下的可靠约束解码

Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammars

College of AI, Tsinghua University(清华大学人工智能学院);School of Computer Science, Peking University(北京大学计算机学院);School of Computer Science and Engineering, Beihang University(北航计算机科学与工程学院);School of Computer Science and Technology, Beijing Institute of Technology(北京理工大学计算机科学与技术学院);School of Computing, National University of Singapore(新加坡国立大学计算机学院)

Yitong Zhang, Yongmin Li, Yuetong Liu, Jia Li, Xiaoran Jia, Zherui Li, Ge Li

AI总结:

LAVE通过并行预测标记分布实现可靠的约束解码,提升扩散大语言模型在上下文无关文法下的生成准确性。

摘要:

扩散大语言模型(dLLMs)已展示了有前途的生成能力,并越来越多地用于生成由上下文无关文法定义的正式语言,如源代码和化学表达式。然而,作为概率模型,它们仍然难以可靠地生成语法正确的输出。解决这个问题的自然且有前途的方向是适应约束解码技术,以在生成过程中强制执行语法正确性。然而,应用这些技术面临两个主要障碍。一方面,dLLMs的非自回归性质使得大多数现有的约束解码方法不适用。另一方面,专门为dLLMs设计的现有方法可能允许中间输出无法完成为有效句子,这在实践中显著限制了它们的可靠性。为了解决这些挑战,我们提出了LAVE,一种专门为dLLMs设计的约束解码方法。我们的方法利用了dLLMs的一个关键特性,即在每次前向传递中能够并行预测所有位置的标记分布。每当模型提出一个新标记时,LAVE使用这些分布进行前瞻性分析,以高效且可靠地验证所提出的标记的有效性。这种设计通过可靠地保留中间输出扩展为有效句子的潜力,确保了可靠的约束。在四个广泛使用的dLLMs和三个代表性的基准测试中进行的广泛实验表明,LAVE在语法正确性方面始终优于现有基线,并且在运行时间开销方面几乎没有影响。

英文摘要:

Diffusion Large Language Models (dLLMs) have demonstrated promising generative capabilities and are increasingly used to produce formal languages defined by context-free grammars, such as source code and chemical expressions. However, as probabilistic models, they still struggle to generate syntactically valid outputs reliably. A natural and promising direction to address this issue is to adapt constrained decoding techniques to enforce grammatical correctness during generation. However, applying these techniques faces two primary obstacles. On the one hand, the non-autoregressive nature of dLLMs renders most existing constrained decoding approaches inapplicable. On the other hand, current approaches specifically designed for dLLMs may allow intermediate outputs that are impossible to complete into valid sentences, which significantly limits their reliability in practice. To address these challenges, we present LAVE, a constrained decoding approach specifically designed for dLLMs. Our approach leverages a key property of dLLMs, namely their ability to predict token distributions for all positions in parallel during each forward pass. Whenever a new token is proposed by model, LAVE performs lookahead using these distributions to efficiently and reliably verify the validity of the proposed token. This design ensures reliable constraints by reliably preserving the potential for intermediate outputs to be extended into valid sentences. Extensive experiments across four widely used dLLMs and three representative benchmarks demonstrate that LAVE consistently outperforms existing baselines and achieves substantial improvements in syntactic correctness, while incurring negligible runtime overhead.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑