Safety Without Semantic Disruptions: Editing-free Safe Image Generation via Context-preserving Dual Latent Reconstruction
Jordan Vice, Naveed Akhtar, Mubarak Shah, Richard Hartley, Ajmal Mian
TL;DR
This work tackles the challenge of safe image generation without semantically distorting the learned manifolds. It introduces an editing-free, context-preserving diffusion framework that leverages safe embeddings and a dual latent reconstruction with tunable safety, mediated by a global-context threshold $\\tau_{gc}$. By combining two latent streams corresponding to unsafe and safe prompts, the method achieves state-of-the-art safety on the I2P benchmark while preserving proximal semantic structure, as quantified by the SaDi index, and offers intuitive control over safety levels. The approach generalizes across SD1.4/2.1 and is evaluated on I2P and ViSU, with analyses of proximal-concept disruptions and second-order statistics demonstrating reduced semantic shift compared to editing-based methods, making it a practically impactful path for ethically aligned generative AI.
Abstract
Training multimodal generative models on large, uncurated datasets can result in users being exposed to harmful, unsafe and controversial or culturally-inappropriate outputs. While model editing has been proposed to remove or filter undesirable concepts in embedding and latent spaces, it can inadvertently damage learned manifolds, distorting concepts in close semantic proximity. We identify limitations in current model editing techniques, showing that even benign, proximal concepts may become misaligned. To address the need for safe content generation, we leverage safe embeddings and a modified diffusion process with tunable weighted summation in the latent space to generate safer images. Our method preserves global context without compromising the structural integrity of the learned manifolds. We achieve state-of-the-art results on safe image generation benchmarks and offer intuitive control over the level of model safety. We identify trade-offs between safety and censorship, which presents a necessary perspective in the development of ethical AI models. We will release our code. Keywords: Text-to-Image Models, Generative AI, Safety, Reliability, Model Editing
