Counterfactual Step Pairs: Testing Whether Medical Chain-of-Thought Reads the Image

When a vision-language model explains a medical diagnosis step by step, it is hard to tell whether each step comes from the scan in front of it or from memory. The model might name the modality, describe a lesion, and then give a diagnosis, all because it has already seen that public image and its label during training. We propose to test this with counterfactual step pairs. Each pair is two real medical images that experts have confirmed differ in exactly one intermediate clinical finding, such as which side a lesion is on, an atrophy grade, or whether a feature is present. A model that reasons from the image should change the matching step of its explanation, and only that step. A model that recalls a memorized case will keep producing the rationale that goes with its remembered answer.

The idea combines four lines of work. Chain-of-thought prompting, where the model writes intermediate reasoning before answering, supplies the thing we test. Benchmark contamination, meaning test items that leaked into training data, is the failure we want to expose. The gap between general-purpose models and expert medical imagery is the setting where the problem is most serious. Human-in-the-loop synthesis supplies the construction method: a model drafts candidate pairs and experts only verify them. Diffusion models cannot be trusted to edit microscopic or radiological detail, so we do not generate new images. We recombine and transform real, expert-labelled images instead.

Core Claim

Contamination in multimodal medical reasoning leaves a step-level signature that answer-level tests miss. A memorized model's intermediate steps stop tracking the image: when the evidence for one step changes, that step stays fixed or changes only to match the recalled answer. We claim that a benchmark of expert-verified counterfactual step pairs, built from real images rather than diffusion edits, can do three things. It can detect deliberately induced contamination in open models more reliably than answer-level perturbation, text-only blind tests, or paraphrasing. It can localize which reasoning step is memorized. It also gives a contamination-robust re-estimate of how much structured clinical chain-of-thought actually helps.

Three bodies of work motivate this. M3CoTBench scores four-step clinical rationales on 1,079 cases drawn from 55 public datasets. It finds that rationales often describe features absent from the scan, and that chain-of-thought sometimes lowers accuracy. Its sources are widely circulated, so it cannot tell grounding failure apart from recall. S-Chain shows that diagnosis reaches nearly 99% accuracy when localization and grading steps are correct, and that expert rationales beat GPT-4.1 rationales by 4–5%. It evaluates only on the public OASIS cohort, so its step-level gains are equally exposed to contamination.

The method comes from Contamination Detection for VLMs Using Multi-Modal Semantic Perturbations. That work swaps the correct answer, asks GPT-4o for the minimal visual change that would make the swapped answer correct, and renders that change with Flux and ControlNet. Clean models hold or improve accuracy on the edited images, while contaminated models drop sharply. We keep its logic of "change the evidence minimally and see whether the output follows." We change it in two ways. First, we realize the change with real images or deterministic transforms, because the file notes that diffusion fails on microscopic medical features. Second, we score each reasoning step rather than only the final choice.

Dynamic generators such as DyVal and A²RBench constrain the design. They show that verifying items by construction (graph generation, executable round-trip checks) beats static items. They operate only in symbolic spaces, and A²RBench also shows that generated items are capped by what the generator can produce. Our pairs avoid that cap because the images are real.

Research Program

Pair construction by recombination. S-Chain already provides step-level labels for each slice: region-of-interest boxes, Scheltens and Koedam grades, and diagnosis. We index slices by this label vector. We then retrieve pairs from different subjects that share every step label except one, matched on scanner and slice position. No image is synthesized, and the step difference is known exactly from existing annotations.

Pair construction by deterministic transforms. Some findings can be changed by a transform whose effect is known in advance. A left-right flip changes the laterality of a finding while leaving the diagnosis unchanged. Moving to another slice of a 3D-RAD chest CT volume can remove or reveal a lesion described in the report. These transforms need no expert to certify what changed. An expert only confirms that the result is still a plausible image, for example that no scanner text marker was mirrored.

Human-in-the-loop pairs for free-text steps. M3CoTBench's steps are free text, so these pairs need people. For each item, an LLM parses the expert rationale into atomic findings, a step borrowed from VeriSciQA's claim extraction. It then proposes a one-finding change and retrieves real candidate images, from the same source dataset family, whose metadata or reports support that change. A medically trained reviewer accepts or rejects each candidate against a written rubric: same modality, exactly one finding differs, and that finding is visible. This follows the author-reviewer division of labour in Building a Role Specified Open-Domain Dialogue System, which reports that reviewing drafts is roughly 13 times more efficient than writing from scratch. We will measure reviewer minutes per accepted pair and the acceptance rate. We will not assume the 13× figure transfers to medical imaging.

