APICom: Automatic API Completion via Prompt Learning and Adversarial Training-based Data Augmentation
Yafeng Gu, Yiheng Shen, Xiang Chen, Shaoyu Yang, Yiling Huang,, Zhixiang Cao

TL;DR
APICom introduces a novel prompt learning and adversarial training approach for automatic API completion, significantly outperforming existing methods in generating accurate APIs from developer queries.
Contribution
The paper proposes APICom, a new API completion model leveraging prompt learning and adversarial data augmentation, addressing prefix information and improving generation accuracy.
Findings
APICom outperforms baselines by over 40% in EM@1.
Adversarial training improves model stability and accuracy.
Component ablations confirm the effectiveness of prompt learning and adversarial methods.
Abstract
Based on developer needs and usage scenarios, API (Application Programming Interface) recommendation is the process of assisting developers in finding the required API among numerous candidate APIs. Previous studies mainly modeled API recommendation as the recommendation task, which can recommend multiple candidate APIs for the given query, and developers may not yet be able to find what they need. Motivated by the neural machine translation research domain, we can model this problem as the generation task, which aims to directly generate the required API for the developer query. After our preliminary investigation, we find the performance of this intuitive approach is not promising. The reason is that there exists an error when generating the prefixes of the API. However, developers may know certain API prefix information during actual development in most cases. Therefore, we model…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Malware Detection Techniques
