paper-with-me

홈 › Papers

Statically Contextualizing Large Language Models with Typed Holes

2024-09-02 · Andrew Blinn, Xiang Li, June Hyung Kim, Cyrus Omar

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.

📄 PDF Abstract BibTeX arXiv:2409.00921

Code (0)

등록된 구현이 없습니다.

Tasks

Code CompletionCode GenerationProgram Synthesis

Similar Papers 제목 키워드 기반

Monadic Deep Learning

2023-07-23 · Bo Yang, Zhihao Zhang Kirisame Marisa, Kai Shi

The Java and Scala community has built a very successful big data ecosystem. However, most of neural networks running on it are modeled in dynamically typed programming languages. These dynamically typed deep learning fr…

Deep LearningDynamic neural networks

Learning Python Code Suggestion with a Sparse Pointer Network

2016-11-24 · Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, Sebastian Riedel

To enhance developer productivity, all modern integrated development environments (IDEs) include code suggestion functionality that proposes likely next tokens at the cursor. While current IDEs work well for statically-t…

Language ModelingLanguage Modelling

Probabilistic energy profiler for statically typed JVM-based programming languages

2025-12-02 · Joel Nyholm, Wojciech Mostowski, Christoph Reichenbach arxiv

Energy consumption is a growing concern in several fields, from mobile devices to large data centers. Developers need detailed data on the energy consumption of their software to mitigate consumption issues. Previous app…

InfCode-C++: Intent-Guided Semantic Retrieval and AST-Structured Search for C++ Issue Resolution

2025-11-20 · Qingao Dong, Mengfei Wang, Hengzhi Zhang, Zhichao Li 외 arxiv

Large language model (LLM) agents have recently shown strong performance on repository-level issue resolution, but existing systems are almost exclusively designed for Python and rely heavily on lexical retrieval and sha…

Semantic Retrieval

Turn: A Language for Agentic Computation

2026-03-07 · Muyukani Kizito arxiv

We present \textbf{Turn}, a compiled, actor-based programming language -- statically typed for schema inference, dynamically typed at the value level -- for agentic software: programs that reason and act autonomously by …