Preprint · 2026 · Open access

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 Keung, Xiao Yu, Xiaoxue Ma

arXiv (Cornell University) · Published 22 September 2026 · DOI 10.48550/arxiv.2609.25786

Open PDFView at the publisherCite this paper

In brief

“What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models” is a 2026 preprint by Jin Liu and 6 co-authors, published in arXiv (Cornell University). OpenAlex counts 0 citations as of 24 November 2026. It is open access: the full text is free to read at arXiv (Cornell University).

Citations
0
References
50
Authors
7

Abstract

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.

Cite this paper

Formatted from the catalogue record. Check names, capitals and page numbers against the paper before you submit.

APA 7

Liu, J., He, Y., Lin, G., Liu, X., Keung, J., Yu, X., & Ma, X. (2026). What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2609.25786

MLA 9

Liu, Jin, et al. “What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models.” arXiv (Cornell University), 2026. https://doi.org/10.48550/arxiv.2609.25786.

Chicago

Liu, Jin, Yanzhong He, Guancheng Lin, Xiao Liu, Jacky Keung, Xiao Yu, and Xiaoxue Ma. 2026. “What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models.” arXiv (Cornell University). https://doi.org/10.48550/arxiv.2609.25786.

Harvard

Liu, J. et al. (2026) ‘What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models’, arXiv (Cornell University). doi:10.48550/arxiv.2609.25786.

IEEE

J. Liu et al., “What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models,” arXiv (Cornell University), 2026, doi: 10.48550/arxiv.2609.25786.

BibTeX

@misc{liu2026what,
  title     = {{What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models}},
  author    = {Liu, Jin and He, Yanzhong and Lin, Guancheng and Liu, Xiao and Keung, Jacky and Yu, Xiao and Ma, Xiaoxue},
  howpublished = {arXiv (Cornell University)},
  year      = {2026},
  doi       = {10.48550/arxiv.2609.25786},
  url       = {https://doi.org/10.48550/arxiv.2609.25786}
}

Download for a reference manager: BibTeX (.bib) · RIS for Zotero, Mendeley and EndNote (.ris)

Topic and keywords

Physical Sciences › Computer Science › Information Systems › Software Engineering Research

  • machine unlearning
  • large language models
  • code completion
  • gradient difference
  • Python library
  • layer-wise analysis

Work with this paper

Most-cited papers in Computer Science

All highly cited Computer Science papers

Questions about this paper

How do I cite this paper in APA style?

Liu, J., He, Y., Lin, G., Liu, X., Keung, J., Yu, X., & Ma, X. (2026). What Was Once Learned May Need to Be Unlearned: Machine Unlearning for Deprecated API Knowledge in Large Language Models. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2609.25786

How many times has this paper been cited?

0 times, according to OpenAlex on 24 November 2026. Google Scholar and Scopus count different sets of sources, so their numbers differ.

Is this paper free to read?

Yes. It is open access at arXiv (Cornell University): sign in and open the PDF from this page.

Who wrote this paper?

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

What is the DOI of this paper?

10.48550/arxiv.2609.25786, permanently at https://doi.org/10.48550/arxiv.2609.25786. Sign in and open it from this page.

Bibliographic data from OpenAlex (CC0), last checked 24 November 2026. ResearchGuru does not host this paper; once you are signed in, the links open it at the publisher or the repository that does.