arXiv論文メモ
新着一覧
cs.SE · 査読状況未確認

コード生成モデルから廃止済みAPIの知識を忘れさせる方法

What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models

Jin Liu, Yanzhong He, Guancheng Lin, Xiao Liu, Jacky Wai Keung, Xiao Yu, and Xiaoxue Ma

この論文をやさしく読む

ひとことで言うと

コード生成モデルが古いAPIを出す振る舞いを、他の能力を保ちながら減らす方法を比較した研究。

何に役立つ?

ライブラリ更新時に古いAPIの提案を抑えるモデル改善と、その副作用を評価する際の参考になる。

この研究の面白いところ

元のモデルが実際に廃止APIを出す事例だけを集め、7,000件超で八つの忘却手法を比較した。

どこまで分かった?

評価は八つのPythonライブラリと三つのコードモデルが対象で、廃止時期やライブラリによって忘却の難しさが異なる。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

コード補完に用いる大規模言語モデルは、古いライブラリ版のコードを事前学習に含むため、廃止済みのAPIを生成することがある。既存の対策には推論時の介入、モデル編集、機械的忘却があるが、補完候補が複数あるため、事前に置換先を決める方法には制約がある。また、対象の廃止済みAPIをモデルが実際に生成するか、他のAPIへの意図しない影響がないかを確認した研究は少ない。本研究は廃止済みAPI知識の機械的忘却を体系的に実証評価し、行動に基づくベンチマークMUDAPIBenchを構築する。これは八つのPythonライブラリの廃止APIから現行APIへの145の対応関係から作った、モデルごとの7,000件超の事例であり、元のモデルが対象の廃止済みAPIを生成したものだけを残す。三つのコード生成大規模言語モデルで代表的な八つの忘却手法を比較し、廃止APIの忘却、現行APIの生成、他のAPIや無関係なAPIの振る舞いの維持、一般的なコード生成能力、効率を評価した。結果ではGradient Difference(GD)が全体として最良のバランスを示し、適度な計算費用で他の能力を保ちつつ廃止APIを抑制した。追加分析ではライブラリによる差が大きく、モデルの学習データの期間より後に廃止されたAPIほど忘れさせにくいことが分かった。層ごとの分析は、GDが内部の変化を比較的抑えながら有効な忘却を実現することを示唆した。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-22(UTC)
最新改訂
2026-09-22 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Large language models (LLMs) for code completion may generate deprecated APIs because their pre-training corpora contain code from historical library versions. Existing approaches use inference-time intervention, model editing, or machine unlearning, but multiple plausible completions make predefined replacements restrictive. Moreover, existing studies rarely verify whether models exhibit the targeted deprecated behavior or evaluate unintended changes to other APIs. We conduct a systematic empirical study of machine unlearning for deprecated API knowledge and construct MUDAPIBench, a behavior-grounded benchmark with over 7,000 model-specific instances derived from 145 deprecated-to-up-to-date API mappings across eight Python libraries. Instances are retained only when the original model generates the target deprecated API. We evaluate eight representative unlearning methods across three code LLMs on deprecated API forgetting, up-to-date API generation, preservation of other and unrelated API behaviors, general code-generation capability, and efficiency. Results show that Gradient Difference (GD) provides the best overall trade-off, suppressing deprecated APIs while preserving other capabilities with moderate computational costs. Further analyses reveal substantial variation across libraries and show that APIs deprecated after the model's training-data cutoff are harder to forget. Layer-wise analyses indicate that GD achieves effective forgetting with comparatively controlled internal changes.

arXiv ID: 2609.25786 / 要約の誤りについて