知识引导的大型语言模型是值得信赖的API推荐器

IF 2 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Hongwei Wei, Xiaohong Su, Weining Zheng, Wenxing Tao, Hailong Yu, Yuqian Kuang
{"title":"知识引导的大型语言模型是值得信赖的API推荐器","authors":"Hongwei Wei,&nbsp;Xiaohong Su,&nbsp;Weining Zheng,&nbsp;Wenxing Tao,&nbsp;Hailong Yu,&nbsp;Yuqian Kuang","doi":"10.1007/s10515-025-00518-4","DOIUrl":null,"url":null,"abstract":"<div><p><b>A</b>pplication <b>P</b>rogramming <b>I</b>nterface (API) recommendation aims to recommend APIs for developers that meet their functional requirements, which can compensate for developers’ lack of API knowledge. In team-based software development, developers often need to implement functionality based on specific interface parameter types predefined by the software architect. Therefore, we propose <b>API</b> <b>R</b>ecommendation under specific <b>I</b>nterface <b>P</b>arameter Types (APIRIP), a special variant of the API recommendation task that requires the recommended APIs to conform to the interface parameter types. To realize APIRIP, we enlist the support of <b>L</b>arge <b>L</b>anguage <b>M</b>odels (LLMs). However, LLMs are susceptible to the phenomenon known as hallucination, wherein they may recommend untrustworthy API sequences. Instances of this include recommending fictitious APIs, APIs whose calling conditions cannot be satisfied, or API sequences that fail to conform to the interface parameter types. To mitigate these issues, we propose a <b>K</b>nowledge-<b>g</b>uided framework <b>for</b> <b>LLM</b>-based API Recommendation (KG4LLM), which incorporates knowledge-guided data augmentation and beam search. The core idea of KG4LLM is to leverage API knowledge derived from the <b>J</b>ava <b>D</b>evelopment <b>K</b>it (JDK) documentation to enhance the trustworthiness of LLM-generated recommendations. Experimental results demonstrate that KG4LLM can improve the trustworthiness of recommendation results provided by LLM and outperform advanced LLMs in the APIRIP task.</p></div>","PeriodicalId":55414,"journal":{"name":"Automated Software Engineering","volume":"32 2","pages":""},"PeriodicalIF":2.0000,"publicationDate":"2025-05-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Knowledge-guided large language models are trustworthy API recommenders\",\"authors\":\"Hongwei Wei,&nbsp;Xiaohong Su,&nbsp;Weining Zheng,&nbsp;Wenxing Tao,&nbsp;Hailong Yu,&nbsp;Yuqian Kuang\",\"doi\":\"10.1007/s10515-025-00518-4\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p><b>A</b>pplication <b>P</b>rogramming <b>I</b>nterface (API) recommendation aims to recommend APIs for developers that meet their functional requirements, which can compensate for developers’ lack of API knowledge. In team-based software development, developers often need to implement functionality based on specific interface parameter types predefined by the software architect. Therefore, we propose <b>API</b> <b>R</b>ecommendation under specific <b>I</b>nterface <b>P</b>arameter Types (APIRIP), a special variant of the API recommendation task that requires the recommended APIs to conform to the interface parameter types. To realize APIRIP, we enlist the support of <b>L</b>arge <b>L</b>anguage <b>M</b>odels (LLMs). However, LLMs are susceptible to the phenomenon known as hallucination, wherein they may recommend untrustworthy API sequences. Instances of this include recommending fictitious APIs, APIs whose calling conditions cannot be satisfied, or API sequences that fail to conform to the interface parameter types. To mitigate these issues, we propose a <b>K</b>nowledge-<b>g</b>uided framework <b>for</b> <b>LLM</b>-based API Recommendation (KG4LLM), which incorporates knowledge-guided data augmentation and beam search. The core idea of KG4LLM is to leverage API knowledge derived from the <b>J</b>ava <b>D</b>evelopment <b>K</b>it (JDK) documentation to enhance the trustworthiness of LLM-generated recommendations. Experimental results demonstrate that KG4LLM can improve the trustworthiness of recommendation results provided by LLM and outperform advanced LLMs in the APIRIP task.</p></div>\",\"PeriodicalId\":55414,\"journal\":{\"name\":\"Automated Software Engineering\",\"volume\":\"32 2\",\"pages\":\"\"},\"PeriodicalIF\":2.0000,\"publicationDate\":\"2025-05-07\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Automated Software Engineering\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://link.springer.com/article/10.1007/s10515-025-00518-4\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Automated Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s10515-025-00518-4","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

摘要

API (Application Programming Interface,应用程序编程接口)推荐旨在向开发人员推荐满足其功能需求的API,弥补开发人员对API知识的缺乏。在基于团队的软件开发中,开发人员通常需要基于软件架构师预定义的特定接口参数类型来实现功能。因此,我们提出了特定接口参数类型下的API推荐(APIRIP),这是API推荐任务的一个特殊变体,要求推荐的API符合接口参数类型。为了实现APIRIP,我们获得了大型语言模型(llm)的支持。然而,法学硕士易受幻觉现象的影响,他们可能会推荐不可靠的API序列。这方面的实例包括推荐虚构的API、无法满足调用条件的API,或者不符合接口参数类型的API序列。为了缓解这些问题,我们提出了一种知识导向的基于llm的API推荐框架(KG4LLM),该框架结合了知识导向的数据增强和束搜索。KG4LLM的核心思想是利用来自Java Development Kit (JDK)文档的API知识来增强llm生成的建议的可信度。实验结果表明,KG4LLM可以提高LLM提供的推荐结果的可信度,在APIRIP任务中优于高级LLM。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Knowledge-guided large language models are trustworthy API recommenders

Application Programming Interface (API) recommendation aims to recommend APIs for developers that meet their functional requirements, which can compensate for developers’ lack of API knowledge. In team-based software development, developers often need to implement functionality based on specific interface parameter types predefined by the software architect. Therefore, we propose API Recommendation under specific Interface Parameter Types (APIRIP), a special variant of the API recommendation task that requires the recommended APIs to conform to the interface parameter types. To realize APIRIP, we enlist the support of Large Language Models (LLMs). However, LLMs are susceptible to the phenomenon known as hallucination, wherein they may recommend untrustworthy API sequences. Instances of this include recommending fictitious APIs, APIs whose calling conditions cannot be satisfied, or API sequences that fail to conform to the interface parameter types. To mitigate these issues, we propose a Knowledge-guided framework for LLM-based API Recommendation (KG4LLM), which incorporates knowledge-guided data augmentation and beam search. The core idea of KG4LLM is to leverage API knowledge derived from the Java Development Kit (JDK) documentation to enhance the trustworthiness of LLM-generated recommendations. Experimental results demonstrate that KG4LLM can improve the trustworthiness of recommendation results provided by LLM and outperform advanced LLMs in the APIRIP task.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Automated Software Engineering
Automated Software Engineering 工程技术-计算机:软件工程
CiteScore
4.80
自引率
11.80%
发文量
51
审稿时长
>12 weeks
期刊介绍: This journal details research, tutorial papers, survey and accounts of significant industrial experience in the foundations, techniques, tools and applications of automated software engineering technology. This includes the study of techniques for constructing, understanding, adapting, and modeling software artifacts and processes. Coverage in Automated Software Engineering examines both automatic systems and collaborative systems as well as computational models of human software engineering activities. In addition, it presents knowledge representations and artificial intelligence techniques applicable to automated software engineering, and formal techniques that support or provide theoretical foundations. The journal also includes reviews of books, software, conferences and workshops.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信