From Context to Intent: Reasoning-Guided Function-Level Code Completion
Yanzhou Li, Tianlin Li, Yiran Zhang, Shangqing Liu, Aishan Liu, Xianglong Liu, and Yang Liu

TL;DR
This paper introduces a reasoning-guided prompting framework for function-level code completion that leverages code context to infer developer intent, significantly improving accuracy in scenarios lacking explicit instructions.
Contribution
It proposes a novel reasoning-based prompting method and curates a large dataset to enhance LLMs' ability to infer intent from implicit code context, advancing code completion techniques.
Findings
Over 25% relative improvement in pass@1 for key models
Effective use of reasoning prompts to utilize code context
Interactive platform with human feedback further boosts performance
Abstract
The growing capabilities of Large Language Models (LLMs) have led to their widespread adoption for function completion within code repositories. Recent studies on such tasks show promising results when explicit instructions, often in the form of docstrings, are available to guide the completion. However, in real-world scenarios, clear docstrings are frequently absent. Under such conditions, LLMs typically fail to produce accurate completions. To enable more automated and accurate function completion in such settings, we aim to enable LLMs to accurately infer the developer's intent prior to code completion. Our key insight is that the preceding code, namely the code context before the function to be completed, often contains valuable cues that help the model understand the intended functionality. However, inferring intent from such implicit context is non-trivial and constitutes a core…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Scientific Computing and Data Management · Advanced Malware Detection Techniques
