API Recommendation for Novice Programmers: From Clear Expressions to Effective Results
- 12 February 2026
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Reliability
- Vol. 75 (00189529) , 991-1005
Abstract
API recommendation systems for novice programmers should prioritize usability and inspiration rather than merely pursuing the “best result”. Existing retrieval-based approaches, whether relying on direct similarity matching or using query expansion to generate clarification options, still cannot recover missing task semantics and often introduce additional ambiguity and interaction overhead. Learning-based methods, including neural architectures and recent LLM-driven techniques, require substantial data or strong prompt dependence and provide limited transparency, making it difficult to align model outputs with novice programmers' actual intent. To address these limitations, we propose IOCAPI (Intention-Oriented and Context-Aware API Recommendation), a reasoning-driven framework that integrates LLMs, LCMs, and in-context learning. It mainly contains three components: (1) Intent Detector, which refines the query and derives task semantics through model-generated I/O exemplars; (2) Code Generator, which produces representative code snippets under the confirmed I/O constraints; and (3) Task Bridger, which consolidates the results into actionable API recommendations with interpretable code examples. Evaluations on three public datasets show that IOCAPI attains a 35.7% BLEU improvement over APIGen and an 11.1% MRR gain over CLEAR, and achieves higher MAP scores than GPT-4 zero-shot, few-shot, and chain-of-thought baselines by 102%, 11.2%, and 21.8%, respectively. A controlled user study involving seven real programming tasks further provides empirical observations of IOCAPI's behavior in practice. Compared with KAHAID, IOCAPI obtained higher average scores in Correctness (1.67 vs. 1.00), Usability (1.76 vs. 0.40), and Inspiration (1.40 vs. 0.26).Keywords
This publication has 37 references indexed in Scilit:
- Knowledge-guided large language models are trustworthy API recommendersAutomated Software Engineering, 2025
- Speech-Guided Sequential Planning for Autonomous Navigation Using Large Language Model Meta AI 3 (Llama3)2025
- APIRec: deep knowledge and diversity-aware web API recommendationService Oriented Computing and Applications, 2024
- JDK 21: New Features2024
- Let's Chat to Find the APIs: Connecting Human, LLM and Knowledge Graph through AI Chain2023
- Batch Evaluation Metrics in Information Retrieval: Measures, Scales, and MeaningIEEE Access, 2022
- Automated Query Reformulation for Efficient Search Based on Query Logs From Stack Overflow2021
- Graph Embedding Based API Graph Search and RecommendationJournal of Computer Science and Technology, 2019
- Beyond one-hot encoding: Lower dimensional target embeddingImage and Vision Computing, 2018
- Understanding bag-of-words model: a statistical frameworkInternational Journal of Machine Learning and Cybernetics, 2010