Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning
While Code Language Models (CLMs) have demonstrated superior performance in software engineering tasks such as code generation and code summarization, recent empirical studies reveal a critical privacy vulnerability: these models exhibit unintended memorization of sensitive training data, enabling verbatim reproduction of confidential information when specifically prompted. To address this issue, several approaches, including dataset deduplication and differential privacy augmentation, have been proposed. However, these methods require full-model retraining for deployed CLMs, which incurs substantial computational costs. In this paper, we aim to answer the following research question: Can sensitive information memorized by CLMs be erased effectively and efficiently? We conduct a pioneering investigation into erasing sensitive memorization in CLMs through machine unlearning—a post hoc modification approach that removes specific information from trained models without requiring full retraining. Specifically, we first quantify the memorization risks of sensitive data within CLM training datasets and curate a high-risk dataset of 50,000 sensitive memorization samples by identifying and selecting vulnerable elements as unlearning targets. We investigate two widely-used gradient ascent-based unlearning approaches: the vanilla method and the constraint-based method, and introduce an advanced variant, termed CodeEraser, which selectively unlearns sensitive memorization elements in code while preserving the structural integrity and functional correctness of the surrounding code. Extensive experiments on three families of CLMs, i.e., CodeParrot, CodeGen-Mono and Qwen2.5-Coder, validate the effectiveness and efficiency of CodeEraser in erasing targeted sensitive memorization while maintaining model utility.
Thu 16 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
16:00 - 17:30 | AI for Software Engineering 19Research Track at Oceania IX Chair(s): Fabio Palomba University of Salerno | ||
16:00 15mTalk | An Eye for AI: Eye-Tracking the Micro-Interruptions of GenAI Code SuggestionsArtifact Award Winner Research Track Pre-print Media Attached | ||
16:15 15mTalk | Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or Worse Research Track Aaron Imani University of California, Irvine, Mohammad Moshirpour University of California, Irvine, Iftekhar Ahmed University of California at Irvine Pre-print Media Attached | ||
16:30 15mTalk | Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning Research Track Zhaoyang Chu Huazhong University of Science and Technology, Yao Wan Huazhong University of Science and Technology, Zhikun Zhang Zhejiang University, Di Wang King Abdullah University of Science and Technology, Zhou Yang University of Alberta, Alberta Machine Intelligence Institute , Hongyu Zhang Chongqing University, Pan Zhou Huazhong University of Science and Technology, Xuanhua Shi Huazhong University of Science and Technology, Hai Jin Huazhong University of Science and Technology, David Lo Singapore Management University Pre-print | ||
16:45 15mTalk | What Makes Code Generation Ethically Sourced?Distinguished Paper Award Research Track Zhuolin Xu Concordia University, Chenglin Li Concordia University, Qiushi Li Concordia University, Shin Hwei Tan Concordia University | ||
17:00 15mTalk | Filtering before Tuning: Robust Fine-Tuning of Large Code Models under Noisy Labels Research Track Zhong Li Nanjing University, Yang Chen China Automobile Data of Tianjin Co., Ltd. China Automotive Technology&Research Center Co.,Ltd., Heng Yong Nanjing University, Yuanyi Lin Huawei Technologies, Jiali Zhao Huawei, Tongtong Xu Huawei, Minxue Pan Nanjing University, Tian Zhang Nanjing University, Xuandong Li Nanjing University | ||
17:15 15mTalk | Automating Requirements Formalization: Using LLMs and Low-Complexity Distinguishing Traces for Semantic Validation Research Track Daniel Mendoza Stanford University, Anastasia Mavridou KBR / NASA Ames Research Center, Andreas Katis KBR / NASA Ames Research Center, Caroline Trippel Stanford University | ||