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

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

计算机科学 > 计算与语言

arXiv:2407.06146 (cs)
[提交于 2024年7月10日]

标题:Using Grammar Masking to Ensure Syntactic Validity in LLM-based Modeling Tasks

作者:Lukas Netz, Jan Reimer, Bernhard Rumpe
查看论文《Using Grammar Masking to Ensure Syntactic Validity in LLM-based Modeling Tasks》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:We present and evaluate a method called grammar masking, which is used to guide large language models (LLMs) toward producing syntactically correct models for a given context-free grammar. Prompt engineering methods such as few-shot learning or priming can be used to improve the chances of an LLM producing correct syntax, but the more complex the grammar, the more time-consuming and less promising these methods become. Previous work is focused primarily on the usage of either language model training or prompt engineering. In this work, a method is presented that restricts the output to a given grammar using constrained decoding to ensure the output adheres to a valid syntax. We use several DSLs built with MontiCore and task multiple LLMs to produce models with and without constrained decoding. A corresponding parser is used to confirm the syntactic correctness of each model. We show that grammar masking can dramatically improve the modeling capabilities of several LLMs, reducing the need for well-refined prompting while increasing the chance of producing correct models.
评论: Preprint to be published in the MODELS Workshop "MDE Intelligence"
主题: 计算与语言 (cs.CL); 人工智能 (cs.AI); 软件工程 (cs.SE)
引用方式: arXiv:2407.06146 [cs.CL]
  (或者 arXiv:2407.06146v1 [cs.CL] 对于此版本)
  https://doi.org/10.48550/arXiv.2407.06146

提交历史

来自:Lukas Netz
[v1] 2024年7月10日 星期三 00:00:00 UTC
全文链接:

访问论文:

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

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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