Current browse context:
cs.LG
Change to browse by:
References & Citations
Computer Science > Machine Learning
Title: Repository-Level Prompt Generation for Large Language Models of Code
(Submitted on 26 Jun 2022 (this version), latest version 5 Jun 2023 (v3))
Abstract: With the success of large language models (LLMs) of code and their use as code assistants (e.g. Codex used in GitHub Copilot), techniques for introducing domain-specific knowledge in the prompt design process become important. In this work, we propose a framework called Repo-Level Prompt Generator that learns to generate example-specific prompts using a set of rules. These rules take context from the entire repository, thereby incorporating both the structure of the repository and the context from other relevant files (e.g. imports, parent class files). Our technique doesn't require any access to the weights of the LLM, making it applicable in cases where we only have black-box access to the LLM. We conduct experiments on the task of single-line code-autocompletion using code repositories taken from Google Code archives. We demonstrate that an oracle constructed from our proposed rules gives up to 36% relative improvement over Codex, showing the quality of the rules. Further, we show that when we train a model to select the best rule, we can achieve significant performance gains over Codex. The code for our work can be found at: this https URL
Submission history
From: Disha Shrivastava [view email][v1] Sun, 26 Jun 2022 10:51:25 GMT (882kb,D)
[v2] Sat, 8 Oct 2022 19:26:06 GMT (650kb,D)
[v3] Mon, 5 Jun 2023 18:43:50 GMT (667kb,D)
Link back to: arXiv, form interface, contact.