APIGen: Generative API Method Recommendation
Not on the map. Why?
Abstract (arXiv)
Automatic API method recommendation is an essential task of code intelligence, which aims to suggest suitable APIs for programming queries. Existing approaches can be categorized into two primary groups: retrieval-based and learning-based approaches. Although these approaches have achieved remarkable success, they still come with notable limitations. The retrieval-based approaches rely on the text representation capabilities of embedding models, while the learning-based approaches require extensive task-specific labeled data for training. To mitigate the limitations, we propose APIGen, a generative API recommendation approach through enhanced in-context learning (ICL). APIGen involves two main components: (1) Diverse Examples Selection. APIGen searches for similar posts to the programming queries from the lexical, syntactical, and semantic perspectives, providing more informative examples for ICL. (2) Guided API Recommendation. APIGen enables large language models (LLMs) to perform reasoning before generating API recommendations, where the reasoning involves fine-grained matching between the task intent behind the queries and the factual knowledge of the APIs. With the reasoning process, APIGen makes recommended APIs better meet the programming requirement of queries and also enhances the interpretability of results. We compare APIGen with four existing approaches on two publicly available benchmarks. Experiments show that APIGen outperforms the best baseline CLEAR by 105.8% in method-level API recommendation and 54.3% in class-level API recommendation in terms of SuccessRate@1. Besides, APIGen achieves an average 49.87% increase compared to the zero-shot performance of popular LLMs such as GPT-4 in method-level API recommendation regarding the SuccessRate@3 metric.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). First posted on arXiv 29 Jan 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 2.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models
- 2024Are Human Rules Necessary? Generating Reusable APIs with CoT Reasoning and In-Context Learning
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond
- 2025DeepCodeSeek: Real-Time API Retrieval for Context-Aware Code Generation
- 2025What Makes In-Context Examples Effective for Code Generation? ↗
- 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Information
- 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Grounding