Contrastive Representation Shaping for LLM Unlearning
Haoran Tang, Rajiv Khanna
NeurIPS page · Open on the map
Category: LLM Reasoning, Memory & RAG › Machine Unlearning · Type: new method · Keywords: LLM unlearning, contrastive representation regularizer, forget-retain entanglement, representation shaping, privacy preservation
Areas: Continual Learning & Adaptation › Catastrophic Forgetting and Unlearning › Model Unlearning
Summary
CLReg is a contrastive representation regularizer that pushes forget features away from retain features to reduce entanglement and improve LLM unlearning.
Explained to a 5-year-old
When we teach a big computer brain new things, we sometimes want to forget some old tricks. The old tricks can get mixed up with the new ones, making them hard to remove. This paper finds a way to separate the old tricks from the new ones, like pulling apart tangled toys. By doing this, the computer brain keeps its good knowledge and forgets the bad stuff better. This helps make the computer safer and more useful.
Explained to a 5-year-old, longer
Big computer brains, like the ones that write stories, can learn many facts and skills. Sometimes we need them to forget certain facts, for example to protect someone's privacy. The usual way to forget is to try to stop the brain from saying those facts, but the memory can still stay hidden inside. This hidden memory can get mixed up with the things the brain still knows, making it tricky to be sure it's gone. The new idea in this paper is to look at the brain's internal memories and pull the unwanted ones away from the wanted ones. Imagine two groups of toys, one group of red blocks and one group of blue blocks, and we want to keep the blue blocks separate. The method finds which brain parts represent the forgotten facts and moves them far from the parts that represent the kept facts. By doing this separation, the brain can keep its good knowledge unchanged while the bad facts become less tangled. The paper also shows a simple math proof that this separation actually reduces how mixed up the memories are. They test this idea on several tests that check how well a brain forgets, and it works better than the old ways. The improvement works for different sizes of brain models, so it's useful for many kinds of computer brains. Overall, this makes it safer to use big computer brains because we can more reliably erase what we don't want.
For a technical reader
The paper introduces CLReg, a contrastive regularizer that operates on the hidden representations of a language model to separate features associated with forgotten content from those of retained content. By pushing these feature vectors apart in the embedding space, CLReg reduces interference between the two sets of knowledge while preserving the overall scale and shape of the retained representations. A simple analytical argument shows that this separation decreases a proxy for entanglement, providing a theoretical justification for the empirical gains. Experiments on standard unlearning benchmarks demonstrate that adding CLReg to existing unlearning pipelines improves removal of unwanted knowledge across models of varying sizes without introducing extra privacy risks. The approach is lightweight and can be integrated as a drop-in component, making it practical for developers who need to implement robust LLM unlearning.
Problem
Existing LLM unlearning methods often suppress forgotten content but leave it entangled with retained knowledge in the model's representations, limiting complete removal.
Method
The approach uses a contrastive regularizer that identifies features associated with forgotten concepts and pushes them away from features of retained concepts, while preserving the scale and shape of retained representations. It includes a simple analysis showing reduction of an entanglement proxy in the embedding space. The method is applied to existing unlearning pipelines to enhance their performance.
Results
The approach reduces forget-retain representation entanglement across benchmarks and model sizes, improving existing unlearning methods without introducing privacy risks.
Contributions
It introduces a contrastive representation regularizer that disentangles forget and retain features, provides an analysis linking it to reduced entanglement, and demonstrates its effectiveness across multiple benchmarks and model sizes.
Practical relevance
It enables more reliable removal of unwanted knowledge from LLMs, supporting privacy and safety without additional risk.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction