Abstract
Language models (LMs) risk inadvertently memorizing and divulging sensitive or personally identifiable information (PII) seen in training data, causing privacy concerns. Current approaches to address this issue involve costly dataset scrubbing, or model filtering through unlearning and model editing, which can be bypassed through extraction attacks. We propose REVS, a novel non-gradient-based method for unlearning sensitive information from LMs. REVS identifies and modifies a small subset of neurons relevant for constituent tokens which form sensitive information. To adequately evaluate our method on truly sensitive information, we curate three datasets: an email and URL datasets naturally memorized by the models, and a synthetic social security number dataset that we tune the models to memorize. Compared to other methods, REVS demonstrates superior performance in unlearning sensitive information and robustness to extraction attacks, while retaining underlying model integrity.
Introduction
Large Language Models (LLMs) are notorious for "memorizing" snippets of their training data, which often includes sensitive Personal Identifiable Information (PII) like private emails, phone numbers, or URLs. This creates significant privacy and legal challenges, such as GDPR compliance. Existing solutions generally fall into two camps: prohibitively expensive dataset scrubbing (retraining from scratch) or fragile machine unlearning techniques. Current unlearning methods, like gradient ascent, often provide only "surface-level" protection; sensitive information frequently remains buried in the model's weights, where it can be recovered using "extraction attacks" that inspect internal activations.
REVS (Rank Editing in the Vocabulary Space) addresses these issues through a surgical, non-gradient-based approach. By identifying and modifying specific neurons in the model's Multi-Layer Perceptron (MLP) layers that promote sensitive tokens, REVS effectively "unlearns" private data while maintaining general performance and providing robust resistance against sophisticated extraction attacks.
Methodology
REVS operates on the principle that transformer MLP layers act as "key-value" memories, where the "values" are essentially directions in the output vocabulary space. The method consists of two main phases:
- Neuron Localization: The algorithm identifies which layers and specific neurons (columns in the $FF_2$ matrix) are responsible for predicting a sensitive token. It uses a hybrid selection strategy based on activation strength (how much a neuron fires for a specific prompt) and token association (how much that neuron's weight vector promotes the target token in the vocabulary).
- Rank Editing: Instead of using gradients, REVS performs a direct algebraic update. It projects a neuron's weights into the vocabulary space using the model's unembedding matrix, lowers the logit (score) of the sensitive token to a target "safe" rank, and then projects this modified vector back into the neuron space using the Moore-Penrose pseudoinverse.
To ensure efficiency, the method targets only the rarest tokens in a sensitive sequence (e.g., the unique part of an email address), as breaking these specific links is usually sufficient to prevent the model from reconstructing the full sensitive string.
Experimental Setup
The authors curated three benchmark datasets to evaluate unlearning on actual sensitive information:
- Emails & URLs: Real addresses and links that Llama-3-8B and GPT-J-6B naturally memorized during pretraining on "The Pile."
- Synthetic SSN: A dataset of 200 sentences containing social security numbers. Models were specifically fine-tuned to memorize these to test "forced" unlearning.
These datasets differ from previous benchmarks by focusing on specific, verbatim private strings rather than broad conceptual knowledge.
Results and Discussion
REVS was compared against six strong baselines, including MEMIT and RMU, yielding several key insights:
- Superior Unlearning: On the SSN dataset with Llama-3-8B, REVS achieved an Unlearning Score of ~89.6%, vastly outperforming the next best baseline, FT-L (~37%).
- Extraction Resistance: REVS showed remarkable resilience to "Perturbation Attacks," where attackers attempt to trick the model into revealing info via slightly altered prompts. While baselines often leaked erased info, REVS maintained near-perfect resistance.
- Integrity Preservation: Despite the edits, model scores on general benchmarks like MMLU and GSM8K remained stable, proving the surgery did not cause collateral damage to general capabilities.
- Specificity: Unlike gradient-based unlearning which "smears" updates across many parameters, REVS is highly localized, affecting only a tiny subset of neurons.
Limitations and Future Work
While REVS is a significant advancement, challenges remain regarding scalability to millions of PII entries and the difficulty of unlearning numeric data (like SSNs) which appear in many contexts. Future work will also explore vocabulary-space editing in multilingual models and different tokenization schemes.
Summary updated