The tracking metric. Take a pair $(x, x')$ whose ground-truth step vectors differ only at step $k$. Let $\hat{s}_j(x)$ be the model's parsed value for step $j$ on image $x$. The tracking rate at step $k$ is the fraction of pairs where $\hat{s}_k$ changes to the correct value. The spillover rate is the fraction of pairs where some step $j \neq k$ changes although its ground truth did not. Our contamination signature compares tracking on an original benchmark image with tracking on a fresh counterpart image outside the benchmark:

$$ \mathrm{Gap}_k = T_k(\text{fresh}\rightarrow\text{fresh}) - T_k(\text{benchmark}\rightarrow\text{fresh}), $$

Here $T_k(a \rightarrow b)$ is the tracking rate when the source image comes from set $a$ and its counterfactual from set $b$. A model that grounds its steps should show $\mathrm{Gap}_k \approx 0$. A model that memorized benchmark items should anchor on the recalled rationale for benchmark sources, which gives a positive gap at the memorized steps. A second diagnostic is the rate at which a step's content on $x'$ is copied verbatim from the model's rationale on $x$. This catches backward rationalization from a remembered answer.

Ground truth for contamination. The detector needs cases where we know the answer. Following the perturbation paper, we deliberately fine-tune open models on a known random half of benchmark items together with their expert rationales, for one to three epochs. The other half stays clean. This gives item-level contamination labels without guessing what proprietary models saw.

Baselines

The naive reference point is plain original-benchmark accuracy and M3CoTBench-style step F1 with no counterfactuals. By construction it cannot separate the contaminated half from the clean half except through inflated scores. For reference, M3CoTBench reports a best chain-of-thought correctness F1 of 66.07% for Gemini 2.5 Pro and 62.15% for Qwen3-VL-Thinking-30B.

The strongest existing method is answer-level semantic perturbation from Contamination Detection for VLMs Using Multi-Modal Semantic Perturbations, run as published: answer swap, GPT-4o edit description, and Flux with ControlNet Canny rendering. We apply it to the same items and the same deliberately contaminated checkpoints. On natural images it reports a clean-model accuracy change of +31.5% on MMStar, and contaminated LLaVA-v1.5-7B rising from about 38% to about 54% on originals before falling to about 38% on perturbed images. No reported result was found on Lacuna for this method on medical images. For fairness, both detectors get the same number of probe items per benchmark item and the same evaluator models. We also have experts rate edit fidelity, and we report the diffusion baseline twice: on all its edits, and on the subset experts judged faithful. That keeps the baseline from being handicapped by broken images alone. We count it as beaten if our step-pair probe achieves higher area under the curve for separating contaminated from clean items at equal probe budget, and localizes the memorized step when only rationales, not answers, were trained on.

A text-only blind test in the style of VeriSciQA removes the image and checks whether the model still answers or reasons correctly. It is cheap and strong against text-anchored leakage, so it runs on all items.

The key ablation removes the step-level scoring. We compute only whether the final answer flips on our real-image pairs. If this answer-only version matches the full metric, then step-level scoring adds nothing and the contribution reduces to "use real images instead of diffusion."

Why not just…?

Why not just run the diffusion perturbation pipeline on medical images? The source paper itself notes that diffusion struggles to render fine-grained and microscopic medical features. An edit that plants an artifact changes the ground truth unpredictably, so accuracy changes become uninterpretable. This is an empirical claim we will test rather than assume. Expert fidelity ratings on the diffusion edits, and the faithful-subset comparison in the baselines, will show whether it holds. If faithful diffusion edits detect contamination as well as our pairs do, then our real-image construction is only a cost optimization, and we would say so.

Why not just evaluate on a private, never-released test set? This is the most serious alternative. For final-accuracy estimates, a truly unseen cohort, like the private frozen sections in PathChat-SegR1, is the gold standard. It has three limits. It does not say which reasoning step a model gets from memory. Few groups can access such data. And it stops being unseen once it is released. We treat private-style data as the validation target instead. Our "fresh" images come from subjects held out of every public split we can verify. The benchmark-versus-fresh gap in our metric should predict the drop from public to held-out accuracy. If a plain held-out accuracy drop identifies contaminated checkpoints equally well at the item level, the step metric's remaining value is localization. We will report that honestly.

Why not just use token-surprise or membership-inference signals? Token-level surprise, as used by Yax et al. on logic puzzles, detects verbatim text recall. It needs log-probabilities, so it cannot be applied to many commercial models. The perturbation paper also argues that multimodal memorization is anchored to image features, which text-side likelihood can miss. We will compute surprise on rationale text for the open checkpoints as an additional baseline. If it separates contaminated from clean items as well as tracking does, it is the cheaper tool for open models.

Why not just paraphrase questions or shuffle options? The perturbation paper reports that text perturbations fail to expose VLM contamination because the image is unchanged. We include paraphrase as a baseline to reproduce this in the medical setting rather than rely on it.

Proposed Experiments

We build roughly 2,000 recombination pairs from S-Chain's OASIS slices, 1,000 transform pairs from 3D-RAD CT volumes, and as many reviewer-accepted pairs from M3CoTBench items as the reviewing budget allows. We record acceptance rate and minutes per pair. VeriSciQA's 3.0% survival rate is a warning that yield may be low. Recombination reduces this risk because its step labels already exist.

Models are LLaVA-v1.5-7B and a medical model in the LLaVA-Med family. Each is tested clean and contaminated on half the items at one and three epochs, and in two versions: trained on answers only, and trained on answers plus expert rationales. Proprietary reasoning models (Gemini 2.5 Pro, GPT-5) are evaluated but not contaminated. For them we report only the benchmark-versus-fresh gap, which is an estimate rather than a verdict.

The first decisive check asks whether step tracking separates contaminated from clean items better than the diffusion-perturbation, blind-test, paraphrase, and surprise baselines. It should do so especially for rationale-trained checkpoints, where the answer may stay correct while the steps are memorized.

The second check tests localization. When a model is contaminated only on grading steps, $\mathrm{Gap}_k$ should rise at the grading step and nowhere else.

The third check revisits S-Chain's headline result. We re-measure the 10–15% benefit of structured chain-of-thought supervision on fresh-source pairs. If the benefit shrinks substantially there, part of the published gain reflects familiarity with OASIS rather than grounded grading. The same test applies to label-to-symptom prompting from Aligning Medical Images with General Knowledge from Large Language Models, which reports 81.11% on Derm7pt: do the symptom-level descriptions track single-finding changes?

The fourth check is spillover. M3CoTBench reports that chain-of-thought can hurt accuracy, and M3CoTBench and S-Chain together suggest early hallucinated findings may propagate. Measuring whether an early step's error, or its correct change, spreads into later steps would test that account of why chain-of-thought sometimes hurts.

A negative result is also informative. If clean and contaminated models track equally badly, step-level grounding in current models is too weak for contamination to change it. That would redirect effort toward the grounding problem.