Abstract
Large Language Models (LLMs) frequently memorize sensitive training data verbatim, posing significant privacy risks. We introduce Private Memorization Editing (PME), a surgical weight-editing technique that identifies layers responsible for privacy leaks and "reprograms" them to generate safe, dummy information. Unlike traditional machine unlearning, PME preserves the model's general intelligence and linguistic stability. Our evaluation shows that PME reduces Training Data Extraction (TDE) attack success by an average of 96.03% while maintaining performance across standard NLP benchmarks.
1. Introduction
As Large Language Models (LLMs) scale, they increasingly memorize specific sequences from their training corpora, including Personally Identifiable Information (PII) such as emails and phone numbers. Post-training data removal is challenging; retraining is prohibitively expensive, and existing "machine unlearning" methods often degrade general model performance or fail against "Association Attacks."
The authors identify a core challenge: LLMs tend to memorize PII as verbatim sequences rather than associating them with a specific identity. PME aims to turn this memorization into a defense by editing the model's internal "memory" of these sequences.
2. Methodology: Private Memorization Editing (PME)
PME is a parameter-efficient editing technique targeting the Feed-Forward (FFN) layers, which function as the "key-value" memory of the Transformer architecture. The PME pipeline consists of three stages:
- Optimal Representation Discovery: Using gradient descent, the algorithm identifies a "target" hidden state that prompts the model to generate safe "dummy" PII (e.g.,
[email protected]) instead of the sensitive original. - Geometric Layer Attribution: PME employs a single forward pass to calculate a contribution coefficient for each layer. By projecting layer outputs onto the final representation, it identifies the layers most responsible for the memorized sequence without the computational cost of traditional causal tracing.
- Closed-Form Weight Update: The FFN weights ($W_{out}$) are updated using a mathematically optimized formula. Edits are distributed across the network based on the contribution coefficients, ensuring the most relevant layers receive the most significant modifications.
3. Experimental Evaluation
The authors evaluated PME using GPT-J (6B) and GPT-Neo (1.3B, 2.7B) models trained on The Pile.
3.1 Datasets and Benchmarks
- Privacy Targets: Emails from the Enron sub-corpus and phone numbers/URLs from Pile-CC.
- Utility Benchmarks: HellaSwag, LAMBADA, PIQA, Winogrande, and WikiText were used to monitor general intelligence post-edit.
- Correlation Estimation: A Wikipedia subset helped calibrate the algorithm's understanding of the model's "key" space.
3.2 Privacy Protection and Utility Preservation
PME achieved a 96.03% average reduction in Training Data Extraction (TDE) attack success. Notably, the method proved robust against Association Attacks; by breaking the model's ability to generate the private string, it effectively severed the link between identities and their sensitive data.
As shown in the figure above, PME maintains near-original performance across all utility benchmarks. In contrast, baselines like DeMem significantly increased perplexity (e.g., on Wikitext and Lambada) or decreased accuracy (e.g., on Hellaswag), indicating a loss of general linguistic capability. GRACE maintained utility but was found to fail in generalizing the privacy defense to varied attack prompts.
4. Discussion and Key Insights
- Memorization as a Shield: Rather than attempting to erase memorized data, PME "hijacks" the memorization process to ensure the model consistently outputs safe information.
- FFN as Storage: The success of PME reinforces the theory that FFN layers serve as the primary storage for factual and verbatim data in Transformers.
- Efficiency: The geometric attribution method is significantly faster than causal tracing, making PME a viable candidate for large-scale privacy scrubbing in production models.
5. Limitations and Future Work
While effective, PME currently requires access to model weights and knowledge of the leaked sequences. Future research should explore "black-box" applications where training data is unknown. Additionally, while PME excels at structured PII (emails, phone numbers), its effectiveness on unstructured or contextual secrets remains to be fully explored. The long-term impact of tens of thousands of sequential edits on a model's internal logic also warrants further investigation.
Summary updated