Abstract
As Large Language Models (LLMs) are increasingly trained on vast, uncurated datasets, they inevitably memorize sensitive, copyrighted, or hazardous information. Traditional unlearning methods, which typically involve fine-tuning model weights, suffer from high computational costs and the risk of "catastrophic forgetting," where general utility is degraded. This paper discusses ECO Prompts (Embedding-COrrupted Prompts), a lightweight, inference-time framework that achieves high-precision unlearning without modifying model parameters. By utilizing a prompt classifier and strategically corrupting input embeddings, ECO Prompts effectively induces an "unlearned state," maintaining model performance across 100 different architectures, including models up to 236B parameters.
1. Introduction
The challenge of "unlearning" in LLMs is twofold. First, knowledge is deeply entangled; attempting to remove a specific concept (e.g., a copyrighted novel) often inadvertently damages the model's broader linguistic or thematic capabilities. Second, the sheer scale of modern models makes weight-based updates prohibitively expensive for most practitioners and impossible for users of closed-source "Model-as-a-Service" platforms.
ECO Prompts shifts the paradigm from surgical weight modification to dynamic input intervention. Instead of altering the model's internal "brain," the framework identifies sensitive queries at the gate and modifies the mathematical representation of the input to prevent the model from accessing specific factual associations.
2. Methodology
The ECO Prompts framework operates through a dual-stage process during the inference phase:
2.1 The Gatekeeper: Prompt Classification
When a user submits a query, it is first processed by a small, efficient classifier (e.g., RoBERTa or a 1B-parameter Llama model). This classifier is trained to detect whether the prompt falls into a predefined "forget" category—such as copyrighted material or hazardous biological knowledge.
2.2 The Saboteur: Embedding Corruption
If a prompt is flagged, the system does not pass the raw embeddings to the LLM. Instead, it applies a learned corruption. The researchers utilized zeroth-order optimization, a black-box tuning method, to determine the optimal corruption parameters. By observing the model's output and adjusting a corruption factor ($\sigma$), the system steers the LLM's response to match that of a "retained model" (a theoretical model never exposed to the forbidden data) or a neutral surrogate response like "I don't know."
Notably, the researchers discovered that corrupting only the first dimension of a token's embedding was sufficient to effectively block access to specific knowledge while preserving the grammatical and structural integrity of the response.
3. Experimental Evaluation
To validate the efficacy and precision of ECO Prompts, the framework was tested against several rigorous benchmarks:
- TOFU (Unlearning Fictitious Authors): Used to measure "forget quality" by comparing model outputs to a gold-standard model that never saw the target data.
- WMDP (Weaponized AI Model Defense Platform): Evaluated the suppression of dangerous knowledge in biology, chemistry, and cybersecurity.
- Copyright & Specificity: Tested on the full text of Harry Potter and the Sorcerer’s Stone and recent BBC News articles to ensure the model could no longer recite protected content.
- General Utility: A suite of 11 standard NLP benchmarks was used to monitor for any degradation in general intelligence.
4. Key Results
4.1 Precision and Utility
In the TOFU author unlearning task, ECO Prompts achieved a forget quality (p-value) near 1.0, indicating that its outputs were statistically indistinguishable from a model that had never been trained on the data. Crucially, this was achieved with zero impact on the model's general utility; the model remained 100% as effective on unrelated tasks as the original version.
4.2 Suppression of Hazardous Knowledge
On the WMDP benchmark, ECO Prompts successfully reduced the model's accuracy on dangerous topics to approximately 25% (equivalent to random guessing), while maintaining perfect accuracy on general MMLU (Massive Multitask Language Understanding) subsets.
4.3 Universal Scalability
Because the method is model-agnostic and operates at the input level, it scales seamlessly. The researchers successfully applied ECO Prompts to 100 different LLMs, including massive architectures like DeepSeek-V2 (236B) and Mixtral-8x22B. The computational overhead is negligible, adding less than 21 milliseconds of latency per prompt.
5. Discussion and Limitations
While ECO Prompts offers a highly efficient alternative to fine-tuning, it has specific requirements and vulnerabilities. The method requires access to the model's embedding layer, which is standard for open-weight models but may require specific API support from closed-source providers. Furthermore, while the framework is robust against standard user interactions, a "white-box" adversary who can bypass the prompt classifier entirely could still access the original knowledge stored in the weights. Future research will focus on increasing the adversarial robustness of the prompt classifiers to prevent "jailbreaking" attempts.
6. Conclusion
ECO Prompts demonstrates that unlearning in LLMs can be treated as a dynamic state rather than a permanent weight change. By manipulating embeddings at inference time, the framework provides a scalable, precise, and computationally inexpensive solution for managing sensitive information in large-scale AI systems.
Summary updated