Unified Concept Editing in Diffusion Models

Rohit Gandikota, Hadas Orgad, Yonatan Belinkov, Joanna Materzynska, David Bau

Unified Concept Editing (UCE) offers a robust, closed-form solution for refining text-to-image diffusion models. As these models scale, they often inherit undesirable traits from their training data, including copyright infringement via style mimicry, social biases in professional representations, and the generation of unsafe content. UCE addresses these challenges by enabling precise, efficient modifications to the model's internal weights.

UCE addresses three primary concerns: artistic style mimicry, social bias in professions, and unsafe content generation.

The Problem: Data "Baggage" in Diffusion Models

Modern text-to-image models like Stable Diffusion are trained on massive, uncurated datasets. This leads to three major deployment hurdles:

  1. Copyright and Style Mimicry: Models can replicate the distinct aesthetic of living artists without authorization.
  2. Social Bias: Prompts for neutral terms like "doctor" or "CEO" often yield images skewed toward specific demographics, reinforcing stereotypes.
  3. Unsafe Content: The potential for generating NSFW or violent imagery remains a significant safety risk.

Existing solutions often involve slow fine-tuning or specialized modules that can degrade overall image quality or fail to scale when multiple concepts need editing simultaneously.

Methods: The UCE Framework

UCE treats model editing as a constrained optimization problem, focusing specifically on the cross-attention mechanism's linear projection layers ($W_k$ and $W_v$). These layers serve as the critical interface where textual prompts are mapped to visual features.

UCE utilizes a closed-form mathematical solution to update model weights in a single step, avoiding iterative gradient descent.

Unlike traditional methods that rely on iterative gradient descent, UCE employs a closed-form solution. This allows for near-instantaneous updates—typically under a minute—to map "source" concepts to safer or more neutral "target" concepts.

Key Innovations:

  • The "Preserve" Set: UCE allows editors to define a set of concepts that should remain unchanged. This prevents "concept drift," ensuring that erasing a specific artist doesn't accidentally ruin the model's ability to draw unrelated subjects.
  • Iterative Debiasing: For social bias, UCE uses an algorithm that samples outputs and iteratively adjusts weights until the distribution reaches a desired target (e.g., a 50/50 gender split for professional roles).

Key Results and Scalability

The researchers evaluated UCE across benchmarks including COCO-30k, Imagenette, I2P, and Winobias.

  • Scalability: UCE can handle over 100 simultaneous style erasures without significant loss in general image fidelity. CLIP scores remain stable even as the number of edits increases.
  • Precision: In debiasing tasks, UCE reduced the demographic deviation for biased prompts (e.g., "Librarian") from 0.86 to 0.07, significantly outperforming prior methods.
  • Safety: The method achieved a 58% reduction in nudity on the I2P benchmark, matching the performance of intensive fine-tuning while maintaining better image structure (lower LPIPS distortion).

Limitations and Future Work

While UCE is highly effective, it faces capacity limits; erasing more than 500 concepts can begin to "hollow out" the model's core visual knowledge. Additionally, the method is sensitive to text embeddings, meaning highly creative or "jailbroken" prompts might still bypass safety edits. Future work will focus on making these edits more robust to prompt variations and managing the trade-offs between extensive editing and model performance.

Summary updated

BibTeX
@inproceedings{gandikota2024unified,
  author = {Rohit Gandikota and Hadas Orgad and Yonatan Belinkov and Joanna Materzynska and David Bau},
  title = {{Unified Concept Editing in Diffusion Models}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00503},
}
Figure