让我们通过对话找到 API:通过 AI 链连接人类、LLM 与知识图谱
Let's Chat to Find the APIs: Connecting Human, LLM and Knowledge Graph through AI Chain
AI总结:
本文提出由知识图谱引导的五阶段 LLM AI 链,用于 API 推荐中的多轮查询澄清,实验证明其在 MRR、MAP 及问题质量上显著优于基线。
摘要:
API 推荐方法已经从字面和语义关键词匹配演进到查询扩展与查询澄清。最新的查询澄清方法基于知识图谱(KG),但存在词表外(OOV)失败和问题模板僵化等局限。为解决这些局限,我们提出一种新颖的知识引导查询澄清方法用于 API 推荐,该方法利用由 KG 引导的大型语言模型(LLM)。我们将 LLM 用作神经知识库,以克服 OOV 失败,并生成流畅、恰当的澄清问题与选项。我们还利用 KG 中存储的结构化 API 知识和实体关系过滤噪声,并将来自 KG 的最优澄清路径迁移给 LLM,从而提高澄清过程的效率。我们的方法被设计为一条包含五个步骤的 AI 链,每个步骤由一次独立的 LLM 调用处理,以提升 API 推荐中查询澄清的准确性、效率和流畅性。我们验证了 AI 链中每个单元的有用性,它们均获得接近满分 5 分的高分。与基线相比,我们的方法在 MRR 上表现出显著提升:当查询语句被 KG 覆盖时,最高提升 63.9%;当未被覆盖时,最高提升 37.2%。消融实验表明,KG 中知识的引导以及知识引导的寻路策略对我们方法的性能至关重要,二者分别带来 19.0% 和 22.2% 的 MAP 提升。我们的方法展示了一种弥合 KG 与 LLM 之间差距的途径,可有效互补二者的优势与不足。
英文摘要:
API recommendation methods have evolved from literal and semantic keyword matching to query expansion and query clarification. The latest query clarification method is knowledge graph (KG)-based, but limitations include out-of-vocabulary (OOV) failures and rigid question templates. To address these limitations, we propose a novel knowledge-guided query clarification approach for API recommendation that leverages a large language model (LLM) guided by KG. We utilize the LLM as a neural knowledge base to overcome OOV failures, generating fluent and appropriate clarification questions and options. We also leverage the structured API knowledge and entity relationships stored in the KG to filter out noise, and transfer the optimal clarification path from KG to the LLM, increasing the efficiency of the clarification process. Our approach is designed as an AI chain that consists of five steps, each handled by a separate LLM call, to improve accuracy, efficiency, and fluency for query clarification in API recommendation. We verify the usefulness of each unit in our AI chain, which all received high scores close to a perfect 5. When compared to the baselines, our approach shows a significant improvement in MRR, with a maximum increase of 63.9% higher when the query statement is covered in KG and 37.2% when it is not. Ablation experiments reveal that the guidance of knowledge in the KG and the knowledge-guided pathfinding strategy are crucial for our approach's performance, resulting in a 19.0% and 22.2% increase in MAP, respectively. Our approach demonstrates a way to bridge the gap between KG and LLM, effectively compensating for the strengths and weaknesses of both.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。