跳到主要导航 跳到搜索 跳到主要内容

LLM-based API Argument Completion with Knowledge-Augmented Prompts

  • Waseem Akram
  • , Yanjie Jiang*
  • , Haris Ali Khan
  • , Furqan Jalil
  • , Hui Liu
  • *此作品的通讯作者
  • Beijing Institute of Technology
  • COMSATS University Islamabad
  • Tianjin University

科研成果: 书/报告/会议事项章节 › 会议稿件 › 同行评审

摘要

Application Programming Interfaces (APIs) are fundamental to modern software development, yet accurately completing API method arguments remains a challenging task. Existing methods, such as information retrieval and hybrid program analysis with language models, often struggle with static code patterns and limited domain-specific knowledge. To this end, in this paper, we introduce APICopilot, a novel approach that enhances LLM-based API argument completion using dynamically generated, context-rich prompts. First, it creates an input knowledge graph (KG) from the preceding code for the to-be-complete API invocation, and a targeted knowledge graph from a collection of similar code files, both representing the anticipated API call. Second, it quantifies structural and semantic alignment between the two KGs and retrieves relevant subgraphs from the targeted graph. These subgraphs provide crucial structural context for in-context learning, enabling significantly more accurate and context-specific argument completions. Finally, we integrate the subgraphs into prompts and request LLMs to recommend API arguments. Our evaluation results on 54,000 Java files suggest that the proposed approach outperforms the state-of-the-art approach, improving precision, recall, and mean reciprocal rank by 38%, 36% and 23%, respectively.

源语言英语
主期刊名Proceedings - 2026 IEEE/ACM 48th International Conference on Software Engineering, ICSE 2026
出版商Association for Computing Machinery, Inc
页881-893
页数13
ISBN(电子版)9798400720253
DOI
出版状态已出版 - 11 9月 2026
已对外发布是
活动48th International Conference on Software Engineering, ICSE 2026 - Rio de Janeiro, 巴西
期限: 12 4月 2026 → 18 4月 2026

丛书

姓名Proceedings - 2026 IEEE/ACM 48th International Conference on Software Engineering, ICSE 2026

会议

会议48th International Conference on Software Engineering, ICSE 2026
国家/地区巴西
市Rio de Janeiro
时期12/04/26 → 18/04/26

学术指纹

探究 'LLM-based API Argument Completion with Knowledge-Augmented Prompts' 的科研主题。它们共同构成独一无二的学术指纹。

引用此