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

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

计算机科学 > 程序设计语言

arXiv:2402.17988 (cs)
[提交于 2024年2月28日]

标题:Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammars

作者:Daniel Melcer, Nathan Fulton, Sanjay Krishna Gouda, Haifeng Qian
查看论文《Constrained Decoding for Fill-in-the-Middle Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive Grammars》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Large Language Models are powerful tools for program synthesis and advanced auto-completion, but come with no guarantee that their output code is syntactically correct. This paper contributes an incremental parser that allows early rejection of syntactically incorrect code, as well as efficient detection of complete programs for fill-in-the-middle (FIM) tasks. We extend the Earley parsing algorithm to allow for left and right quotients of context-free grammars, and develop methods to handle quotienting of several context-sensitive features present in the grammars of many common programming languages. The result of these contributions is an efficient, general, and well-grounded method for left and right quotient parsing. To validate our theoretical contributions -- and the effectiveness of certain design decisions -- we evaluate our method on the particularly difficult case of FIM completion for Python 3, with syntax-correctness constraints. Our results demonstrate that constrained generation can significantly reduce the incidence of syntax errors in recommended code.
评论: 10 pages, Code available at https://github.com/amazon-science/incremental-parsing
主题: 程序设计语言 (cs.PL); 机器学习 (cs.LG); 软件工程 (cs.SE)
引用方式: arXiv:2402.17988 [cs.PL]
  (或者 arXiv:2402.17988v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2402.17988

提交历史

来自:Daniel Melcer
[v1] 2024年2月28日 星期三 02:12:47 UTC
全文链接:

访问论文:

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

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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