A groundbreaking study introduces CodeEraser, a novel machine unlearning technique that addresses privacy vulnerabilities in Code Language Models (CLMs). This approach selectively erases sensitive information like passwords and API keys from CLMs without full retraining, achieving a 93.89% reduction in memorization while maintaining 99.00% of original performance. The method outperforms existing approaches, completing the process in just 47 seconds per sample. This research has significant implications for data protection regulations and the development of privacy-preserving AI systems. It offers a practical solution for organizations to comply with "Right to Be Forgotten" requests efficiently, paving the way for more trustworthy AI-powered software engineering tools.
Code Language Models (CLMs) have revolutionized software engineering by automating tasks like code generation, summarization, and program repair. However, a critical privacy vulnerability has emerged: these models often memorize and can reproduce sensitive information from their training data. A groundbreaking study published in ICSE ’26 addresses this problem through an innovative approach called “machine unlearning.” The research paper, available at https://arxiv.org/abs/2509.13755, demonstrates that sensitive information like passwords, API keys, and personal data can be selectively erased from CLMs while preserving their overall functionality.
The study, led by researchers Zhaoyang Chu, Yao Wan, and colleagues, introduces a novel technique called CodeEraser that can effectively remove specific sensitive information from CLMs without requiring full retraining. Their approach achieves a remarkable 93.89% reduction in memorization of targeted sensitive data while maintaining 99.00% of the model’s original performance, all within approximately 47 seconds per sample—dramatically more efficient than traditional retraining approaches that would require hundreds of GPU days.
Understanding the memorization problem in CLMs is crucial for appreciating the significance of this research. During their training process, CLMs like CodeGen, Code Llama, and Qwen2.5-Coder learn from vast amounts of code collected from GitHub repositories. Unfortunately, this training data often contains sensitive information such as personal identifiers, emails, passwords, and API keys. The researchers discovered that approximately 7% of training samples containing sensitive data were memorized by popular models like CodeParrot-small and CodeGen-350M-Mono, presenting substantial privacy risks.
Current approaches to mitigate memorization issues have significant limitations. Data de-duplication methods, which remove repeated instances from training data, can’t completely prevent memorization. Differential privacy techniques formally guarantee limited influence of individual data points but significantly degrade model performance by constraining the learning of rare patterns. Most importantly, both approaches would require complete retraining of the model to remove specific sensitive information, which is computationally prohibitive for large-scale CLMs, potentially requiring 900-1800 GPU days.
The CodeEraser approach introduced in this paper takes a fundamentally different direction by leveraging machine unlearning. Unlike existing techniques that indiscriminately forget entire code samples, CodeEraser selectively targets only the sensitive segments within code. The researchers first identify sensitive data using detection tools and then apply gradient ascent exclusively to sensitive segments to actively diminish their memorization while using gradient descent on surrounding non-sensitive code to preserve its integrity.
To evaluate their approach, the researchers constructed a comprehensive dataset of 50,000 sensitive memorized samples from various CLMs and established empirical thresholds for determining when information has been successfully “forgotten” by a model. They then compared CodeEraser against two baselines: a vanilla gradient ascent method and a constraint-based method.
The results across three families of CLMs (CodeParrot, CodeGen-Mono, and Qwen2.5-Coder) demonstrate CodeEraser’s superiority. For instance, with Qwen2.5-Coder-7B, CodeEraser achieved a 93.89% reduction in memorization while preserving 99.99% of the model’s code generation performance on the HumanEval benchmark. This significantly outperformed the baseline approaches, which showed performance degradations of up to 29% in some cases.
Interestingly, the research revealed that the characteristics of the targeted sensitive data—including the number of samples, their frequency in the training data, and the type of sensitive information—significantly influence unlearning effectiveness. For example, unlearning API/SSH keys sometimes actually improved model performance, likely because these atypical patterns functioned as outliers that previously distracted the model.
The implications of this research extend beyond technical achievements. As data protection regulations like the European Union’s GDPR and the California Consumer Privacy Act establish the “Right to Be Forgotten”, techniques like CodeEraser provide practical mechanisms for compliance. Organizations deploying CLMs can now respond to user requests to remove specific sensitive information without incurring the enormous computational costs of full retraining.
This pioneering study opens new avenues for research at the intersection of machine learning, privacy, and software engineering. By demonstrating that sensitive memorization can be selectively erased from CLMs efficiently and effectively, the researchers have made a significant contribution toward more privacy-preserving artificial intelligence systems. For developers interested in learning more about these concepts, Hands-On Large Language Models: Language Understanding and Generation provides excellent background on how these models work.
For developers and organizations working with large language models for code, this research offers a promising path forward: the ability to harness the power of CLMs while actively mitigating the risks of sensitive data exposure, ultimately creating more trustworthy AI systems for software engineering. Those concerned with implementing privacy in their software development practices may find Privacy for Software Engineers: A Practical Guide to Data Protection and Compliance a valuable resource for understanding best practices.
The selective unlearning approach demonstrated in CodeEraser represents a critical advancement in addressing the growing concerns about privacy and security in AI-powered development environments. For a deeper understanding of data privacy concepts in modern engineering, Data Privacy: A runbook for engineers offers practical strategies that complement the techniques discussed in this research.
For those interested in building their own language models with privacy considerations in mind, The Hundred-Page Language Models Book: hands-on with PyTorch provides accessible guidance on implementing state-of-the-art techniques while considering important ethical implications like those addressed by the CodeEraser research.






