Certifying Visual Grounding in Multimodal Reasoning with Group Testing over Sparse Features

When a vision-language model answers a geometry problem step by step, each written step looks the same whether it came from reading the diagram or from text-based guesswork. We propose to audit individual reasoning steps by asking which internal features the step actually depends on. The features come from a sparse autoencoder, a small network that rewrites the model's dense internal activations as a large dictionary of mostly-inactive, more interpretable features. To find which of these features a step depends on, we switch off pooled groups of features only at the image-token positions and record whether the step changes. Finding the few features that matter among tens of thousands this way is a group testing problem, the classical setting of finding a few "defective" items by testing pools of them. That framing brings known costs and guarantees. Recovering most of the relevant set needs roughly $K\log N$ pooled tests rather than the $K^2\log N$ needed for exact worst-case recovery, where $K$ is the number of relevant features and $N$ the number of candidates. One-sided guarantees are also asymmetric: proving that a step does use certain visual features is cheaper than proving it uses none.

This matters because visual math benchmarks show models often reach right answers through wrong or hallucinated steps. MathVerse shows this, and also finds that some models score higher with the diagram removed. Current monitors look only at output text or at coarse attention ratios. The core claim is that a sparse-feature support recovered with a zero-false-positive guarantee gives a step-level grounding certificate that is cheap enough to compute per step. We claim it detects ungrounded steps better than gradient attribution or attention scores. The same recovered feature set is also a better target for steering than the single heuristic features used today.

What exists and what is different

Two papers already use sparse autoencoders inside vision-language models, and both target object hallucination. Steering LVLMs via Sparse Autoencoder for Hallucination Mitigation (SSL) collapses the features into one "faithful" direction and one "hallucination" direction. SAVE steers along the single best "visual understanding" feature, chosen by a separation score. Neither recovers a per-input set of causally used features, neither offers any recovery guarantee, and neither evaluates multi-step reasoning. They motivate this work because they show sparse features in these models carry visual-reliance signal. They constrain it because they show a single direction already helps, which raises the bar for a multi-feature method.

The closest methodological neighbor is Sparse Relaxed-Lasso Steering (SRLS). It treats choosing sparse autoencoder features as sparse support recovery: a sparse regression (Lasso) selects the features, a refit then removes the regression's shrinkage bias, and the method finds an edit in a diffusion image generator using about 300 features instead of about 7,800. We borrow its view that feature selection is support recovery. We differ in three ways. Our measurements are causal ablations rather than regression on activations. Our object of study is a single reasoning step in a discrete text-generating model rather than one fixed edit direction. And we use one-sided group-testing guarantees, which a Lasso fit does not provide.

Sparse Feature Circuits supplies our candidate-generation tool. It scores features with attribution patching, a fast gradient-based estimate of each feature's effect, and keeps the autoencoder's reconstruction error as an explicit node. It worked only in text models and thresholds those estimates without guarantees. We use attribution patching to narrow the candidate pool, then certify the survivors with real ablations.

On the recovery side, Correction to "Boolean Compressed Sensing and Noisy Group Testing" gives the scaling contrast between approximate and exact recovery. It also shows that dilution noise (relevant items whose effect fails to show up in a test) is strictly worse than additive noise (spurious positives). Optimal Non-Adaptive Group Testing with One-Sided Error Guarantees shows that recovering a subset with zero false positives reaches rate 1. Recovering a superset with zero misses is capped near $\log 2$ because of masking: an irrelevant item that only ever appears in pools alongside relevant ones cannot be cleared. Resolution Limits of Sparse Coding explains why exact recovery is hopeless when some relevant features have tiny effects. Its cost depends on the ratio of the weakest effect to the average effect. To our knowledge, nobody has carried these results into interpretability of multimodal reasoning.

Core Claim

For a reasoning step $s$, let $S_s$ be the set of sparse autoencoder features whose removal at image positions changes $s$. Each pooled test $t$ removes a pool $P_t$ of candidate features at image positions only. It records

$$y_t = \mathbb{1}\left[\log p(s \mid \text{intact}) - \log p(s \mid P_t \text{ removed}) > \tau\right],$$

which ideally equals 1 exactly when $P_t$ overlaps $S_s$. Here $p$ is the model's probability of the step's key tokens and $\tau$ is a threshold. "Removed" means each feature is replaced by its mean value, with the reconstruction error held fixed.

The hypotheses follow from this setup. First, a decoder targeting approximate recovery identifies most of $S_s$ with on the order of $K\log N$ forward passes. Second, a subset certificate ("these visual features are definitely used") is markedly cheaper than a superset certificate ("no other visual features are used"), matching the rate gap between the two problems. Third, steps that the MathVerse step scorer judges wrong or unsupported have systematically small certified visual support. This should hold most strongly in the vision-only variants, where the needed information exists only in the diagram.

The asymmetry has a practical consequence. Flagging a step as grounded can be done reliably and cheaply. Declaring a step ungrounded costs more and inherits masking errors from redundant features. The research program measures how large that cost gap is.

Research Program

We train TopK sparse autoencoders on residual streams at three depths of LLaVA-NeXT-8B, following the SSL and SAVE recipes on ShareGPT4V data. We then do the same for Qwen2-VL, a model SAVE also studied. We include the late layers because CoX-LMM found that image and text representations align only around layers 20 to 25.

For each step of a chain-of-thought on MathVerse and MathVista, the pipeline works in three stages. Attribution patching first prunes candidates to the $N$ features (a few thousand) that are active at image positions and have nonzero estimated effect. We then run non-adaptive Bernoulli pooled ablations, meaning each feature joins each pool independently at random, and decode two ways. A subset decoder declares only features that appear in many positive pools and are never cleared. A superset decoder clears only features that appear in negative pools. Finally, an adaptive variant follows the sequential thresholding idea. It repeatedly drops candidates that fail a likelihood test, which should lower the dependence on $N$ when the true support is small.

