Table of Contents
Fetching ...

When Machine Unlearning Meets Retrieval-Augmented Generation (RAG): Keep Secret or Forget Knowledge?

Shang Wang, Tianqing Zhu, Dayong Ye, Wanlei Zhou

TL;DR

This work proposes a lightweight behavioral unlearning framework based on Retrieval-Augmented Generation (RAG) technology that is particularly effective for closed-source LLMs, where existing unlearning methods often fail.

Abstract

The deployment of large language models (LLMs) like ChatGPT and Gemini has shown their powerful natural language generation capabilities. However, these models can inadvertently learn and retain sensitive information and harmful content during training, raising significant ethical and legal concerns. To address these issues, machine unlearning has been introduced as a potential solution. While existing unlearning methods take into account the specific characteristics of LLMs, they often suffer from high computational demands, limited applicability, or the risk of catastrophic forgetting. To address these limitations, we propose a lightweight behavioral unlearning framework based on Retrieval-Augmented Generation (RAG) technology. By modifying the external knowledge base of RAG, we simulate the effects of forgetting without directly interacting with the unlearned LLM. We approach the construction of unlearned knowledge as a constrained optimization problem, deriving two key components that underpin the effectiveness of RAG-based unlearning. This RAG-based approach is particularly effective for closed-source LLMs, where existing unlearning methods often fail. We evaluate our framework through extensive experiments on both open-source and closed-source models, including ChatGPT, Gemini, Llama-2-7b-chat, and PaLM 2. The results demonstrate that our approach meets five key unlearning criteria: effectiveness, universality, harmlessness, simplicity, and robustness. Meanwhile, this approach can extend to multimodal large language models and LLM-based agents.

When Machine Unlearning Meets Retrieval-Augmented Generation (RAG): Keep Secret or Forget Knowledge?

TL;DR

This work proposes a lightweight behavioral unlearning framework based on Retrieval-Augmented Generation (RAG) technology that is particularly effective for closed-source LLMs, where existing unlearning methods often fail.

Abstract

The deployment of large language models (LLMs) like ChatGPT and Gemini has shown their powerful natural language generation capabilities. However, these models can inadvertently learn and retain sensitive information and harmful content during training, raising significant ethical and legal concerns. To address these issues, machine unlearning has been introduced as a potential solution. While existing unlearning methods take into account the specific characteristics of LLMs, they often suffer from high computational demands, limited applicability, or the risk of catastrophic forgetting. To address these limitations, we propose a lightweight behavioral unlearning framework based on Retrieval-Augmented Generation (RAG) technology. By modifying the external knowledge base of RAG, we simulate the effects of forgetting without directly interacting with the unlearned LLM. We approach the construction of unlearned knowledge as a constrained optimization problem, deriving two key components that underpin the effectiveness of RAG-based unlearning. This RAG-based approach is particularly effective for closed-source LLMs, where existing unlearning methods often fail. We evaluate our framework through extensive experiments on both open-source and closed-source models, including ChatGPT, Gemini, Llama-2-7b-chat, and PaLM 2. The results demonstrate that our approach meets five key unlearning criteria: effectiveness, universality, harmlessness, simplicity, and robustness. Meanwhile, this approach can extend to multimodal large language models and LLM-based agents.

Paper Structure

This paper contains 38 sections, 1 equation, 9 figures, 13 tables, 1 algorithm.

Figures (9)

  • Figure 1: The intuition of RAG-based unlearning. This figure illustrates knowledge changes in three different scenarios. Figure (a) shows the main purpose of RAG, which is to correct misinformation knowledge in the LLM. Figure (b) replaces the misinformation knowledge with the knowledge to be forgotten. In Figure (c), it is an ideal unlearning process.
  • Figure 2: The overview of RAG technology. The left figure gives the workflow of a regular RAG framework. The right figure details the workflow of RAG-based unlearning.
  • Figure 3: The two objectives of LLM unlearning, including the sample and concept.
  • Figure 4: The prompt template of RAG, where 'knowledge' is the related content of the original prompt.
  • Figure 5: The 'UnUnlearning' phenomenon that the in-context capability of LLMs may fail LLM unlearning schemes.
  • ...and 4 more figures

Theorems & Definitions (3)

  • Definition 1: Machine Unlearning
  • Definition 2: Sample Unlearning
  • Definition 3: Concept Unlearning