A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) like GitHub Copilot and ChatGPT have emerged as powerful tools for code generation, significantly enhancing productivity and accelerating software development. However, existing benchmarks primarily focus on general code generation without considering API-oriented code generation, i.e., generating code that invokes APIs from specific libraries. Given the growing demand for API-oriented code generation, there is a pressing need for a systematic and automated approach to evaluate LLM on API-oriented code generation. To address this gap, we propose AutoAPIEval, a lightweight and automated framework designed to evaluate the capabilities of LLMs in API-oriented code generation. Our framework works with any library that provides API documentation and focuses on two unit tasks: API recommendation and code example generation, along with four metrics to evaluate the generated APIs and code examples, such as the proportion of incorrect API recommendations for Task 1, and the proportion of code examples where no specific API is invoked and uncompilable/unexecutable code examples for Task 2. In addition, we conducted a case study on three LLMs (ChatGPT, MagiCoder, and DeepSeek Coder) and Java Runtime Environment 8 to demonstrate the framework's effectiveness. Our findings reveal substantial variability in LLM performance across tasks, with ChatGPT adhering better to instructions, while sharing similar effectiveness in code example generation with its counterparts (i.e., MagiCoder and DeekSeek Coder). We also identify key factors associated with code quality, such as API popularity and model confidence, and build classifiers that achieve high accuracy in detecting incorrect API recommendations and erroneous code examples. Retrieval-augmented generation enhances the quality of code generated by LLMs, though its effectiveness varies across different LLMs.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 35 of its 71 references that are in the map. First posted on arXiv 23 Sep 2024.
Builds on
35 of 71 references.
References · 35
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2023Trusting Your Evidence: Hallucinate Less with Context-aware Decodingcited by 319
- 2024Knowledge Conflicts for LLMs: A Surveycited by 274
- 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 264
23 more
- 2023Self-collaboration Code Generation via ChatGPTcited by 255
- 2023VeriGen: A Large Language Model for Verilog Code Generationcited by 197
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 150
- 2021Retrieval Augmented Code Generation and Summarizationcited by 148
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
- 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
- 2023How Secure is Code Generated by ChatGPT?cited by 77
- 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
- 2024We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMscited by 61
- 2023CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Modelscited by 52
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 52
- 2024DYNAMICQA: Tracing Internal Knowledge Conflicts in Language Modelscited by 34
- 2023Assessing the Security of GitHub Copilot Generated Code -- A Targeted Replication Studycited by 24
- 2019An Empirical Study of Obsolete Answers on Stack Overflowcited by 14
- 2024An Empirical Study on Developers Shared Conversations with ChatGPT in GitHub Pull Requests and Issuescited by 8
- 2024VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMscited by 7
- 2024Is ChatGPT a Good Software Librarian? An Exploratory Study on the Use of ChatGPT for Software Library Recommendationscited by 7
- 2022Impact of Discretization Noise of the Dependent variable on Machine Learning Classifiers in Software Engineeringcited by 6
- 2022The Impact of Using Regression Models to Build Defect Classifierscited by 5
- 2023Source Code Recommender Systems: The Practitioners' Perspectivecited by 2
- 2024Studying and Recommending Information Highlighting in Stack Overflow Answerscited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Towards Mitigating API Hallucination in Code Generated by LLMs with Hierarchical Dependency Aware
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories
- 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Grounding
- 2026When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation
- 2024Harnessing LLMs for API Interactions: A Framework for Classification and Synthetic Data Generation
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
- 2024APIGen: Generative API Method Recommendation
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisition