paperbot · PL 论文追踪

全部论文 待读 收藏

P2 LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-Based Code Completion

LLM 遇上库演化:评估基于 LLM 的代码补全中的弃用 API 使用
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 3/10 · 该论文研究的是 LLM 代码补全中弃用 API 的使用问题,属于以 LLM 自身能力为研究对象的工作,既未将静态分析应用于 ML/Agentic 程序,也未用 LLM 改进静态分析或形式化验证,与浮点/贝叶斯程序分析更无交集。仅在“LLM 生成代码的正确性”这一软件工程话题上与编程环境/开发者工具方向有间接关联。引用 3 inbox
Chong Wang, Kaifeng Huang, Jian Zhang, Yebo Feng, Lyuye Zhang, Yang Liu, Xin Peng
crossref: 2026-09-12

AI 速览

一句话:首次系统评估 LLM 代码补全中弃用 API 的使用现状与成因,并提出两种轻量修复基线方法。

大语言模型在代码补全中表现良好,但库的快速演化使其难以使用正确且最新的 API。已有研究关注错误 API 预测,而基于 LLM 的代码补全中弃用 API 使用问题尚未被充分研究。本文开展首个针对该问题的评估研究,涉及 7 个先进 LLM、来自 8 个流行 Python 库的 145 组 API 映射以及 28,125 条补全提示。研究从模型、提示和库三个视角揭示了弃用 API 与替代 API 使用的现状(API 使用合理性与弃用率),并指出背后的根本原因。基于这些发现,作者提出两种轻量修复方法 Replaceapi 与 InsertPrompt,可作为未来缓解弃用 API 使用研究的基线方法,并为将库演化融入 LLM 驱动的软件开发提供启示。

问题
基于 LLM 的代码补全常因库快速演化而使用已弃用的 API,但该问题的具体表现与成因缺乏系统研究。
方法
构建包含 7 个 LLM、8 个 Python 库的 145 组 API 映射和 28,125 条提示的评估基准,从模型、提示与库三个维度分析弃用 API 使用情况,并据此设计两种轻量修复方法 Replaceapi 和 InsertPrompt。
评估
通过大规模提示级实验测量 API 使用合理性与弃用率,分析不同模型、提示与库的影响并归因,同时将两种修复方法作为基线进行评估。
原文摘要(Abstract)

Large language models (LLMs), pre-trained or fine-tuned on large code corpora, have shown effectiveness in generating code completions. However, in LLM-based code completion, LLMs may struggle to use correct and up-to-date Application Programming Interfaces (APIs) due to the rapid and continuous evolution of libraries. While existing studies have highlighted issues with predicting incorrect APIs, the specific problem of deprecated API usage in LLM-based code completion has not been thoroughly investigated. To address this gap, we conducted the first evaluation study on deprecated API usage in LLM-based code completion. This study involved seven advanced LLMs, 145 API mappings from eight popular Python libraries, and$\mathbf{2 8, 1 2 5}$completion prompts. The study results reveal the status quo (i.e., API usage plausibility and deprecated usage rate) of deprecated API and replacing API usage in LLM-based code completion from the perspectives of model, prompt, and library, and indicate the root causes behind. Based on these findings, we propose two lightweight fixing approaches, Replaceapi and InsertPrompt, which can serve as baseline approaches for future research on mitigating deprecated API usage in LLM-based completion. Additionally, we provide implications for future research on integrating library evolution with LLMdriven software development.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8788,
  title = {LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-Based Code Completion},
  author = {Chong Wang and Kaifeng Huang and Jian Zhang and Yebo Feng and Lyuye Zhang and Yang Liu and Xin Peng},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00245}
}