Edit-R2: Context-Aware Reinforcement Learning for Multi-Turn Image Editing

Yuxiao Ye, Haoran He, Fangyuan Kong, Xintao Wang, Pengfei Wan, Kun Gai, Ling Pan

TL;DR

Edit-R2 is a novel reinforcement learning framework designed to master multi-turn, conversational image editing. By combining an in-context chain-of-thought reasoning step with a unified text-and-image RL objective, it prevents models from forgetting long-term session constraints or misinterpreting pronouns as the editing history grows.

What Problem Does This Paper Address?

While text-guided image editing has made massive strides, most models operate in a single-turn vacuum: you give it an image and an instruction, and it outputs a single edit. In reality, human workflows are iterative. A user might say: "Add a podium on the left. Change its color to blue. Now remove it."

This multi-turn "in-context" editing paradigm introduces two severe challenges:

  1. Long-Context Dilution: Multimodal models use a massive token budget to encode images. As the conversation history grows, early textual instructions get buried under a mountain of visual tokens. The model literally loses sight of global rules (e.g., "Make all subsequent edits purple").
  2. State Contamination: If the model makes a mistake in Turn 1, that error becomes part of the input state for Turn 2, causing a cascading failure across the entire editing session.

As shown in the paper's analysis, attention to prompts from earlier turns weakens significantly as editing progresses, leading directly to context loss.

Attention magnitude of the flow-matching generator across prompts degrades over turns.

Methods

The authors formulate multi-turn image editing as a session-level Markov Decision Process (MDP) and introduce Edit-R2, which builds upon the open-source unified model BAGEL.

The framework consists of three core components:

  • In-Context Chain-of-Thought (IC-CoT): Before generating an image, an "understanding expert" reasons over the dialogue history to explicitly reconstruct the active session intent. It compresses the long history into a clean, enhanced instruction (e.g., resolving the pronoun "its" to "the podium's").
  • Unified Multi-Turn RL: Instead of training the text-rewriter and the image-generator separately, Edit-R2 jointly optimizes both using a shared advantage signal. It couples discrete text optimization (Text-GRPO) with continuous latent space image generation (Flow-GRPO).
  • Prefix-Valid Advantage Refinement: To handle state contamination during training, the authors implement a trajectory filtering mechanism. If a model's edit fails at Turn 1 (falling below a reward threshold $\delta$), the rollout is immediately terminated. This prevents low-quality, corrupted histories from polluting the RL training gradients.
Overview of the Edit-R2 framework showing joint policy optimization and trajectory filtering.

Datasets

To evaluate this setup, the authors introduced MICE-Bench (Multi-turn In-Context Editing Benchmark). It contains 720 three-turn editing sessions split into two main task categories:

  • Content Memory: Tests if a model can adhere to global constraints applied uniformly across the session (e.g., "all added objects must use cheese material").
  • Content Understanding: Tests if a model can resolve pronominal coreferences (it, them, there, its) across turns.

They also introduce a strict Global Awareness (GA) metric powered by a 235B Qwen3-VL model to evaluate session-level consistency turn-by-turn. For broader validation, they evaluate generalization on EdiVal-Bench and GEdit-Bench.

Key Insights and Ideas

  • The Visual Token Tax: The root cause of long-context dilution is structural. Because visual tokens overwhelm sparse text tokens, standard positional embeddings (like RoPE) naturally cause the model to de-prioritize older text constraints. Explicit text-based reconstruction (IC-CoT) acts as a vital anchor.
  • The Feedback Loop of Text and Vision: You cannot optimize an image-intent rewriter in isolation. A text rewrite is only useful if it aligns with what the downstream image generator is actually capable of producing. Joint RL training calibrates the two modules perfectly.
  • Sharper Visual Attention: Visualizing the internal attention maps reveals that Edit-R2 recovers session intent by focusing attention tightly on the target objects mentioned turns ago, whereas baseline models exhibit highly diffuse, confused attention maps.

Key Results

Edit-R2 achieved the best average performance across all turns among open-source models on MICE-Bench, even outperforming prominent closed-source models on later turns.

  • Turn 2 & 3 Performance: On the challenging second turn, Edit-R2 improved over its baseline (BAGEL) by +18% in Instruction Following (IF) and +18% in Global Awareness (GA). By Turn 3, it maintained a +8% IF and +15% GA advantage.
  • Vs. Closed-Source: Closed-source models like GPT-Image-1 showed a pronounced decline in Content Consistency (CC) over multiple turns, tending toward free-form generation rather than precise editing. Edit-R2 maintained high pixel fidelity and consistency throughout the session.

Limitations and Future Work

Currently, MICE-Bench focuses heavily on two representative in-context scenarios (content memory and coreference understanding). The authors note that real-world interactive editing features a much broader taxonomy of user intents. Future work will focus on scaling Edit-R2 to handle a wider variety of complex, real-world conversational editing behaviors.

Summary updated

BibTeX
@inproceedings{ye2026edit,
  author = {Yuxiao Ye and Haoran He and Fangyuan Kong and Xintao Wang and Pengfei Wan and Kun Gai and Ling Pan},
  title = {{Edit-R2: Context-Aware Reinforcement Learning for Multi-Turn Image Editing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=kbEhNKUbYG},
}
Figure