ECCV 2026 · Spotlight

DoCoG

Mask-based Multi-Type Grounded Chain-of-Thought for Document QA

Sai Madhusudan Gunda* · Jyothi Swaroopa Jinka* · Hrithik Sagar Rachakonda* · Aryan Jain† · Venkata Kesav Venna† · Anirudh Srinivasan · Ravi Kiran Sarvadevabhatla
*, † equal contribution  ·  IIIT Hyderabad · BharatGen  ·  docog-eccv.github.io

DoCoG · The gap M3Grounder leaves

The answer is grounded — the reasoning isn't

ungrounded CoT Step 1 · "The table lists Q4 revenue…" Step 2 · "…which grew 12% over Q3"⚠ invented? no way to tell Answer · "$3.2B" a fluent chain can silently hallucinate its middle DoCoG: step-wise grounded CoT Step 1 · reads the revenue row[GND] Step 2 · compares with Q3 cell[GND] Answer · "$3.2B"[GND] every step commits to evidence — a mask per [GND] multi-type: text, pie wedges, legends, flowchart nodes & arrows
DoCoG · In one picture

Chain-of-thought that shows its work

Grounded CoT on a medical flowchart
(1) a medical triage flowchart — each step's [GND] masks the exact node or connector it walks: cough → sputum → fever → throat pain.
DoCoG · In one picture

Multi-type evidence: whatever shape the step needs

Grounded CoT on a line chart
(2a)–(2c) one chart, three grounding behaviours: axis labels (2a) · every team's legend entry + line segment (2b) · one team's, in the final answer (2c).
DoCoG · Architecture

VLM + segmenter, joined by GIM

DoCoG architecture

① VLM (Qwen3-VL-8B) emits steps S = (S₁…Sₙ, Sf) with [GND] ② · hidden states G˜ ③ → GIM ④
cross-attends segmenter features ⑤ Fenc(I) ⑥ · prompt encoder ⑦ + mask decoder → one mask per [GND]

DoCoG · Interactive

Watch the forward pass — tokens flow through GIM into masks

Click inside to drive it · Space pause · R restart · F fit — then use ‹ › to continue the talk open standalone ↗
DoCoG · The new piece

GIM — because evidence tokens must agree with each other

M3Grounder grounds one query at a time — independent heads suffice. DoCoG emits a [GND] in every step + the answer — refined in isolation, they can contradict.

GIM · transformer encoder [GND]₁ [GND]₂ [GND]₃ self-attention [GND] embeddings stay mutually consistent segmenter features x = Fenc(I) cross-attention aligns tokens to the segmenter's space refined G → prompt enc → masks
81.9 → 69.6
final-answer grounding without GIM
78.2 → 73.5
GQall if GIM loses image cross-attention
DoCoG · Training

Training in two stages: SFTDPO

DoCoG-QA 1.5M grounded QA Stage 1 · SFT learn the skill — grounded step-wise CoT + masks Stage 2 · DPO sharpen the judgment — prefer its better chains DoCoG-PQA · 20K pairs

Stage 1 is plain supervised fine-tuning, end-to-end (VLM + GIM + mask decoder):
cross-entropy on the text · Dice + BCE on every predicted evidence mask.

Why a stage 2? SFT only imitates the single annotated chain — fixed-style supervision. It never compares the model's own better and worse chains — DPO adds that.
DoCoG · Training stage 2 · the idea

DPO in one minute: prefer the better answer

same question (image, q) VLM writes several answers ✓ better answer right — and well grounded ✗ worse answer wrong, or unsupported train: nudge the model toward ✓, away from ✗ — that is all DPO is

No new labels, no reward model — the model learns from its own outputs, ranked better vs worse.

In DoCoG this update touches only the VLM — the part that writes the text. Why everything else stays frozen → next slide.

DoCoG · Training stage 2 · the objective

The DPO formula — every term is text

𝓛DPO = −log σ( β [
log πθ(y | I, q) πref(y | I, q)
the better chain — pushed up
log πθ(y | I, q) πref(y | I, q)
the worse chain — pushed down
] )

π(y | I, q) is a text likelihood

y is the chain, as tokens — π is the LM head's probability of writing it. θ = tuned · ref = frozen SFT copy · β = push strength.

So only the VLM can move

Every π comes from the LM head → gradients reach only the 🔥 VLM. GIM + segmenter appear nowhere in the formula❄ frozen.

Why no mask term?

A preference needs a likelihood — a mask has none: the decoder emits one mask, not a distribution. Ill-posed, so left out.

The catch — πref leashes the text, not the hidden [GND] states the frozen mask pipeline reads → the drift trap, next.
DoCoG · Training stage 2

DPO on text only — and the drift trap

What DPO does here

From each preference pair, DPO pushes the VLM to make the chosen ✓ chain more likely than the rejected ✗ one, against a frozen reference. Only the VLM's weights change — mask preferences are ill-posed, so GIM + segmenter stay frozen.

SFT hidden states after DPO: shifted frozen GIM reads inputs it was never trained on masks silently collapse
70.5 → 40.3
mask IoU without the fix
81.9 → 41.7
GQfa without the fix

The fix — anchor loss

𝓛anchor = (1/K) Σk ‖Gkθ − Gkref‖²

A moving VLM drags the [GND] states with it — this keeps them where the frozen GIM + segmenter expect them.

DoCoG · Training stage 2 · the fix

