跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 机器学习

arXiv:2508.10111 (cs)
[提交于 2025年8月13日]

标题:Constrained Decoding of Diffusion LLMs with Context-Free Grammars

作者:Niels Mündler, Jasper Dekoninck, Martin Vechev
查看论文《Constrained Decoding of Diffusion LLMs with Context-Free Grammars》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Large language models (LLMs) have shown promising performance across diverse domains. Many practical applications of LLMs, such as code completion and structured data extraction, require adherence to syntactic constraints specified by a formal language. Yet, due to their probabilistic nature, LLM output is not guaranteed to adhere to such formal languages. Prior work has proposed constrained decoding as a means to restrict LLM generation to particular formal languages. However, existing works are not applicable to the emerging paradigm of diffusion LLMs, when used in practical scenarios such as the generation of formally correct C++ or JSON output. In this paper we address this challenge and present the first constrained decoding method for diffusion models, one that can handle formal languages captured by context-free grammars. We begin by reducing constrained decoding to the more general additive infilling problem, which asks whether a partial output can be completed to a valid word in the target language. This problem also naturally subsumes the previously unaddressed multi-region infilling constrained decoding. We then reduce this problem to the task of deciding whether the intersection of the target language and a regular language is empty and present an efficient algorithm to solve it for context-free languages. Empirical results on various applications, such as C++ code infilling and structured data extraction in JSON, demonstrate that our method achieves near-perfect syntactic correctness while consistently preserving or improving functional correctness. Importantly, our efficiency optimizations ensure that the computational overhead remains practical.
主题: 机器学习 (cs.LG); 形式语言与自动机理论 (cs.FL); 程序设计语言 (cs.PL); 软件工程 (cs.SE)
引用方式: arXiv:2508.10111 [cs.LG]
  (或者 arXiv:2508.10111v1 [cs.LG] 对于此版本)
  https://doi.org/10.48550/arXiv.2508.10111

提交历史

来自:Niels Mündler
[v1] 2025年8月13日 星期三 18:09:09 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.LG
< 上一篇   |   下一篇 >
最新 | 近期 | 2025-08
切换浏览方式为:
cs
cs.FL
cs.PL
cs.SE

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站