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

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

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

arXiv:2409.00921 (cs)
[提交于 2024年10月14日]

标题:Statically Contextualizing Large Language Models with Typed Holes

作者:Andrew Blinn, Xiang Li, June Hyung Kim, Cyrus Omar
查看论文《Statically Contextualizing Large Language Models with Typed Holes》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Large language models (LLMs) have reshaped the landscape of program synthesis. However, contemporary LLM-based code completion systems often hallucinate broken code because they lack appropriate context, particularly when working with definitions not in the training data nor near the cursor. This paper demonstrates that tight integration with the type and binding structure of a language, as exposed by its language server, can address this contextualization problem in a token-efficient manner. In short, we contend that AIs need IDEs, too! In particular, we integrate LLM code generation into the Hazel live program sketching environment. The Hazel Language Server identifies the type and typing context of the hole being filled, even in the presence of errors, ensuring that a meaningful program sketch is always available. This allows prompting with codebase-wide contextual information not lexically local to the cursor, nor necessarily in the same file, but that is likely to be semantically local to the developer's goal. Completions synthesized by the LLM are then iteratively refined via further dialog with the language server. To evaluate these techniques, we introduce MVUBench, a dataset of model-view-update (MVU) web applications. These applications serve as challenge problems due to their reliance on application-specific data structures. We find that contextualization with type definitions is particularly impactful. After introducing our ideas in the context of Hazel we duplicate our techniques and port MVUBench to TypeScript in order to validate the applicability of these methods to higher-resource languages. Finally, we outline ChatLSP, a conservative extension to the Language Server Protocol (LSP) that language servers can implement to expose capabilities that AI code completion systems of various designs can use to incorporate static context when generating prompts for an LLM.
评论: To appear at OOPSLA2024
主题: 程序设计语言 (cs.PL); 人工智能 (cs.AI); 软件工程 (cs.SE)
引用方式: arXiv:2409.00921 [cs.PL]
  (或者 arXiv:2409.00921v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2409.00921
期刊参考: Proceedings of the ACM on Programming Languages, Volume 8, 2024; Issue OOPSLA2 Article No.: 288, Pages 468 - 498
相关 DOI: https://doi.org/10.1145/3689728

提交历史

来自:Andrew Blinn
[v1] 2024年10月14日 星期一 00:00:00 UTC
全文链接:

访问论文:

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

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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