Can Agents Truly Forget? Explore Machine Unlearning for LLM Agents
Authors: Junkai Lin, Ge Xu, Zheng Xu, Junkai Chen, Xiangyuan Lan
Organizations: Institute of Automation, Chinese Academy of Sciences · The Chinese University of Hong Kong · Nanyang Technological University · University of Jinan · Pengcheng Laboratory
Large language model (LLM) agents have shown strong capabilities in interactive problem solving, tool use, and long-horizon task execution. However, they may also acquire sensitive or private knowledge during training and expose it during deployment. Retraining a model from scratch to remove such knowledge is prohibitively costly, making machine unlearning a more practical approach. Machine unlearning aims to remove targeted undesirable knowledge from trained models without retraining from scratch while preserving general utility. When language models are deployed as agents, parameter-level unlearning becomes insufficient: forgotten information may still persist in memory artifacts or be reacquired via tool calls. In this paper, we formulate the problem of agent unlearning as removing private information from an LLM-based agent across three information channels: parametric knowledge, persistent memory, and tool-call acquisition. To study this problem, we introduce we introduce Agent Unlearning Benchmark (AUBench), a controlled benchmark that extends the fictitious-author setting of TOFU into an agent environment with persistent memory, an offline web snapshot, tool-accessible documents, and provenance-tracked interaction trajectories. By evaluating existing parameter-level and memory-level unlearning methods in this setting, AUBench reveals the gap between model-level forgetting and system-level agent unlearning, and provides a foundation for developing unlearning methods that operate across the full lifecycle of LLM agents.
Figures & tables
Figure 1: The composite-system unlearning setting. An LLM agent can answer through three routes—a parametric model, an external memory store (Mem0), and Web Search over local author profiles (built on Ollama). Before unlearning (left), only the parametric route holds the target fact; after unlearning with GD, KL, or NPO (right), that fact is replaced by a fabricated answer rather than a refusal, while the memory and tool routes never contained it. Results are reported on forget05 (200 examples) and retain95 (3800 examples) for Llama-3.1-8B and Qwen3-8B; the Vanilla Base model is evaluated in the parametric condition only.
Method
Llama-3.1-8B
Qwen3-8B
Forget Set
Retain Set
Forget Set
Retain Set
Para.
Mem.
Tool
Final
Para.
Mem.
Tool
Final
Para.
Mem.
Tool
Final
Para.
Mem.
Tool
Final
Vanilla
Base
49.8
–
–
–
50.2
–
–
–
43.6
–
–
–
43.4
–
–
–
Agent System Unlearning
Model-Level Unlearning — Para.
Table 1: Main forget-set and retain-set results on TOFU for Llama-3.1-8B and Qwen3-8B. The forget set is forget05 (200 evaluation examples) and the retain set is retain95 (3800 evaluation examples). All reported numbers are token-level F1 scores (%).
Method
Llama-3.1-8B
Qwen3-8B
Tool ( para_tools )
Final ( total )
Tool ( para_tools )
Final ( total )
Call
Empty
Ref.
F1
Call
Empty
Ref.
F1
Call
Empty
Ref.
F1
Call
Empty
Ref.
F1
Forget set
GD
96.0
0.0
0.0
16.4
86.0
0.5
0.0
18.8
78.0
58.0
0.0
4.1
25.5
13.0
9.5
14.5
KL
96.0
0.0
0.0
16.9
88.0
1.0
0.0
19.1
60.5
24.5
0.0
14.9
0.5
0.5
7.5
36.9
NPO
41.5
0.0
0.0
14.5
53.5
0.0
0.0
15.8
73.5
29.0
0.0
10.7
43.0
30.0
1.0
18.3
Table 2: Behaviour of the agentic conditions (%). Call is the share of examples in which the tool is actually invoked, Empty the share of empty predictions, Ref. the share of refusal-like outputs (“no information”, “cannot provide”).
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Llama-3.1-8B
Qwen3-8B
Δ Forget
Δ Retain
Δ Forget
Δ Retain
Vanilla Base — absolute F1, Forget / Retain
Base
49.8 / 50.2
43.6 / 43.4
GD
−6.3[−7.8,−4.7]
−1.5[−1.8,−1.1]
−22.7[−24.6,−20.8]
−11.3[−11.8,−10.9]
KL
−2.0[−3.4,−0.5]
+0.3[0.0,0.6]
−26.8[−29.0,−24.8]
−24.3[−24.7,−23.8]
NPO
−22.9[−25.2,−20.6]
−15.8[−16.3,−15.2]
−21.7[−24.2,−19.2]
−18.7[−19.3,−18.1]
Appendix
Table 3: Forget–retain trade-off of parametric unlearning baselines relative to Vanilla Base. The Base row reports absolute token-level F1 scores (%). Δ Forget and Δ Retain report mean F1 differences between each unlearned model and its corresponding Base model, in percentage points; negative values indicate lower F1. Differences are computed over matched evaluation examples (200 for forget05 and 3800 for retain95 ). Brackets show 95% paired bootstrap confidence intervals estimated from 2000 resamples.
Figure 2: Case study of Qwen3-8B after NPO unlearning on TOFU forget05 (example index 113). Para., Mem., Tool, and Final denote the parametric model alone, with memory, with tools, and with both memory and tools, respectively. All four conditions are evaluated against the same reference answer. Green text highlights content consistent with the reference, while red text highlights unsupported or misattributed content. Token-level F1 scores are shown for each condition.
Question type
n
Llama-3.1-8B
Qwen3-8B
Base
GD
KL
NPO
Base
GD
KL
NPO
Name
10
59.1
51.4
60.0
37.3
51.0
29.9
23.9
1.7
Awards
21
57.0
48.2
51.5
23.7
45.2
19.1
21.7
20.5
Identity
10
49.5
46.0
50.2
29.5
47.4
16.8
16.2
22.8
Parents/Family
20
50.8
42.1
46.6
18.8
46.1
27.8
17.3
31.0
Birth/Origin
19
48.8
46.4
48.5
24.7
42.0
21.8
10.6
28.5
Appendix
Table 4: Forget-set token-level F1 (%) by question type in the parametric condition ( para ) on the 200 questions of forget05 , which cover ten target authors (20 questions each). Types are assigned by keyword rules on the question text and partition the set. Name asks for the author’s full name, Awards for prizes and honours, Identity for LGBTQ+ identity and gender, Parents/Family for the parents’ professions, Birth/Origin for birthplace, upbringing and heritage, Genre for the author’s genre, Style/Themes for style, themes and critical reception, Books/Works for titles, summaries and recommendations, and Career/Influence for career, education, motivations and impact. Types with small n have correspondingly wide confidence intervals; the table is descriptive and no significance claim is made.
Machine unlearning removes the influence of selected data or concepts from trained models while preserving useful behavior and avoiding full retraining.
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.
Unlearning benchmarks such as TOFU and MUSE certify forgetting by reading the model's final answer, where a model that refuses to answer already counts as having forgotten. We show that this model-level certificate does not transfer once the model is deployed as an agent. We introduce K-Bench, a benchmark that scores LLM unlearning under agentic deployment. K-Bench inspects all six channels a ReAct agent exposes, including its chain-of-thought (CoT), tool calls and tool observations, and elicited summary. A query counts as leaked if the secret appears in any of them. Each experiment places the secret in exactly one of the agent's three sources (the weights, the prompt, or the retrieval store). The K-Score is computed separately for each source and credits forgetting only when the agent remains usable. Clearing the answer channel does not make the secret unrecoverable. On structured retrieval, the secret stays verbatim in the tool-observation channel and the aggregate leak rate is unchanged. When the secret lives in the prompt or the retrieval store, TOFU and MUSE report no leakage, while the deployed agent still leaks it on 22--86% of queries. When the secret is in the weights, none of the twenty evaluated published methods demonstrably removes it, and only an input-corruption intervention reaches selective forgetting under the evaluated observer. The top-ranked method changes across base models. A refusal-tuning method resists the evaluated extraction without verified knowledge removal.
Guangsheng Yu, Yanna Jiang, Qin Wang +2
University of Technology Sydney, Australia · CSIRO, Australia
Large language models (LLMs) are increasingly deployed as tool-augmented agents, where responses can depend on tool calls and external observations rather than model parameters alone. This creates an evaluation mismatch for LLM unlearning: previous unlearning methods may suppress direct parametric recall, but an agent can still recover the same forget target through tools such as web search, retrieval, or database lookup. We identify this failure mode as tool-mediated recovery and study agentic tool unlearning, which aims to reduce both parametric recall and tool-mediated recovery while preserving normal tool use for retained knowledge. To address this challenge, we propose Agentic Tool Unlearning (ATU), a two-stage framework. The first stage applies parametric knowledge unlearning to suppress direct recall, while the second stage performs trajectory-level reinforcement learning in simulated tool-augmented environments to penalize target-seeking tool behavior and final-answer leakage. Experiments on RWKU and MUSE across different LLM architectures show that ATU achieves a better balance between target forgetting and retained utility, making unlearning more robust under tool-augmented agent deployment.
Baicheng Chen, Zheyuan Liu, Jingyu Zhang +4
The Chinese University of Hong Kong, Shenzhen · University of Notre Dame · Johns Hopkins University +2