arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.03182cs.SEcs.LG
收藏

理解代码LLM中模型编辑的鲁棒性

Understanding Robustness of Model Editing in Code LLMs

Louisiana State University(路易斯安那州立大学);University of Kentucky(肯塔基大学)

Vinaik Chhetri, Moghis Fereidouni, A. B Siddique, Umar Farooq

AI总结:

研究代码LLM在API更新下的模型编辑鲁棒性,评估不同方法在单次和连续编辑下的性能,发现多数方法在泛化和特定性上表现不佳,且连续编辑导致性能显著下降。

摘要:

大型语言模型(LLMs)在代码领域日益被用于软件开发,但它们在预训练后保持静态,而API和软件库持续演变。模型编辑提供了一种轻量级替代方法,用于整合API更新,但现有编辑方法是否能诱导正确的API迁移、泛化到未见任务以及在未修改API任务中保持性能仍不明确。本文提出一个受控基准,基于HumanEval、MBPP和APPS,包含2040个问题,覆盖140种独特的合成API修改,以及一个执行沙盒,强制在标准Python语义下执行编辑后的API。评估了几种最先进的编辑方法在三个代码LLM上的表现,使用基于执行的指标区分成功的API采用与基于绕过的方法完成任务。在单次编辑下,编辑模型在未见API使用上泛化较差,许多看似成功的是基于绕过的方法而非真正的API迁移。在涉及未修改API的任务中性能也下降,尽管基于记忆的方法和微调在特定性上优于定位后编辑方法。在连续编辑下,大多数方法模型组合在泛化和特定性上接近零Pass@k,揭示了超出目标编辑的显著干扰。双因素Shapley分解进一步显示,单次编辑在泛化上的失败包含显著的编译组件,而特定性失败更多是编译后的问题。在连续编辑下,失败主要由编译驱动。

英文摘要:

Large language models (LLMs) for code are increasingly used in software development, but they remain static after pretraining while APIs and software libraries continue to evolve. Model editing offers a lightweight alternative to retraining for incorporating API updates, yet it remains unclear whether existing editing methods can induce correct API migration, generalize that behavior to unseen tasks, and preserve performance on tasks involving unmodified APIs. We present a controlled benchmark for evaluating model editing under API updates in code LLMs, built from HumanEval, MBPP, and APPS, with 2,040 problems spanning 140 unique synthetic API modifications, together with an execution sandbox that enforces edited APIs under standard Python semantics. We evaluate several state-of-the-art editing methods on three code LLMs under both single-edit and successive-edit regimes using execution-based metrics that distinguish successful API adoption from workaround-based task completion. Under single edits, edited models generalize poorly to unseen uses of the modified API, and many apparent successes are workaround-based rather than true API migrations. Performance on tasks involving unmodified APIs also degrades, although memory-based methods and fine-tuning preserve specificity better than locate-then-edit methods. Under successive edits, most method-model combinations collapse to near-zero Pass@k on both generalization and specificity, revealing substantial interference beyond the target edits. A two-factor Shapley decomposition further shows that single-edit failures on generalization include a substantial compilation component, whereas specificity failures are more often post-compilation. Under successive edits, failures become predominantly compilation-driven.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