Table of Contents
Fetching ...

Differential Vector Erasure: Unified Training-Free Concept Erasure for Flow Matching Models

Zhiqi Zhang, Xinhao Zhong, Yi Sun, Shuoyang Sun, Bin Chen, Shu-Tao Xia, Xuan Wang

TL;DR

This work tackles safe deployment of flow-matching text-to-image models by enabling training-free erasure of undesirable concepts. It introduces Differential Vector Erasure (DVE), which models concepts as directional components in the velocity field and uses a differential vector field combined with projection-based selective correction to erase target concepts while preserving irrelevant content. The method supports multiple concepts and integrates with FlowEdit for image editing, while employing practical cost-reduction strategies like preprocessed vectors and early-stage corrections. Empirical results on FLUX demonstrate state-of-the-art erasure performance across NSFW, object, and artistic style tasks, with strong preservation of image quality and alignment to prompts. The approach offers a plug-and-play, deployment-friendly safety mechanism for flow-based generative systems.

Abstract

Text-to-image diffusion models have demonstrated remarkable capabilities in generating high-quality images, yet their tendency to reproduce undesirable concepts, such as NSFW content, copyrighted styles, or specific objects, poses growing concerns for safe and controllable deployment. While existing concept erasure approaches primarily focus on DDPM-based diffusion models and rely on costly fine-tuning, the recent emergence of flow matching models introduces a fundamentally different generative paradigm for which prior methods are not directly applicable. In this paper, we propose Differential Vector Erasure (DVE), a training-free concept erasure method specifically designed for flow matching models. Our key insight is that semantic concepts are implicitly encoded in the directional structure of the velocity field governing the generative flow. Leveraging this observation, we construct a differential vector field that characterizes the directional discrepancy between a target concept and a carefully chosen anchor concept. During inference, DVE selectively removes concept-specific components by projecting the velocity field onto the differential direction, enabling precise concept suppression without affecting irrelevant semantics. Extensive experiments on FLUX demonstrate that DVE consistently outperforms existing baselines on a wide range of concept erasure tasks, including NSFW suppression, artistic style removal, and object erasure, while preserving image quality and diversity.

Differential Vector Erasure: Unified Training-Free Concept Erasure for Flow Matching Models

TL;DR

This work tackles safe deployment of flow-matching text-to-image models by enabling training-free erasure of undesirable concepts. It introduces Differential Vector Erasure (DVE), which models concepts as directional components in the velocity field and uses a differential vector field combined with projection-based selective correction to erase target concepts while preserving irrelevant content. The method supports multiple concepts and integrates with FlowEdit for image editing, while employing practical cost-reduction strategies like preprocessed vectors and early-stage corrections. Empirical results on FLUX demonstrate state-of-the-art erasure performance across NSFW, object, and artistic style tasks, with strong preservation of image quality and alignment to prompts. The approach offers a plug-and-play, deployment-friendly safety mechanism for flow-based generative systems.

Abstract

Text-to-image diffusion models have demonstrated remarkable capabilities in generating high-quality images, yet their tendency to reproduce undesirable concepts, such as NSFW content, copyrighted styles, or specific objects, poses growing concerns for safe and controllable deployment. While existing concept erasure approaches primarily focus on DDPM-based diffusion models and rely on costly fine-tuning, the recent emergence of flow matching models introduces a fundamentally different generative paradigm for which prior methods are not directly applicable. In this paper, we propose Differential Vector Erasure (DVE), a training-free concept erasure method specifically designed for flow matching models. Our key insight is that semantic concepts are implicitly encoded in the directional structure of the velocity field governing the generative flow. Leveraging this observation, we construct a differential vector field that characterizes the directional discrepancy between a target concept and a carefully chosen anchor concept. During inference, DVE selectively removes concept-specific components by projecting the velocity field onto the differential direction, enabling precise concept suppression without affecting irrelevant semantics. Extensive experiments on FLUX demonstrate that DVE consistently outperforms existing baselines on a wide range of concept erasure tasks, including NSFW suppression, artistic style removal, and object erasure, while preserving image quality and diversity.
Paper Structure (60 sections, 18 equations, 9 figures, 11 tables, 3 algorithms)

This paper contains 60 sections, 18 equations, 9 figures, 11 tables, 3 algorithms.

Figures (9)

  • Figure 1: DVE enables training-free concept erasure for flow matching models. Our method selectively removes target concepts while preserving irrelevant content, applicable to both generation and FlowEdit-based editing tasks.
  • Figure 2: Overview of DVE. The left side shows the framework of our method. Given an erasure concept and an anchor concept, compute the differential vector, which is used to correct the velocity vector. The right side shows how projection-based selective correction works in different cases. It shows the situation where $\gamma$ is 1 and $\tau$ is 0.
  • Figure 3: Generated images from DVE and other baselines which are migrated to Flux. Our method effectively removes various types of concepts while preserving irrelevant concepts and visual quality. The concepts marked in red are the ones to be erased. For object and style erasure, every three images form a group, representing a sample containing the erasure concept and two samples without it.
  • Figure 4: PCA visualization of ODE trajectories. Four trajectories are generated from the same initial noise with prompts containing "dressed" or "naked", with/without DVE. Without DVE, the "naked" trajectory (dashed black) diverges toward NSFW content. With DVE, differential vectors (purple) redirect it toward the "dressed" trajectory, while "dressed" trajectories remain nearly unaffected. Insets show zoomed views of the terminal region.
  • Figure 5: Concept Erasure for Image Editing. Our method rejects the erasure concepts without affecting the editing of irrelevant concepts and image quality.
  • ...and 4 more figures