Private-Library-Oriented Code Generation with Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs), such as Codex and GPT-4, have recently showcased their remarkable code generation abilities, facilitating a significant boost in coding efficiency. This paper will delve into utilizing LLMs for code generation in private libraries, as they are widely employed in everyday programming. Despite their remarkable capabilities, generating such private APIs poses a formidable conundrum for LLMs, as they inherently lack exposure to these private libraries during pre-training. To address this challenge, we propose a novel framework that emulates the process of programmers writing private code. This framework comprises two modules: APIFinder first retrieves potentially useful APIs from API documentation; and APICoder then leverages these retrieved APIs to generate private code. Specifically, APIFinder employs vector retrieval techniques and allows user involvement in the retrieval process. For APICoder, it can directly utilize off-the-shelf code generation models. To further cultivate explicit proficiency in invoking APIs from prompts, we continuously pre-train a reinforced version of APICoder, named CodeGenAPI. Our goal is to train the above two modules on vast public libraries, enabling generalization to private ones. Meanwhile, we create four private library benchmarks, including TorchDataEval, TorchDataComplexEval, MonkeyEval, and BeatNumEval, and meticulously handcraft test cases for each benchmark to support comprehensive evaluations. Numerous experiments on the four benchmarks consistently affirm the effectiveness of our approach. Furthermore, deeper analysis is also conducted to glean additional insights.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). First posted on arXiv 28 Jul 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 1; 2024: 3; 2025: 4; 2026: 2.
10 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 354
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 23
- 2024On Mitigating Code LLM Hallucinations with API Documentationcited by 21
- 2024The Devil is in the Neurons: Interpreting and Mitigating Social Biases in Pre-trained Language Modelscited by 6
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generationcited by 3
- 2025Evaluating LLMs on Sequential API Call Through Automated Test Generationcited by 2
- 2026Learning from Execution: Self-Evolving Memory for Private-Library Code Generationcited by 2
- 2025Benchmarking Web API Integration Code Generationcited by 0
- 2025Automated Network Protocol Testing with LLM Agentscited by 0
- 2026Learning from Execution: Self-Evolving Memory for Private-Library Code Generation27 Apr 2026
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation14 Jan 2026
- 2025Automated Network Protocol Testing with LLM Agents15 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025Benchmarking Web API Integration Code Generation24 Sep 2025
- 2025Evaluating LLMs on Sequential API Call Through Automated Test Generation13 Jul 2025
- 2024On Mitigating Code LLM Hallucinations with API Documentation13 Jul 2024
- 2024The Devil is in the Neurons: Interpreting and Mitigating Social Biases in Pre-trained Language Models14 Jun 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023