A Chain of AI-based Solutions for Resolving FQNs and Fixing Syntax Errors in Partial Code
Not on the map. Why?
Abstract (arXiv)
API documentation, technical blogs and programming Q&A sites contain numerous partial code that can be reused in programming tasks, but often these code are uncompilable due to unresolved names and syntax errors. To facilitate partial code reuse, we propose the Partial Code Reuse Chain (PCR-Chain) for resolving fully-qualified names (FQNs) and fixing last-mile syntax errors in partial code based on a giant large language model (LLM) like ChatGPT. Methodologically, PCR-Chain is backed up by the underlying global-level prompt architecture (which combines three design ideas: hierarchical task breakdown, prompt composition, and a mix of prompt-based AI and non-AI units) and the local-level prompt design. Technically, we propose PCR-Chain, which employs in-context learning rather than symbolic, costly training methods. Experimental results demonstrate that in dynamically-typed languages (Python), PCR-Chain outperforms current state-of-the-art (SOTA) 5% accuracy like RING. For statically-type languages (Java), our approach achieves high accuracy of 80.5% in resolving both non-FQNs and last-mile syntax errors, surpassing SOTA methods (RING) that can only address last-mile syntax errors. The correct execution of the unit, module, and PCR-Chain demonstrates the effectiveness of the prompt design, composition, and architecture and opens up possibilities for building software engineering tools based on LLMs, replacing traditional program analysis methods.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 21 Jun 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 2; 2024: 2.
4 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repaircited by 50
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 24
- 2024Are Human Rules Necessary? Generating Reusable APIs with CoT Reasoning and In-Context Learningcited by 2
- 2024Are Human Rules Necessary? Generating Reusable APIs with CoT Reasoning and In-Context Learning6 May 2024
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Models29 Apr 2024
- 2023RepairLLaMA: Efficient Representations and Fine-Tuned Adapters for Program Repair25 Dec 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023