Abstract
Language models (LMs) may memorize personally identifiable information (PII) from training data, enabling adversaries to extract it during inference. Existing defense mechanisms such as differential privacy (DP) reduce this leakage, but incur large drops in utility. Based on a comprehensive study using circuit discovery to identify the computational circuits responsible PII leakage in LMs, we hypothesize that specific PII leakage circuits in LMs should be responsible for this behavior. Therefore, we propose PATCH (Privacy-Aware Targeted Circuit PatcHing), a novel approach that first identifies and subsequently directly edits PII circuits to reduce leakage. PATCH achieves better privacy-utility trade-off than existing defenses, e.g., reducing recall of PII leakage from LMs by up to 65%. Finally, PATCH can be combined with DP to reduce recall of residual leakage of an LM to as low as 0.01%. Our analysis shows that PII leakage circuits persist even after the application of existing defense mechanisms. In contrast, PATCH can effectively mitigate their impact.
Introduction
Language models (LMs) are notorious for "memorizing" their training data. While this helps them learn language patterns, it also means they might accidentally reveal Personally Identifiable Information (PII)—such as names, addresses, or legal details—when prompted by an adversary. Current defenses, like Differential Privacy (DP) or data scrubbing, often come with significant costs: DP typically causes a massive drop in model utility (making the model less coherent), while scrubbing is computationally expensive and often fails to prevent the model from inferring sensitive attributes.
Researchers have developed PATCH (Privacy-Aware Targeted Circuit PatcHing), a surgical approach to stopping LMs from leaking PII. By using mechanistic interpretability to identify the specific "computational circuits" responsible for memorizing PII, PATCH can "edit out" these leaks with far less damage to the model's overall performance than traditional methods.
The PATCH Framework
The PATCH method operates on the insight that PII leakage is localized within identifiable internal structures rather than being diffused across the entire model. The framework follows a six-step process:
- Prompt Generation: Creating pairs of "clean" prompts (with real PII) and "corrupted" prompts (with fake data).
- Circuit Discovery: Using Edge Attribution Patching with Integrated Gradients (EAP-IG) to trace information flow and identify "edges" (connections between attention heads) sensitive to PII tokens.
- Thresholding: Identifying the top 1% to 5% of edges contributing most to PII prediction.
- Edge Selection: Isolating these high-importance pathways.
- Identifying Shared Edges: Focusing on the intersection of edges shared across different PII types (e.g., names and locations) to find the core leakage machinery.
- Patching: Ablating these edges by either zeroing their weights or replacing them with mean values.
Experimental Results
The study utilized the European Court of Human Rights (ECHR) dataset, focusing on three PII categories: Names, Locations, and Race. The results demonstrate that PATCH offers a superior trade-off between privacy and utility compared to existing baselines.
Key Findings
- Superior Trade-offs: PATCH-Baseline reduced PII extraction precision by 40% to 90% while keeping model perplexity within 1 point of the baseline.
- Massive Recall Reduction: PATCH reduced the recall of PII leakage by up to 65% in some tests.
- Synergy with DP: When combined with Differential Privacy (PATCH-DP), the system achieved a PII recall as low as 0.01%, effectively silencing leaks while maintaining better utility than DP alone. This is particularly important as the authors found that leaky circuits often persist (though dampened) even in models trained with DP.
- Architectural Consistency: While specific leaky heads vary between models like GPT-2 and Llama-3, the existence of systematic circuits is a consistent phenomenon across different architectures.
Limitations and Future Work
While promising, PATCH faces challenges in scalability; circuit discovery is computationally intensive, making it difficult to apply to "frontier" models with hundreds of billions of parameters. Additionally, the study focused on three specific PII types; future research is required to determine if more abstract sensitive information follows similar circuit logic. Finally, unlike DP, PATCH provides empirical protection rather than formal mathematical guarantees, suggesting that the most robust path forward involves using both techniques in tandem.
Summary updated