APIRecX: Cross-Library API Recommendation via Pre-Trained Language Model
摘要
For programmers, learning the usage of APIs (Application Programming Interfaces) of a software library is important yet difficult. API recommendation tools can help developers use APIs by recommending which APIs to be used next given the APIs that have been written. Traditionally, language models such as N-gram are applied to API recommendation. However, because the software libraries keep changing and new libraries keep emerging, new APIs are common. These new APIs can be seen as OOV (out of vocabulary) words and cannot be handled well by existing API recommendation approaches due to the lack of training data. In this paper, we propose APIRecX, the first cross-library API recommendation approach, which uses BPE to split each API call in each API sequence and pre-trains a GPTbased language model. It then recommends APIs by fine-tuning the pre-trained model. APIRecX can migrate the knowledge of existing libraries to a new library, and can recommend APIs that are previously regarded as OOV. We evaluate APIRecX on six libraries and the results confirm its effectiveness by comparing with two typical API recommendation approaches.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Bridge and Hint: Extending Pre-trained Language Models for Long-Range Code 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Vectorizing Program Ingredients for Better JVM Testing 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Code Difference Guided Adversarial Example Generation for Deep Code Models 引用了 Vectorizing Program Ingredients for Better JVM Testing
- Code Difference Guided Adversarial Example Generation for Deep Code Models 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Code Difference Guided Adversarial Example Generation for Deep Code Models 引用了 Learning to Construct Better Mutation Faults
- Learning to Construct Better Mutation Faults 引用了 Big code != big vocabulary: open-vocabulary models for source code
引用它的顶会 Paper6
- Learning to Construct Better Mutation FaultsZhao Tian, Junjie Chen, Qihao Zhu, Junjie Yang 等ASE 2022 · 35 次引用
- Code Difference Guided Adversarial Example Generation for Deep Code ModelsZhao Tian, Junjie Chen, Zhi JinASE 2023 · 27 次引用
- Vectorizing Program Ingredients for Better JVM TestingTianchang Gao, Junjie Chen, Yingquan Zhao, Yuqun Zhang 等ISSTA 2023 · 16 次引用
- Bridge and Hint: Extending Pre-trained Language Models for Long-Range CodeYujia Chen, Cuiyun Gao, Zezhou Yang, Hongyu Zhang 等ISSTA 2024 · 4 次引用
- Navigating the Testing of Evolving Deep Learning Systems: An Exploratory Interview StudyHanmo You, Zan Wang, Bin Lin, Junjie ChenICSE 2025 · 1 次引用
它引用的 Paper5
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- Cross-Lingual Natural Language Generation via Pre-TrainingZewen Chi, Li Dong, Furu Wei, Wenhui Wang 等AAAI 2020 · 142 次引用
- Big code != big vocabulary: open-vocabulary models for source codeRafael-Michael Karampatsis, Hlib Babii, Romain Robbes, Charles Sutton 等ICSE 2020 · 140 次引用
- Alternating Language Modeling for Cross-Lingual Pre-TrainingJian Yang, Shuming Ma, Dongdong Zhang, Shuangzhi Wu 等AAAI 2020 · 94 次引用
- BPE-Dropout: Simple and Effective Subword RegularizationIvan Provilkov, Dmitrii Emelianenko, Elena VoitaACL 2020 · 17 次引用
相关 Paper
- An Empirical Study of Python Library Migration Using Large Language ModelsMohayeminul Islam, Ajay Kumar Jha, May Mahmoud, Ildar Akhmetov 等ASE 2025 · 2 次引用
- Pig: Leveraging Large Language Models for Python Library MigrationsMiryeong Kang, Wonseok Oh, Gabin An, Hakjoo OhFSE 2026
- When Language Model Meets Private LibraryDaoguang Zan, Bei Chen, Zeqi Lin, Bei Guan 等EMNLP Findings 2022 · 39 次引用
- CLEAR: Contrastive Learning for API RecommendationMoshi Wei, Nima Shiri Harzevili, Yuchao Huang, Junjie Wang 等ICSE 2022 · 43 次引用
- LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-Based Code CompletionChong Wang, Kaifeng Huang, Jian Zhang, Yebo Feng 等ICSE 2025 · 3 次引用
