Introduction
As text-to-image (T2I) models like Stable Diffusion gain widespread use, the ability to selectively "unlearn" or erase specific concepts has become a critical safety requirement. Current methods often target specific keywords to prevent the generation of Not-Safe-For-Work (NSFW) content, copyrighted material, or unauthorized likenesses. However, these approaches frequently suffer from concept residue—a loophole where the model can still generate the forbidden concept if prompted with synonyms or semantically related terms. For instance, erasing "airplane" might not prevent the model from generating a plane when prompted with a specific model like "Antonov An-225."
The RealEra Framework
RealEra addresses this limitation by shifting from word-level erasure to semantic-level erasure. The framework introduces two primary mechanisms to ensure a more robust removal of concepts from the model's latent space.
Neighbor-Concept Mining
Instead of focusing solely on a single anchor concept embedding, RealEra employs Neighbor-Concept Mining. By adding stochastic perturbations to the target embedding, the system identifies a "neighborhood" of semantically related vectors. These neighbors are then mapped to a neutral "anchor" concept during the fine-tuning process. This approach creates a "buffer zone" that effectively captures synonyms and specific instances of a concept without requiring an exhaustive list of every possible related word.
Beyond-Concept Regularization
A common side effect of aggressive concept erasure is "concept erosion," where the model inadvertently loses the ability to generate unrelated but similar concepts (e.g., ruining "truck" generation while trying to erase "airplane"). RealEra mitigates this through Beyond-Concept Regularization. By sampling points outside the defined semantic neighborhood and enforcing a regularization loss, the framework ensures the model preserves its original performance on distant, safe concepts.
Experimental Results
The efficacy of RealEra was evaluated across several benchmarks, including CIFAR-10 for object erasure, the GIPHY Celebrity Detector for portrait rights, and the I2P dataset for explicit content.
In head-to-head comparisons with state-of-the-art methods like MACE and ESD, RealEra demonstrated superior performance. On the CIFAR-10 dataset, RealEra achieved a significantly lower accuracy on synonyms ($Acc_g$), outperforming MACE by over 20%. Furthermore, in NSFW removal tests, RealEra generated the fewest inappropriate images, producing only 93 instances compared to 111 for MACE and 743 for the base Stable Diffusion v1.4 model.
Conclusion
RealEra represents a significant advancement in the field of AI safety for generative models. By acknowledging that concepts in latent space are regions rather than isolated points, the framework effectively closes the "concept residue" loophole. While challenges remain in precisely defining the boundaries of "associated" concepts, RealEra provides a robust foundation for more controllable and ethical AI image generation.
Summary updated