Large Language Model Unlearning for Source Code
Proceedings of the AAAI Conference on Artificial Intelligence · 14.03.2026 · 40 (37) · 31346-31355
DOI: 10.1609/aaai.v40i37.40398 ↗Kurz gefasst
Fachartikel in der Zeitschrift Proceedings of the AAAI Conference on Artificial Intelligence, online erschienen am 14.03.2026. Verfasst von Xue Jiang und 11 weiteren Autor:innen. Die Arbeit wurde bisher 1-mal zitiert (Crossref).
Abstract (Originalsprache)
While Large Language Models (LLMs) excel at code generation, their inherent tendency toward verbatim memorization of training data introduces critical risks like copyright infringement, insecurity emission, and deprecated API utilization, etc. A straightforward yet promising defense is unlearning, i.e., erasing or down-weighting the offending snippets through post-training. However, we find its application to source code often tends to spill over, damaging the basic knowledge of programming languages learned by the LLM and degrading the overall capability. To ease this challenge, we propose PROD for precise source code unlearning. PROD surgically zeroes out the prediction probability of the prohibited tokens, and renormalizes the remaining distribution so that the generated code stays correct. By excising only the targeted snippets, PROD achieves precise forgetting without much degradation of the LLM's overall capability. To facilitate in-depth evaluation against PROD, we establish an unlearning benchmark consisting of three downstream tasks (i.e., unlearning of copyrighted code, insecure code, and deprecated APIs), and introduce Pareto Dominance Ratio (PDR) metric, which indicates both the forget quality and the LLM utility. Our comprehensive evaluation demonstrates that PROD achieves superior overall performance between forget quality and model utility compared to existing unlearning approaches across three downstream tasks, while consistently exhibiting improvements when applied to LLMs of varying series. PROD also exhibits superior robustness against adversarial attacks without generating or exposing the data to be forgotten. These results underscore that our approach not only successfully extends the application boundary of unlearning techniques to source code, but also holds significant implications for advancing reliable code generation.
Zitieren
APA
Jiang, X., Dong, Y., Zhang, H., Wang, T., Fang, Z., Ma, Y., Cao, R., Li, B., Jin, Z., Jiao, W., Li, Y., & Li, G. (2026). Large Language Model Unlearning for Source Code. Proceedings of the AAAI Conference on Artificial Intelligence, 40(37), 31346-31355. https://doi.org/10.1609/aaai.v40i37.40398
Vancouver
Jiang X, Dong Y, Zhang H, Wang T, Fang Z, Ma Y, et al. Large Language Model Unlearning for Source Code. Proceedings of the AAAI Conference on Artificial Intelligence. 2026;40(37):31346-31355. doi:10.1609/aaai.v40i37.40398
BibTeX
@article{Jiang2026,
author = {Jiang, Xue and Dong, Yihong and Zhang, Huangzhao and Wang, Tangxinyu and Fang, Zheng and Ma, Yingwei and Cao, Rongyu and Li, Binhua and Jin, Zhi and Jiao, Wenpin and Li, Yongbin and Li, Ge},
title = {Large Language Model Unlearning for Source Code},
journal = {Proceedings of the AAAI Conference on Artificial Intelligence},
year = {2026},
volume = {40},
number = {37},
pages = {31346--31355},
doi = {10.1609/aaai.v40i37.40398}
}
EUVIMED