We also model the noise in the tests explicitly. Removing large pools can push activations away from anything the model normally sees, as Addressing divergent representations from causal interventions warns, and that produces additive false positives. Redundant backup features produce dilution, or false negatives. We estimate both rates from a calibration set and set the pool density accordingly.

The same pipeline, run at text positions, gives a matching "language support." The grounding score of a step compares the two: it is the certified visual support relative to the total certified support.

Baselines

The naive reference point is no feature-level audit at all. A step is treated as grounded whenever the final answer is correct, which is precisely the assumption MathVerse's "illusion of correctness" breaks. We also include a stronger text-only reference: the MathVerse GPT-4 step scorer applied to the output text alone. It sees what any text monitor sees and nothing internal.

The attention baseline is the Visual Attention Score from AVAR, the share of attention given to image tokens versus instruction tokens, computed per step. AVAR reports that this score correlates with reasoning accuracy at r = 0.9616, so it is a strong, cheap competitor for detecting grounding. It needs no autoencoder and no extra forward passes.

The strongest support-recovery competitor is attribution patching from Sparse Feature Circuits, restricted to image positions and thresholded to the same support size. A second competitor runs SRLS-style relaxed Lasso over the identical random ablation masks and outcomes. This isolates whether the group-testing decoders matter or whether any sparse regression on the same data does equally well.

All methods share the same autoencoders and the same steps. All support-recovery methods get the same forward-pass budget, swept from $0.5$ to $8$ times $K\log N$, and we tune thresholds on a held-out calibration split of equal size for each method. Ground truth comes from exhaustive single-feature ablation over the pruned pool on 300 steps. We supplement it with exhaustive pair ablations on a 50-step subset to measure masking. Attribution patching does not need a budget to run, but we give it the same ground truth.

The key ablation removes the one-sided guarantee: a symmetric, exact-recovery decoder run under the same budget. If it matches the subset decoder's precision at the same cost, then the asymmetry argument contributes nothing.

To count as beating the baselines, the subset decoder must reach precision at or above 0.9 against the exhaustive ground truth at a budget where attribution patching's precision is clearly lower. On grounding detection, it must reach a higher step-level AUROC than both the attention score and the text-only scorer. No reported result for step-level grounding detection on MathVerse was found on Lacuna for any of these baselines, so all of them will be run here.

Why not just…?

Why not just use attribution patching, which needs one backward pass? This is the most serious threat, and the design absorbs it rather than arguing it away: attribution patching is our first stage. What it cannot provide is a certificate. Its scores are linear estimates, and those break down exactly where removing a feature has a saturating or redundant effect. The pair-ablation ground truth measures how often that happens. If attribution alone reaches the same precision as the full pipeline at every budget, then group testing adds nothing for discovery. In that case we would report that outcome and keep only the cost-asymmetry analysis.

Why not just prompt the model to trace the diagram, as in Visually Cued Chain-of-Thought or describe-then-act? Forgotten Polygons reports that visually cued prompting raises GPT-4o's side counting on irregular polygons from 7% to 93% and improves MathVerse by about 5%. That only works when the vertices are labeled in the image, and accuracy falls to 0% on unseen merged shapes. More importantly, prompting changes what the model writes, not whether we can tell that the writing is grounded. We will run the audit on prompted chains too. If prompted steps already show high certified visual support, prompting is sufficient for grounding and the audit's value is limited to verifying that.

Why not just fine-tune with attention-guided training like AVAR? AVAR reports +12.2% on MathVision and +8.8% on HallusionBench from Qwen2.5-VL-7B. It improves models but does not audit individual steps. The audit is complementary, and we will apply it to an AVAR-style model to test whether those gains come with more certified visual support or only with more attention to image tokens.

Why not just steer along SAVE's top-1 feature? SAVE reports CHAIR_S improvements of up to 10 percentage points on LLaVA-1.6, and SSL reduces CHAIR_I from 8.03% to 6.32% on LLaVA-Next-8b. Both are object-presence results. We will compare amplifying the certified per-step visual support against top-1 steering at matched intervention strength. On CHAIR and POPE, top-1 steering may well tie; the real test is MathVerse vision-only, where multi-step dependence should favor feature sets.

Proposed Experiments

The first experiment measures recovery cost. On the 300 ground-truth steps, we plot precision and recall against the forward-pass budget for the subset, superset, symmetric, sequential, Lasso, and attribution methods. The decisive check is whether the subset decoder saturates near $K\log N$ while the superset decoder needs a consistently larger budget. Masking in the pair-ablation data should explain that extra cost.

The second experiment tests grounding detection. Across the six MathVerse versions, from text-dominant to vision-only, we test whether certified visual support shrinks as diagram information becomes essential but the model fails. We also test whether it predicts step errors flagged by the MathVerse scorer better than the attention score does. A clean negative result would be informative here. If certified visual support does not differ between correct and hallucinated steps, then step-level hallucination is not visible in image-position features at all, perhaps because the failure sits in the vision encoder, as Forgotten Polygons argues. In that case the audit moves to the encoder.

The third experiment tests steering. We amplify the certified visual support at steps flagged as low-support and report final-answer accuracy on MathVista (where GPT-4V scored 49.9% and open models 20 to 26% in the original MathVista paper) and on MathVerse vision-only. We compare against SAVE top-1 steering and attention modulation under the same compute.