The anchor loss, unpacked

(I, q) same input to both ❄ SFT model (frozen) the reference — kept as it was ❄ GIM same frozen weights G₁ʳᵉᶠ G₂ʳᵉᶠ GKʳᵉᶠ 🔥 DPO policy θ its text keeps improving ❄ GIM same frozen weights G₁ᶿ G₂ᶿ GKᶿ pull every pair together ‖Gkθ − Gkref‖² the text may move… …the mask interface may not.

𝓛opt = 𝓛DPO + λanchor·𝓛anchor

𝓛anchor = (1/K) Σk ‖Gkθ − Gkref‖²  ·  λanchor = 1

Read the symbols

Gk = the k-th GIM-refined prompt embedding — what the mask decoder consumes · ref = frozen SFT copy · θ = the model DPO tunes · mean over the K [GND] tokens.

Why it works

Drift becomes differentiable and punished: DPO improves the reasoning only in directions that keep the grounding interface where the frozen modules expect it.

70.5 kept
mask IoU with the anchor — 40.3 without it
DoCoG · Training stage 2

Stage 2, end to end

❄ SFT model samples N CoTs per (I, q) reward format check → AQ + CQ + GQ DoCoG-PQA 20K chosen ✓ / rejected ✗ DPO — on the text only 🔥 VLM · ❄ GIM + segmenter + anchor on refined [GND] embeddings 𝓛opt = 𝓛DPO + λanchor·𝓛anchor
84.1 → 85.8
AQ — what stage 2 adds
70.5 held
mask IoU — the anchor at work

One objective: better chains, unmoved grounding interface.

DoCoG · Stage-1 data

DoCoG-QA: 325K docs · 1.5M QA — multi-type by construction

Composition (source documents)

325K documents 75K charts 75K tables 75K flowcharts 100K diverse docs

The engine cites element IDs, never coordinates. Verified: gpt-oss-120B judge (a different family, on purpose) · ROSCOE · 33,500 masks checked by hand.

Eval twin: DoCoG-Bench — 3K images · 10K QA · two-stage human verification.

Grounded step-wise CoT on an Olympics infographic
what the data teaches: every step cites its evidence — locations, dashed routes, numbers — as masks
DoCoG · Preference data

DoCoG-PQA: 20K pairs — one format check, three scores

FR · format — must pass first

Do steps, answer, and [GND] references all parse? Fail ⇒ rejected before scoring.

AQ · answer

Matches ground truth — after normalization + numeric tolerance. Rule-based, no LLM judge.

CQ · chain

ROSCOE check (below threshold ⇒ 0), then bipartite step matching (E5 similarity) → step-level F1.

GQ · grounding

A mask counts iff IoU ≥ 0.5 + same element type + right step. All steps + answer = GQall · answer only = GQfa · GQ = mean.

✓ chosen

highest total reward — right answer and faithful grounding

✗ rejected

lowest total — a right answer can still lose on weak grounding

Same yardstick at test time: DoCoG-Bench reports exactly these metrics (deterministic, + one G-Eval) — the numbers on the next slides.

DoCoG · Results

Frontier models answer — they can't show

DoCoG-Bench (All): answer quality vs final-answer grounding

020406080 7075808590 answer quality (AQ) → grounding GQfa fluent but unverifiable GPT-5 · AQ 82.9 · GQ_fa 4.8 Claude Sonnet 4.5 · 79.9 · 7.1 Gemini 3 Pro · 84.2 · 11.4 Qwen3-VL fine-tuned · 77.5 · 61.9 InternVL3.5 fine-tuned · 76.1 · 64.6 DoCoG · 85.8 · 81.9 GPT-5Claude 4.5Gemini 3 Pro Qwen3-VL ftInternVL3.5 ft DoCoG (9B)
85.8 / 81.9
DoCoG · AQ / GQfa — best on both axes

Per domain (AQ / GQfa)

charts 83.5 / 80.3 · flowcharts 82.2 / 79.2 · docs 89.7 / 85.4 · tables 87.8 / 82.7

General QA intact

ChartQA 92.7 · ChartBench 79.4 · FlowVQA 85.5 · MISS-QA 78.4 · TabFact 89.4 · DocVQA 93.4

DoCoG · In the wild

Evidence no box could express — step through it

Autoplays · tabs switch examples · click any [GND] to re-sweep its mask open standalone ↗
Takeaway #2 — grounding every step makes the answers better (AQ 78.1 → 85.8) — and DPO around frozen modules needs an anchor loss.
DoCoG · In one image
DoCoG: the answer and its grounding — take both pills
DoCoG · the team

Built by

SMSai Madhusudan Gunda
Sai Madhusudan Gunda*
JSJyothi Swaroopa Jinka
Jyothi Swaroopa Jinka*
HSHrithik Sagar Rachakonda
Hrithik Sagar Rachakonda*
AJAryan Jain
Aryan Jain
VKVenkata Kesav Venna
Venkata Kesav Venna
ASAnirudh Srinivasan
Anirudh Srinivasan
RKRavi Kiran Sarvadevabhatla
Ravi Kiran Sarvadevabhatla
BharatGen · IIIT Hyderabad   * equal contribution · † equal contribution

Thank you — questions?

DoCoG project page QR
DoCoG
docog-eccv.github.io
BharatGenIIIT Hyderabad

DoCoG (ECCV 2026, Spotlight)
IIIT Hyderabad · BharatGen