Attention manipulation with Strategic token weighting guided by LLMs creates a robust safety net for image generation.
Token tweaking + LLM gatekeeping = Safe AI art without the training headache
Original Problem π¨:
Text-to-image diffusion models often generate unsafe or explicit content, particularly when prompted with certain inputs. Current safety filters are ineffective and vulnerable to jailbreak prompts.
Solution in this Paper π οΈ:
β’ Training-free approach using attention reweighing combined with LLM validation
β’ Uses Mistral-8x7B to validate if prompts are safe and modify unsafe ones
β’ Increases relative importance of tokens that enforce safety by reweighing them by factor of 10
β’ Dynamically adjusts cross-attention maps during inference to suppress unsafe content generation
β’ Works without additional training or computational overhead
Key Insights π‘:
β’ Existing safety filters rely too heavily on CLIP embedding vectors
β’ Models are vulnerable to "jailbreak" prompts that bypass safety mechanisms
β’ Current ablation methods struggle with semantically similar but unsafe concepts
β’ Dynamic attention reweighing is more effective than static filtering
β’ LLM validation adds an extra layer of safety checking
Results π:
β’ Outperforms existing methods (Concept Ablation, Forget-Me-Not, Safe Diffusion) in restricting explicit content
β’ Human evaluation shows 0/10 unsafe content generation for direct prompts
β’ Only 1-2/10 unsafe generations for jailbreak prompts
β’ Maintains good image quality with FID scores comparable to baseline
β’ CLIP scores show significant reduction in unsafe concept alignment
π οΈ The method works in two steps:
Uses Mistral-8x7B model to validate if prompts are safe and modify unsafe ones
Increases the relative importance of tokens that enforce safety by reweighing them by a factor of 10
Attention Reweighing