The concrete examples make this easier to apply. Readers comparing related resources may also find Tiktok Comment Generator useful in this context.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Numberblocks Generator Websim.
The workflow details are helpful. They fit well with small browser utilities like Fileformatconverter for quick conversion and everyday technical tasks.
I like the focus on making small technical tasks simpler. A browser-based utility such as 預金利息 計算ツール makes sense when installing software would be too much overhead.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Tomodachi Life 2 Insel Ideen.
I like the focus on making small technical tasks simpler. A browser-based utility such as Persona 5 Royal Fusion Calculator makes sense when installing software would be too much overhead.
I like the focus on making small technical tasks simpler. A browser-based utility such as 預金利息 計算ツール makes sense when installing software would be too much overhead.
The workflow details are helpful. They fit well with small browser utilities like Fileformatconverter for quick conversion and everyday technical tasks.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Gothic Remake Truhe Silas Keller Unter Wasser.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like 시드 크래커.
I like the focus on making small technical tasks simpler. A browser-based utility such as 預金利息 計算ツール makes sense when installing software would be too much overhead.
The concrete examples make this easier to apply. Readers comparing related resources may also find How To Get Moss Crystal In Cut A Gem Roblox useful in this context.
The concrete examples make this easier to apply. Readers comparing related resources may also find Razer Synapse 3 Vs 4 useful in this context.
I appreciated the clear framing here. It connects well with practical web resources such as Ndm Download Manager.
I like the focus on making small technical tasks simpler. A browser-based utility such as 預金利息 計算ツール makes sense when installing software would be too much overhead.
The concrete examples make this easier to apply. Readers comparing related resources may also find Inline Html Compiler useful in this context.
I like the focus on making small technical tasks simpler. A browser-based utility such as 預金利息 計算ツール makes sense when installing software would be too much overhead.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Stranger Than Heaven オフラインアカウント.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Stardewplanner.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Stardewplanner.
The concrete examples make this easier to apply. Readers comparing related resources may also find Splatoonraidersswitch2 useful in this context.
I like how this frames writing as a practical process rather than just a finished result. Readers comparing drafting references may also find Restoryrepairguide useful.
I appreciated the clear framing here. It connects well with practical web resources such as Mistfallloadouts.
The concrete examples make this easier to apply. Readers comparing related resources may also find Madden27ratings useful in this context.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Lotrwarinthenorth.
The concrete examples make this easier to apply. Readers comparing related resources may also find 붐바나나 공략 useful in this context.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Seedcracker 26.1.2.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like 動物 ランダム.
The concrete examples make this easier to apply. Readers comparing related resources may also find Download 2026 Pdf useful in this context.
I appreciated the clear framing here. It connects well with practical web resources such as Pokedex Winds And Waves.
I appreciated the clear framing here. It connects well with practical web resources such as Poe2 パッシブツリー 検索.
I appreciated the clear framing here. It connects well with practical web resources such as Phantombladezero.
I like the focus on making small technical tasks simpler. A browser-based utility such as Persona 5 Royal Fusion Calculator makes sense when installing software would be too much overhead.
I like the practical angle here. Short browser-based games can work well when people want something easy to start and easy to leave, which is why Peak Game fits this context.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Numberblocks Generator Websim.
This is a useful reminder that quick visual experiments often need simple workflows. A tool like Nomoreroominhell can fit that kind of lightweight editing context.
I appreciated the clear framing here. It connects well with practical web resources such as Mistfallhunterclasses.
I appreciated the clear framing here. It connects well with practical web resources such as Minecraftmodverity.
The concrete examples make this easier to apply. Readers comparing related resources may also find Leagueclassic useful in this context.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Iron Soul Dungeon Code.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Gothic Remake Mage Build.
The concrete examples make this easier to apply. Readers comparing related resources may also find Ghostrider useful in this context.
The workflow details are helpful. They fit well with small browser utilities like Fileformatconverter for quick conversion and everyday technical tasks.
I appreciated the clear framing here. It connects well with practical web resources such as Fh6treasurehunt.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like NãO Durma Com Os Peixes.
This was a useful read, especially the practical framing. It fits naturally beside related web resources like Crimson Desert Ps5 Patch.
The practical angle here is helpful. It fits well with quick creative resources like Buildyourbackrooms for browser-based visual experiments.
I appreciated the clear framing here. It connects well with practical web resources such as Big Walk Guide.
The concrete examples make this easier to apply. Readers comparing related resources may also find Beast Reincarnation useful in this context.
I appreciated the clear framing here. It connects well with practical web resources such as Neat Download Manager.
I like the focus on making small technical tasks simpler. A browser-based utility such as Fd Calculator makes sense when installing software would be too much overhead.
The concrete examples make this easier to apply. Readers comparing related resources may also find Sir Form Download Pdf Karnataka useful in this context.
The concrete examples make this easier to apply. Readers comparing related resources may also find Razersynapsedownload useful in this context.
The workflow details are helpful. They fit well with small browser utilities like Palbreedingcalculator for quick conversion and everyday technical tasks.