InterCoG: Towards Spatially Precise Image Editing with Interleaved Chain-of-Grounding Reasoning

Yecong Wan, Fan Li, Chunwei Wang, Hao Wu, Mingwen Shao, Wangmeng ZuoarXiv 2026

TL;DR

InterCoG introduces a novel text-vision interleaved "Chain-of-Grounding" framework designed to solve the "where to edit" problem in complex, multi-entity images. By explicitly reasoning about spatial relationships in text and generating pixel-level bounding boxes and masks before executing an edit, it achieves unprecedented spatial precision. Along with the framework, the authors introduce GroundEdit-45K, a large-scale dataset with structured reasoning annotations, and a new benchmark to evaluate grounding-aware image editing.

What Problem Does This Paper Address?

While modern instruction-based image editing models excel at understanding what to change (e.g., "turn the car blue"), they frequently stumble in complex, multi-entity scenes where the target object is implicitly specified through spatial relationships (e.g., "change the shirt of the person standing behind the table").

Existing unified multimodal language models (MLLMs) typically rely on implicit alignment between text and image features. When faced with a crowded scene containing multiple similar entities, these models often suffer from ambiguity, leading to erroneous or entangled edits on the wrong objects. Recent attempts at region-aware editing use coarse masks or coordinate predictions, but these explicit geometric cues are often unreliable for complex referential reasoning.

Methods

To bridge the gap between high-level semantic reasoning and low-level spatial precision, the authors propose InterCoG (Interleaved Chain-of-Grounding), built upon the unified multimodal foundation model, Bagel.

Instead of mapping an instruction directly to an edited image, InterCoG decomposes the process into a structured reasoning trajectory inside a special <think> segment:

  1. Textual Grounding Reasoning ($z_{text}$): The model deduces spatial relations solely within the text modality to clarify the location and identity of the target (e.g., describing the surrounding entities).
  2. Visual Grounding Reasoning ($z_{vis}$): The model projects the textual reasoning into pixel space by generating an intermediate image annotated with a red bounding box and a semi-transparent mask.
  3. Editing-Oriented Semantic Rewriting ($z_{edit}$): The model refines the original prompt into a precise, executable editing specification.
  4. Final Image Generation ($I'$): The model executes the edit based on the complete reasoning chain.
Overview of the InterCoG framework showing the interleaved reasoning steps and auxiliary training modules.

To ensure the model actually follows this trajectory rather than taking optimization "shortcuts," the authors introduce two auxiliary training modules:

  • Multimodal Grounding Reconstruction Supervision: A shared mask decoder forces the model to reconstruct the target's binary mask from text, visual grounding, and editing features.
  • Multimodal Grounding Reasoning Alignment: This module uses a cosine similarity loss at an intermediate transformer layer (layer 14) to explicitly align the features of the target editing region with the textual and visual grounding cues generated during the reasoning phase.

Datasets

Because existing image editing datasets focus primarily on salient, isolated objects, the authors constructed two new datasets:

  • GroundEdit-45K: A dataset containing 45,000 samples built using raw images from SAM-1B. The authors used automated pipelines (RAM, Grounded-SAM, and Qwen2.5-VL) to identify multi-entity scenes, filter out overly simple/salient targets, and generate complex, relation-based editing instructions paired with structured text-vision reasoning chains.
  • GroundEdit-Bench: A manually curated evaluation benchmark consisting of 500 real-world cases with human-annotated instructions and target bounding boxes.

The framework was also evaluated on standard benchmarks like SmartEdit and GEdit-Bench.

The GroundEdit-45K dataset construction pipeline.

Key Insights and Ideas

  • The Power of Modality Interleaving: Text is excellent at handling abstract logic and relative positioning ("second from the left"), while vision excels at exact pixel localization. Alternating between them allows the model to resolve ambiguity before touching the pixels.
  • Preventing Shortcut Learning: Simply asking a model to output a chain of thought doesn't guarantee it will use it. The Reasoning Alignment module acts as a architectural constraint, forcing the final generation layers to remain faithful to the intermediate localization steps calculated in the mid-layers.
  • "Free" Training Gains: Interestingly, the authors noted that even if the reasoning tokens are disabled during inference, models trained with the InterCoG paradigm still show improved editing performance. The training process inherently reinforces the model's internal localization and cross-modal consistency.

Key Results

InterCoG was evaluated using two primary metrics: Editing Grounding Accuracy (EGA) (the proportion of the edit that falls strictly within the target box) and Editing Score (ES) (a GPT-4o-based metric for visual quality and precision).

  • GroundEdit-Bench: InterCoG achieved an EGA of 0.89 and an ES of 4.02, substantially outperforming the baseline Bagel model (0.64 EGA, 2.70 ES) and specialized reasoning models like GoT (0.52 EGA, 2.63 ES).
  • SmartEdit Benchmark: On complex reasoning scenarios, InterCoG delivered clear improvements, achieving a PSNR of 30.024 compared to the previous state-of-the-art model MURE (28.694).
Qualitative comparisons demonstrating InterCoG's precision against other state-of-the-art methods.

Limitations and Future Work

The authors highlighted two primary failure modes:

  1. Incomplete Instance Ordering: In highly crowded scenes with severe occlusions, the model tends to default to the first fully visible instance, occasionally overlooking fragmented or partially hidden target objects.
  2. Uncertain Object Boundaries: When instructions point to regions with fuzzy or ambiguous boundaries (e.g., "the cluster of trees centrally behind the pond"), the model struggles to produce clean boundary delineations.

Future work will focus on better modeling ambiguous user intent and handling weakly constrained editing instructions more robustly.

Summary updated

BibTeX
@misc{wan2026intercog,
  author = {Yecong Wan and Fan Li and Chunwei Wang and Hao Wu and Mingwen Shao and Wangmeng Zuo},
  title = {{InterCoG: Towards Spatially Precise Image Editing with Interleaved Chain-of-Grounding Reasoning}},
  year = {2026},
  eprint = {2603.01586},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.01586},
}
Figure