Secure Forgetting: A Framework for Privacy-Driven Unlearning in Large Language Model (LLM)-Based Agents
Abstract
Large language model (LLM)-based agents have recently gained considerable attention due to the powerful reasoning capabilities of LLMs. Existing research predominantly focuses on enhancing the task performance of these agents in diverse scenarios. However, as LLM-based agents become increasingly integrated into real-world applications, significant concerns emerge regarding their accumulation of sensitive or outdated knowledge. Addressing these concerns requires the development of mechanisms that allow agents to selectively forget previously learned knowledge, giving rise to a new term LLM-based agent unlearning. This paper initiates research on unlearning in LLM-based agents. Specifically, we propose a novel and comprehensive framework that categorizes unlearning scenarios into three contexts: state unlearning (forgetting specific states or items), trajectory unlearning (forgetting sequences of actions) and environment unlearning (forgetting entire environments or categories of tasks). Within this framework, we introduce a natural language-based unlearning method that trains a conversion model to transform high-level unlearning requests into actionable unlearning prompts, guiding agents through a controlled forgetting process. Moreover, to evaluate the robustness of the proposed framework, we introduce an unlearning inference adversary capable of crafting prompts, querying agents, and observing their behaviors in an attempt to infer the forgotten knowledge. Experimental results show that our approach effectively enables agents to forget targeted knowledge while preserving performance on untargeted tasks, and prevents the adversary from inferring the forgotten knowledge.
Figures & tables
| Notations | Description |
| A state set, | |
| An action set, | |
| A transition function, | |
| A reward function, | |
| A learning environment/task, | |
| A trajectory consisting of state-action pairs: |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Steps Before unlearn | Steps After unlearn (Target environ.) | Steps After unlearn (Other environ.) | |
| NL (GPT) | |||
| NL (Claude) | |||
| NL (Llama) | |||
| Code (GPT) | |||
| Code (Claude) | |||
| Code (Llama) |
| Steps Before unlearn | Steps After unlearn (Target environ.) | Steps After unlearn (Other environ.) | |
| NL (GPT) | |||
| NL (Claude) | |||
| NL (Llama) | |||
| Code (GPT) | |||
| Code (Claude) | |||
| Code (Llama) |
| Steps Before unlearn | Steps After unlearn (Target environ.) | Steps After unlearn (Other environ.) | |
| NL (GPT) | |||
| NL (Claude) | |||
| NL (Llama) | |||
| Code (GPT) | |||
| Code (Claude) | |||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn (Other quest.) | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn (Other quest.) | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn (Other probl.) | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn (Other probl.) | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy (With/Without ) | Unlearn@1 (With/Without ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without ) | Unlearn@1 (With/Without ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without ) | Unlearn@1 (With/Without ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without ) | Unlearn@1 (With/Without ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without Fine-tune ) | Unlearn@1 (With/Without Fine-tune ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without Fine-tune ) | Unlearn@1 (With/Without Fine-tune ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without Fine-tune ) | Unlearn@1 (With/Without Fine-tune ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy (With/Without Fine-tune ) | Unlearn@1 (With/Without Fine-tune ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy ( ) | Unlearn@1 ( ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy ( ) | Unlearn@1 ( ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy ( ) | Unlearn@1 ( ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Unlearn efficacy ( ) | Unlearn@1 ( ) | |
| NL (GPT) | ||
| NL (Claude) | ||
| NL (Llama) |
| Traverse the unlearned state (Pre-unlearn/Unlearn/Unseen) | |
| NL (GPT) | |
| NL (Claude) | |
| NL (Llama) | |
| Code (GPT) | |
| Code (Claude) | |
| Code (Llama) |
| Traverse the unlearned trajectory (Pre-unlearn/Unlearn/Unseen) | |
| NL (GPT) | |
| NL (Claude) | |
| NL (Llama) | |
| Code (GPT) | |
| Code (Claude) | |
| Code (Llama) |
| Successful reconstruction rate of the unlearned environment (Pre-unlearn/Unlearng/Unseen) | |
| NL (GPT) | |
| NL (Claude) | |
| NL (Llama) | |
| Code (GPT) | |
| Code (Claude) | |
| Code (Llama) |
| State Unlearning | |
| Unlearning Request | You are an expert in designing prompts for household AI agents in ALFWorld environment. Your task is to put a cool mug in cabinet…. How should we modify the agent’s prompt to make it completely avoid accessing ‘cabinet 6’ during task execution? Please provide your response starting with “Unlearning Instruction:” followed by a detailed explanation. |
| Unlearning Prompt | Unlearning Instruction: Remove ‘cabinet 6’ from the list of receptacles in the prompt. …, the AI agent will no longer consider placing the cool mug in that specific cabinet during task execution. This modification ensures that the agent completely avoids accessing ‘cabinet 6’ as it carries out the prompt, … |
| Trajectory Unlearning | |
| Unlearning Request | …Task: Your task is to put a cool mug in cabinet. Available Options: [‘cabinet 6’, ‘cabinet 5’, …, ‘stoveburner 1’, ‘toaster 1’]. Goal: Avoid using that route by reversing the agent’s search efficiency. Please provide your response starting with “Unlearning Instruction:” followed by a strategy description. |
| Unlearning Prompt | Unlearning Instruction: To reverse the agent’s search efficiency, instruct the agent to prioritize further options first, rather than nearest ones. Specifically, the agent should begin its search with the farthest options (like ’garbagecan 1’ or ’fridge 1’) before exploring the more relevant cabinets… |
| Environment Unlearning | |
| Unlearn efficacy | Steps Before unlearn | Steps After unlearn (Target envir.) | Steps After unlearn (Other envir.) | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Steps Before unlearn | Steps After unlearn (Target envir.) | Steps After unlearn (Other envir.) | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Steps Before unlearn | Steps After unlearn (Target envir.) | Steps After unlearn (Other envir.) | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | ||||
| NL (Claude) | ||||
| NL (Llama) | ||||
| Code (GPT) | ||||
| Code (Claude) | ||||
| Code (Llama) |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
| Unlearn efficacy | Unlearn@1 | Success rate Before unlearn | Success rate After unlearn | |
| NL (GPT) | / | / | / | |
| NL (Claude) | / | / | / | |
| NL (Llama) | / | / | / | |
| Code (GPT) | / | / | / | |
| Code (Claude) | / | / | / | |
| Code (Llama) | / | / | / |
LLM Unlearning
Large language model unlearning studies how to remove specified knowledge or behaviors while preserving a model’s unrelated capabilities.
See all 190 papers