TL;DR
Instruction-based image editing often fails at fine-grained details like precise counts or spatial layouts due to sparse optimization feedback during diffusion sampling. CogniEdit solves this by introducing dense reward optimization that propagates gradients across consecutive denoising steps, paired with a dynamic token focus mechanism that helps the model attend to the right details at the right layers.
What Problem Does This Paper Address?
While text-to-image diffusion models have made massive leaps, instruction-based image editing still struggles with fine-grained control—such as modifying exact colors, spatial positions, or numerical quantities (e.g., "change to exactly five buttons").
Traditional training relies on supervised learning on paired datasets, which optimizes for overall visual similarity rather than precise text-visual alignment. Recently, reinforcement learning alignment techniques like Group Relative Policy Optimization (GRPO) have been applied to diffusion models. However, existing approaches optimize each denoising step independently. This sparse feedback fails to provide trajectory-level control; if a model makes a poor sampling decision early on, it struggles to recover, leading to visual artifacts and poor instruction adherence.
Methods
CogniEdit addresses these limitations through a unified framework consisting of three synergistic components:
- Dense GRPO-based Optimization: Instead of treating each sampling step as an independent decision point, CogniEdit accumulates gradients across $k$ consecutive denoising steps using a stop-gradient operation. This allows trajectory-level gradient flow through the sampling process, providing dense supervision. To adapt GRPO (which requires sample diversity) for deterministic editing trajectories, the authors inject controlled stochasticity into the sampling ODE (converting it to an SDE via Euler-Maruyama discretization) and compute advantages at the batch level rather than per-instance to stabilize training.
- Dynamic Token Focus Relocation: Image editing models often persistently attend to generic action words (like "change" or "add") throughout the network hierarchy. CogniEdit introduces a lightweight predictor that dynamically identifies and emphasizes fine-grained attributes (like numbers or colors) layer by layer. This creates a hierarchical attention pattern: early layers focus on high-level semantics, while deeper layers concentrate on fine-grained attributes.
- Knowledge-Enhanced Data Construction: The framework leverages a Multi-modal Large Language Model (MLLM) to decompose complex user instructions into clear, detailed, and actionable editing directives before feeding them into the model.
Datasets
- Training Data: The authors constructed a dataset combining 3k editing pairs from SEED-Data-Edit (real-world internet scenarios) and 1k randomly selected images from COCO 2017. A vision-language model was used to enrich these pairs with detailed, knowledge-enhanced instructions.
- Evaluation Benchmarks:
- KRIS-Bench: A diagnostic benchmark that categorizes editing tasks into Factual, Conceptual, and Procedural knowledge domains across social science, natural science, and knowledge reasoning.
- GEdit-Bench: A dataset of authentic editing instances from real-world user scenarios.
Key Insights and Ideas
- Trajectory-Level Gradients are Essential: Standard RL for diffusion models evaluates only endpoints or isolated steps. Allowing gradients to flow back through consecutive denoising steps acts as a dense supervisor, guiding the model to make better structural decisions early in the generation process.
- Hierarchical Attention Shifting: Attention shouldn't be static. For an instruction like "Change the color of the purple eyes to red," the model naturally benefits when early layers prioritize abstract concepts ("the color"), intermediate layers shift to specific attributes ("purple", "red"), and deeper layers ground the final actions.
Key Results
CogniEdit achieves state-of-the-art performance on KRIS-Bench, particularly excelling in Visual Quality (VQ) and Instruction Following (IF):
- Quantitative Improvement: In the challenging Knowledge Reasoning domain, CogniEdit achieved a VQ score of 91.72 (outperforming the base Qwen-Image-Edit-r1 model's 88.37) and boosted the overall average domain score from 55.48 to 59.29.
- Qualitative Superiority: As shown in Figure 1, when tasked with fine-grained numerical or spatial edits (such as reducing a cluster of buttons to exactly five, or correcting an unrealistic tilted door), CogniEdit successfully satisfies the prompt while preserving background consistency, whereas baseline models introduce severe blending artifacts or ignore the prompt entirely.
Limitations and Future Work
Not discussed in the paper.
Summary updated