TL;DR
This paper introduces NPC, an automated pipeline that significantly improves text-to-image alignment by intelligently generating and selecting "negative prompts" – instructions on what not to generate. By analyzing cross-attention patterns, they demonstrate that both directly conflicting and subtly irrelevant negative prompts can enhance image quality, leading to state-of-the-art results on challenging benchmarks.
What Problem Does This Paper Address?
Modern text-to-image (T2I) generation models, like Stable Diffusion and DALL-E 3, have made incredible strides in creating diverse and photorealistic images from natural language descriptions. However, achieving precise alignment between the generated image and the prompt remains a significant challenge, especially for complex prompts involving multiple objects, attributes, relationships, or even surreal instructions. Existing methods often focus on strengthening the positive prompt (e.g., through fine-tuning or prompt rewriting), but this paper tackles the problem from a different angle: guiding the model by explicitly telling it what not to generate. This "negative prompting" can help suppress unintended content and improve the overall fidelity of the generated image to the prompt.
Methods
The core of this work is the Negative Prompting for Image Correction (NPC) pipeline, an automated system designed to discover and apply effective negative prompts. NPC operates in four key steps:
- Verifier: An initial image is generated from the positive prompt. A verifier (implemented using an LLM) checks if the image meets the prompt's criteria. If not, it provides a "failure reason" (e.g., "missing attribute," "wrong style"), which can serve as a targeted negative prompt.
- Captioner: The same verifier also generates a descriptive caption of the generated image. This caption enumerates objects, attributes, and context, providing potential untargeted negative prompts – elements present in the image but not directly related to the alignment error.
- Proposer: A proposer (also LLM-based) combines the failure reason and the caption to generate multiple candidate negative prompts. These candidates can be either targeted or untargeted.
- Salient Score: Instead of synthesizing new images for each candidate, NPC uses a novel salient score calculated in text-space. This score estimates how well a negative prompt would shift the model's attention towards the semantically important parts of the positive prompt, without requiring additional image generation. The candidate with the highest salient score is selected and applied.
The paper also provides an attention-based analysis to explain why negative prompts work. They show that both targeted and untargeted negatives increase the attention allocated to salient tokens in the positive prompt, effectively guiding the model's focus.
Datasets
The paper evaluates NPC on two established benchmarks:
- GenEval++: This benchmark focuses on compositional control and includes 280 prompts across seven task types, designed to be more challenging than previous datasets. Evaluation is done using a fixed checklist over various criteria like object, count, color, position, and size.
- Imagine-Bench: This benchmark evaluates surreal modifications to common objects while preserving their identity. It uses GPT-40 to assign scores on dimensions like Fantasy Fulfillment, Identity Preservation, and Aesthetic Quality.
Key Insights and Ideas
- Untargeted Negatives Matter: The paper demonstrates that negative prompts don't need to directly contradict the positive prompt to be effective. Simply suppressing unrelated elements ("wooden table") can also improve alignment, a concept not systematically explored before.
- Cross-Attention is Key: The analysis of cross-attention patterns provides a principled explanation for how negative prompts work. They reallocate attention from less relevant parts of the image generation process to the semantically crucial elements of the prompt.
- Text-Space Scoring is Efficient: The development of a "salient score" that works purely in text-space is a significant contribution. It allows for efficient selection of the best negative prompt without the computational cost of generating multiple images.
- LLMs as Agents: The use of LLMs as distinct agents (verifier, captioner, proposer) within the pipeline showcases a powerful way to leverage their capabilities for complex generation and evaluation tasks.
Key Results
- State-of-the-Art Performance: NPC achieved the highest overall scores on both GenEval++ (0.571, a 54% relative gain over the strongest baseline) and Imagine-Bench (6.80).
- Improved Compositional Control: NPC showed particularly strong gains on compositional constraints like Count/Pos, Pos/Size, and Multi-Count on GenEval++.
- Reduced Regeneration: The salient score significantly reduces the number of regeneration attempts needed to achieve satisfactory alignment, improving efficiency.
- Qualitative Improvements: Figures and qualitative comparisons demonstrate NPC's ability to generate more realistic and aligned images compared to other methods, especially for challenging prompts.
Limitations and Future Work
- LLM Dependency: The pipeline relies on LLMs for verification, captioning, and proposing. While effective, the performance is tied to the capabilities of these models.
- Salient Score as a Proxy: The salient score is a text-space proxy for image-level effects. While empirically shown to be effective, it's not a perfect predictor.
- Future Work: The authors suggest exploring more sophisticated LLM prompts, alternative text-space scoring mechanisms, and investigating the impact of negative prompts on other generative tasks. They also highlight the potential for further improvements by integrating more advanced LLM capabilities.
Summary updated