Library-Oriented Code Generation Method Combining Execution-Feedback Re-Retrieval and Repair Mechanisms
Yukun Dong, Mingcheng Chen, Shanchen Pang
Key points
From the paper's conclusion- To address this problem, we propose EFRRCoder, a library-oriented code generation method that combines execution-feedback-based re-retrieval and repair.
Abstract
Library-oriented code generation methods typically supplement the library knowledge of large language models by retrieving API documentation. However, static retrieval cannot readily exploit runtime information generated during code generation to update the retrieved documents, and models may therefore still produce invalid API calls or code with runtime errors. To address this problem, we propose EFRRCoder, a library-oriented code generation method that combines execution-feedback-based re-retrieval and repair. On top of initial document retrieval and code generation, EFRRCoder introduces self-generated execution inputs to obtain runtime feedback from candidate programs, dynamically updates relevant API documents when execution reveals a potential API knowledge gap, and iteratively repairs failed code. This allows runtime information to improve generation results without additional model training. Experiments on the MonkeyEval and BeatNumEval library-oriented code generation benchmarks show that, across two base models, EFRRCoder improves pass@1 and pass@5 by up to 7.13 and 6.93 percentage points, respectively, over the best-performing baseline under each setting. Supplementary cross-library experiments on NdonnxEval further show that EFRRCoder consistently outperforms the compared baselines across both base models under docstring-removed and docstring-retained settings.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- LLM See, LLM Do: Enhancing Repository-Aware Code Generation in LLMs Through Logical Context and Usage KnowledgeACM Transactions on Software Engineering and Methodology · 2026
- To See is Not to Master: Teaching LLMs to Use Private Libraries for Code GenerationACM Transactions on Software Engineering and Methodology · 2026
- InspectCoder: Dynamic Analysis-Driven Self Repair through Interactive LLM-Debugger CollaborationProceedings of the ACM on Programming Languages · 2026
- Accepted but Wrong: Silent Failures of LLM Code Repairs after API MigrationsarXiv · 2026
- Understanding Regression in Code Self-Refinement: A Study of Refinement Protocols Without Execution FeedbackAI · 2026
- Code Comprehensor: Hierarchical Documentation and Cross-Modal Retrieval for Large RepositoriesarXiv · 2026