arXiv:2610.24508cs.LGOct 2026

Manuscript Offprint

arXiv:2610.24508

BEM: Learning Bregman Divergences for Concept Erasure in Flow Matching Models

Mohamed-Hicham Leghettas, Markus Püschel

ABSTRACT

Concept erasure removes harmful, private, or copyrighted concepts from text-to-image models while preserving their other abilities. Leading models such as FLUX and Stable Diffusion 3 are trained with flow matching, and erasure methods for them fine-tune the model toward a guided teacher's velocities under a Euclidean loss. Yet the squared distance is only one member of a larger family: Bregman divergences are exactly the losses under which flow matching recovers the correct velocity field, and each member shapes differently what is erased and what is preserved. We introduce BEM (Bregman erasure matching), which is, to our knowledge, the first to learn this divergence through bi-level optimization, so that the fine-tuned model forgets the concept on unseen prompts while its unrelated generations stay unchanged. In the experiments we target the suppression of nudity, violence, real identities, and copyrighted characters. Under the evaluation protocol of GEM, BEM removes more of the concept than GEM on most settings, cutting the unsafe rate on bloody gore from 53.9% to 14.4% and the FID on nudity from 8.64 to 6.64, while retention holds on some concepts and degrades on others.

Content warning: this paper contains generated images of graphic violence and censored nudity.

1 INTRODUCTION

Text-to-image models based on flow matching are deployed at scale, and with them comes the problem of removing what they should not produce. A released checkpoint may reproduce nudity and graphic violence, the likeness of real people, and the style of copyrighted characters, all of which the operator of a service may be required to remove (Schramowski et al., 2023; Huang et al., 2024). Retraining on a filtered corpus costs as much as the original training run. The concept is therefore removed after the fact, by fine-tuning the model against itself, and this is the setting we consider.

Erasure by velocity matching. Recent work shares one construction, built from two copies of the model. At each latent a frozen teacher supplies a velocity for a prompt naming the concept (uc)(u_c) and a velocity for an anchor prompt describing what should appear instead (ua)(u_a). A target velocity is formed by extrapolating away from the concept, uˉ=ua+s(ua−uc)\bar{u} = u_a + s(u_a - u_c), and a student (in practice a low-rank adapter) is fit to it on partially denoised latents. The construction goes back to ESD by Gandikota et al. (2023) and carries over to the rectified flow transformers that the current models use (Gao et al., 2025a; Fan et al., 2026; Grebe et al., 2026). These methods differ in how uˉ\bar{u} is built, i.e., in the anchor, the noise levels at which the regression is applied, and the reach s of the extrapolation, where s = 0 regresses onto the anchor itself, as CA (Kumari et al., 2023) does.

The unexamined component. Where these methods regress, they use the squared distance as error, which is oblivious to the direction in the velocity space. A concept, however, occupies a direction, namely the one along which the teacher separates the concept prompt from the anchor. Charging the orthogonal directions alike is what makes an erasure procedure trade the concept against everything else the model can draw, and the literature reports the consequence as a degradation of image fidelity (Gandikota et al., 2023; Grebe et al., 2026). Note that not every loss is admissible here. A regression of this form is a flow matching regression, and the losses under which such a regression recovers its target are known to be exactly the Bregman divergences (Theorem 2.1 below). Thus the squared distance is only one choice within a family (the choice generated by the quadratic potential φ(v)=∥v∥2\varphi(\boldsymbol{v}) = \|\boldsymbol{v}\|^2), and no erasure method varies this choice.

This work. In this paper we keep the unlearning procedure of Grebe et al. (2026) unchanged, i.e., its LoRA (Hu et al., 2022) adapter, its frozen teacher, its window of noise levels and its optimizer, except in two respects: we replace its hinge loss by a regression under a Bregman divergence, which is generated by a strictly convex potential φ\varphi, and we add meta steps that learn φ\varphi. Intuitively, this means that the unlearning procedure is told what a velocity error costs along the direction that carries the concept, separately from what it costs along the directions that carry everything else, instead of being told that errors in all directions cost the same. The potential is learned through bilevel optimization: the inner problem erases the concept under the Bregman divergence generated by the current potential, and the outer problem minimizes a scoring function of the resulting model, so that the potential is chosen by how well its divergence erases the concept and retains everything else rather than by how well the erasure fits.

Contributions. This paper takes a known characterization of the valid losses for flow matching, observes that all erasure methods that regress make a single choice within it, and learns this choice instead of fixing it:

• We observe that erasure by velocity matching inherits the valid family of flow matching (Theorem 2.1), so that the divergence is a free parameter of every such method. Prior work sets it to the squared distance and does not vary it.

• We propose BEM, which parameterizes the potential as a bounded, context-dependent metric with a separate curvature along the direction that separates the concept from the anchor, and learns it by bi-level optimization with an implicit-function-theorem hypergradient.

• On six concepts and two model families we compare against the protocol with its other components held fixed, so that a difference is attributable to the loss, not to the many other choices that an erasure procedure involves.

• BEM erases more of the concept than GEM (Grebe et al., 2026), whose loss it replaces, on every concept we evaluate. On nudity it is better on five of the six benchmarks, on bloody gore it leaves 14.4% unsafe against 53.9%, at a lower FID in both, on the four rights-protected concepts it leaves at most 1% against up to 10%, and on Stable Diffusion 3.5 it leaves 3% against 17%. Retention rises on two of these concepts, holds on one, and falls on two.