TL;DR
Text-to-image models often generate hateful stereotypes not because of a single bad word, but because benign words combine in toxic ways—a subtlety that standard safety filters routinely miss or over-censor. TIDIER solves this without retraining model weights by grounding safety in a Multimodal Knowledge Graph that understands relationships between concepts and knows what a safe, identity-preserving alternative looks like. By checking and repairing generations both in the text prompt and mid-way through the image denoising process, it slashes toxicity by up to 64% without erasing the demographic groups it is meant to protect.
What Problem Does This Paper Address?
Imagine typing "a Muslim architect" into an image generator, and the safety filter panics and blocks it—or worse, you type "a Muslim near packages at an airport" and the model renders a terrorist stereotype.
Existing safety guardrails for diffusion models generally rely on scalar toxicity scores or steering generation away from a single "unsafe direction" in latent space. This creates two massive blind spots:
- Compositional Harm: Hateful imagery rarely stems from a single slur. It usually arises when a benign identity ("women", "Muslim") pairs with a benign object or action ("kitchen", "weapons") to realize a harmful trope. Unstructured filters see safe individual pieces and miss the toxic whole until the image is already rendered.
- Identity Erasure: Steering away from a direction doesn't tell the model where to steer toward. As a result, suppressing hate often suppresses the protected identity altogether, leading to heavy over-censorship of completely benign prompts.
Methods
Instead of treating safety as a scalar threshold, the authors reframe it as a structured similarity constraint using a training-free framework called TIDIER, built on four novel pillars over standard frozen models (SD-v1.5, SDXL, and CLIP):
- Multimodal Knowledge Graph (MMKG): Rather than a flat list of banned words, the authors construct a graph of 49 concepts containing explicit slurs, relational
(subject, predicate, object)stereotypes (called TropePatterns), and validated neutral counterparts, all grounded in both text embeddings and visual CLIP prototypes. - Semantic Safety Margin (SSM): A prototype-based, non-parametric yardstick computed at any point in generation. It simply measures the similarity to the closest harmful prototype minus the similarity to the closest safe-context prototype.
- Dual-Space Alignment: TIDIER applies the SSM twice. First, Prompt-Space Alignment catches slurs and relational tropes before sampling, swapping them for neutral templates that keep the person's identity intact (e.g., rewriting a kitchen-subjugation trope into "Person thriving in a professional environment"). Second, Trajectory-Space Alignment checks the image late in the 50-step denoising schedule (step 46). If latent visual harm emerges anyway, it rewinds the diffusion process to an earlier, editable step (step 18) and surgically blends neutral visual concepts into the cross-attention regions of the harmful concept.
- Open-World Concept Inference (OWCI): Because internet slang and adversarial attacks evolve, OWCI sits outside the live inference loop, clustering novel inputs that an external classifier flags as harmful, and queuing them up for human-reviewed addition to the MMKG.
Datasets
Because TIDIER is training-free, no datasets are used to update diffusion weights.
- Knowledge Graph Grounding: The MMKG taxonomy and tropes are mined from established hate-speech corpora (such as Sap et al., Mathew et al., Hartvigsen et al., and DETONATE).
- Evaluation: The authors test on a held-out set of 1,000 prompts (400 explicit, 400 implicit/compositional, and 200 benign identity-sensitive prompts) drawn from four existing benchmarks: DETONATE, I2P, T2I-Safety, and T2I-RiskyPrompt. No new benchmark dataset is introduced, though the curated MMKG itself is released as a new research artifact.
Key Insights and Ideas
- Harm emerges late in the diffusion trajectory: Harmful and safe-context prompts look virtually identical in latent space during early denoising steps, separating reliably only near the very end (around step 46 of 50). Checking too early causes false alarms; rewinding from step 46 back to step 18 hits the sweet spot between accurate detection and latent editability.
- LLM prompt-rewriters cheat via erasure: Comparing TIDIER against an LLM baseline (
gemma-4-E2B) revealed a striking trade-off. While the LLM achieved low toxicity, it did so by rewriting nearly everything, causing an 82% over-censorship rate and preserving benign identities only 18% of the time (compared to TIDIER's 88–89% identity preservation). - Fixing stereotypes requires replacing the whole relation: When repairing compositional tropes, swapping out just the identity word leaves 76% of the harmful visual structure intact. Replacing the entire
(subject, predicate, object)span drops surviving tropes down to 8%.
Key Results
- Image Toxicity & Quality: Across the 1,000-prompt test set, full TIDIER reduces image toxicity from 0.31 to 0.21 on SDXL and from 0.28 to 0.10 on SD-v1.5 (up to a 64% reduction). Simultaneously, it achieves a 9–10% relative gain in CLIP score and the lowest CMMD (better image quality), outperforming both training-free baselines (SLD, SAFREE) and weight-editing methods (RECE, TRCE).
- Prompt-Level Implicit Harm: Adding relational trope matching jumps implicit hate detection F1 from 0.41 (lexical matching alone) to 0.79, cutting overall prompt toxicity by 65%.
- Minimal Latency Overhead: On an A100 GPU, prompt repair adds just 0.06% latency. Full trajectory monitoring adds 2.2% when prompts are clean, and caps worst-case latency (when rewind-and-repair triggers) at 1.74× vanilla generation.
- Adaptability: When concepts are intentionally withheld from the graph, OWCI successfully catches 79% of those unseen harmful prompts while false-triggering on only 3% of safe prompts.
Limitations and Future Work
While detailed technical limitations and future directions are deferred to Appendix K (not included in the main text), the authors candidly highlight several ethical and operational constraints:
- Cultural and Normative Bias: Defining what counts as "harmful" or "neutral" is inherently subjective. Because the MMKG relies on English-language corpora and six expert annotators, its repairs may not generalize across other languages, cultures, or communities.
- Dual-Use Risks: A structured inventory of slurs and stereotype patterns could theoretically be reverse-engineered by adversaries to craft better jailbreaks, prompting the authors to recommend access controls.
- Imperfect Selectivity: While dramatically better than LLM rewriters, false positives still happen (an 11–12% over-censorship rate on benign prompts), and the system silently alters user prompts—meaning real-world deployments should disclose interventions and pair TIDIER with human oversight.
Summary updated