Prompt-based Code Completion via Multi-Retrieval Augmented Generation
Hanzhuo Tan, Qi Luo, Ling Jiang, Zizheng Zhan, Jing Li, Haotian Zhang,, Yuqun Zhang

TL;DR
ProCC introduces a multi-retrieval, prompt-based framework with adaptive selection to improve code completion accuracy, addressing semantic diversity and coherence issues in large language models.
Contribution
It proposes a novel multi-retrieval prompt engineering approach combined with adaptive selection for enhanced code completion performance.
Findings
Outperforms state-of-the-art methods by 8.6% and 10.1% in Exact Match on benchmark datasets.
Enables effective augmentation of fine-tuned models with a 5.6% improvement.
Demonstrates robustness across open-source and private-domain code datasets.
Abstract
Automated code completion, aiming at generating subsequent tokens from unfinished code, has been significantly benefited from recent progress in pre-trained Large Language Models (LLMs). However, these models often suffer from coherence issues and hallucinations when dealing with complex code logic or extrapolating beyond their training data. Existing Retrieval Augmented Generation (RAG) techniques partially address these issues by retrieving relevant code with a separate encoding model where the retrieved snippet serves as contextual reference for code completion. However, their retrieval scope is subject to a singular perspective defined by the encoding model, which largely overlooks the complexity and diversity inherent in code semantics. To address this limitation, we propose ProCC, a code completion framework leveraging prompt engineering and the contextual multi-armed bandits…
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
TopicsNatural Language Processing Techniques · Software Engineering Research · Software Testing and Debugging Techniques
