When a vision-language system is asked "Who designed this bridge?", the hard step is usually not reasoning over the retrieved Wikipedia text. It is working out which bridge is in the photo. On the INFOSEEK benchmark, a retrieve-then-read pipeline scores 18.2% on human-written questions. Handing the same reader the correct entity raises that to 45.6% (Hu et al.). Most of the lost accuracy is lost at entity linking: matching an image to the right entry in a knowledge base. That matching is almost always done with a plain dot product over every dimension of a pretrained image embedding such as CLIP's, as if every dimension mattered equally for every decision.
This proposal argues that this assumption is wrong in a specific, testable way. Which embedding dimensions carry signal depends on context, and the most informative context is the set of candidates the query is being confused with. Telling two warblers apart calls for different dimensions than telling two suspension bridges apart. Many dimensions are redundant inside a given neighborhood, because they encode the scene type that all nearby candidates already share. We propose a small network that reads the query embedding together with its top-K retrieved candidates. It outputs a sparse, nearly binary mask over embedding dimensions, and the candidates are then rescored with the masked similarity. The context is unstructured and comes from the retrieval itself. That is the main departure from prior context-dependent feature selection, which assumes context arrives as a clean, separate, low-dimensional variable.
Core Claim
Entity linking errors in knowledge-intensive visual question answering come largely from dimensions that are uninformative within the local candidate neighborhood, such as background, lighting, and dominant scene texture. They do not come mainly from a lack of cross-item interaction capacity. If that is true, then a sparse, neighborhood-conditioned dimension mask on frozen embeddings, with well under a million parameters, should recover a large share of the gap between first-stage retrieval and oracle linking. It should also beat an unconstrained reranker of the same size most clearly on entities never seen during training.
Three lines of prior work support this claim and supply the method. Conditional Stochastic Gates use a hypernetwork that maps context variables $z$ to the parameters of relaxed Bernoulli gates over features. On the synthetic Moving XOR task they reach 100% accuracy, where global selection methods plateau at 70–74%. Their stated limit is that $z$ must be explicit and low-dimensional, and we remove that limit. Sutera et al. separate features that become more informative once context is known (context-complementary) from those that become less informative (context-redundant). We reuse this distinction as a diagnostic. Gula et al. show that in pretrained CNN features the high-variance directions encode background, while fewer than ten well-chosen components reach 100% AUROC on some MVTec-AD categories, and extra components hurt. This finding constrains the design: variance-based compression is the wrong tool, and selection has to be driven by the task.
Mechanism
Let $q \in \mathbb{R}^D$ be the frozen image embedding of the query. Let $\mathcal{N}_K(q) = \{e_1,\dots,e_K\}$ be the embeddings of the top-K knowledge-base entities from first-stage retrieval, where each entity is represented by its reference image and name embedding. A permutation-invariant set encoder $h_\phi$ maps $(q, \mathcal{N}_K(q))$ to gate means $\mu \in \mathbb{R}^D$. Each candidate is rescored as
$$ s(q, e_k) = \sum_{d=1}^{D} g_d\, q_d\, e_{k,d}, \qquad g_d = \min(1, \max(0, \mu_d + \epsilon_d)), \quad \epsilon_d \sim \mathcal{N}(0, \sigma^2), $$
where $g_d$ is the gate on dimension $d$, using the truncated-Gaussian relaxation from c-STG. Training minimizes a softmax cross-entropy over the K candidates with the gold entity as target, plus $\lambda \sum_d \Phi(\mu_d/\sigma)$. That term is the expected number of open gates, with $\Phi$ the standard normal CDF and $\lambda$ the sparsity weight. At test time $\epsilon = 0$. Optionally, the set encoder can also take the question text embedding as context. That variant is kept as an ablation, because we want to know whether the neighborhood alone carries the context.
Two design choices separate this mechanism from a generic reranker. The gates are shared across all K candidates for a given query, so the model can only choose which axes to compare along. It cannot memorize scores for particular candidates. The sparsity penalty also forces it to commit to a small number of dimensions. Together these form the inductive bias that we predict will transfer to unseen entities.
Research Program
The work has three parts. The first builds the gated linker on top of frozen CLIP and EVA-style embeddings over the INFOSEEK 100k-entity knowledge base and the Encyclopedic VQA (E-VQA) entity base. It is trained on the training splits with entity labels derived from Wikidata. The second is an analysis study. We take the learned masks, cluster queries by coarse entity type (taxon, landmark, artifact), and adapt Sutera et al.'s characterization measure, treating the coarse type as the discrete context. The question is whether the dimensions the gates close are the context-redundant ones, those carrying information globally but not within the type. We also check whether the closed dimensions line up with the top principal components, as Gula et al.'s result predicts. The third measures downstream effect by passing the linked entity's passage to a fixed reader. For the reader we use FiD, matching the INFOSEEK protocol, so that any change in answer accuracy can be attributed to linking.
Directions are weighted unevenly on purpose. Context-dependent importance is the mechanism. External knowledge integration is the application, and entity linking within it is the bottleneck. Feature redundancy is the hypothesis about why the mechanism helps. The cross-modal gap enters through the paired image and name embeddings of each entity. Following Tsai et al., we expect a pairwise contrastive space to be well aligned at matched points but poorly organized locally. Neighborhood-conditioned gating is one way to repair that locally without retraining the space.
Baselines
The naive reference point is the frozen first-stage retriever itself: ungated CLIP similarity over the knowledge base, which is the linker inside the CLIP + FiD pipeline. Its downstream number is reported as 18.2% on INFOSEEK-Human, with the oracle-entity ceiling at 45.6% (Hu et al.). We rerun this baseline with our own reader and knowledge base so all numbers share one pipeline. Beating it means a statistically reliable gain in Top-1 entity recall and a corresponding rise in reader accuracy.
The strongest existing method is EntRAG (Hu et al.). It binds entity tokens to visual features (EntBind), reranks with a combined entity-plus-relevance score (ECRanker), and generates the answer. It reports 44.5 accuracy on InfoSeek and 46.1 on E-VQA, and a Top-1 entity recall gain of 5.7% on InfoSeek and 1.3% on E-VQA over prior linkers. The file gives no absolute Top-1 entity recall for EntRAG; there is no reported result found on Lacuna for that figure. We will therefore reproduce its entity-linking stage on the same knowledge base and compare recall directly. We will also report end-to-end accuracy with our gated linker inserted ahead of its generator. Beating EntRAG means at least matching its Top-1 recall with a much smaller linking module, or exceeding it on the unseen-entity split.
The cross-encoder reference is the multimodal reranker of Wen et al.. It runs PaLI-3B jointly over each question–candidate pair and reports 52.6% on OK-VQA, with an oracle ceiling of 64.4%. We run a smaller cross-encoder of the same family over the same top-K under a matched training budget. We report recall alongside latency per query, because the case for gating rests on cost as well as accuracy.
The decisive ablations isolate the key ingredient. Global gates use one mask learned for the whole dataset, which is standard stochastic gates; this tests whether context matters at all. Query-only gates condition on $q$ alone without the neighborhood. An unconstrained per-dimension reweighting uses the same set encoder but has no sparsity penalty and no clamping. Finally, a cross-attention reranker of matched parameter count scores each candidate separately and has no shared mask. All variants use identical frozen embeddings, top-K, training data, optimizer, and a fixed hyperparameter search budget of equal trials.
Why not just…?
Why not just fine-tune the image encoder, or train a linear adapter on top of it? This is the most serious threat. An adapter learns a single global change of basis, so it can suppress background directions everywhere. If background is the whole story, an adapter will match our method and the context-dependence claim fails. We test this directly with the global-gate and linear-adapter baselines at equal training budget. Our prediction is that both close part of the gap and then plateau on fine-grained neighborhoods such as taxa, where the useful axes differ between bird genera and plant genera. If they do not plateau, we will report that the effect is global redundancy and nothing more.
Why not just use a cross-encoder reranker like Wen et al.'s? Cross-item attention is strictly more expressive than a shared mask. It beats Flamingo-80B on OK-VQA (Wen et al.), but at the cost of a 3B-parameter pass per candidate. Our claim is not that gating beats it on seen entities. The claim is that gating keeps most of its recall at a tiny fraction of the cost, and generalizes better to entities missing from training because it cannot memorize candidates. The matched-size cross-attention reranker and the unseen-entity split settle this. If the small reranker matches gating on unseen entities, the inductive-bias claim is refuted.
Why not just add the question text to the query embedding? Question text helps when the question names the type ("which bird"). It does not help when two candidates of the same type differ in fine detail, which is where INFOSEEK's linking errors concentrate. The question-conditioned gate variant measures exactly how much question text adds once the neighborhood is available. We would treat a large gain there as evidence that the neighborhood is an incomplete context.
Why not just apply PCA or keep the top principal components? Gula et al. show that the leading components of pretrained features encode background, and that adding components beyond a small selected set degrades performance. PCA therefore keeps the wrong directions. We include PCA truncation at several ranks as a cheap baseline. We expect it to lose to the ungated retriever at low ranks.
Why not just use a bigger end-to-end model? PaLI-X reaches 10.8% on INFOSEEK-Human, below the simple CLIP + FiD pipeline at 18.2% (Hu et al.). Scale alone does not solve long-tail entity identity.
Proposed Experiments
The primary metric is Top-1 and Top-5 entity recall on INFOSEEK (Wikidata and Human splits) and E-VQA. Each benchmark is split into entities seen and unseen during training. The secondary metric is downstream answer accuracy with a fixed FiD reader. The third is latency and parameter count of the linking stage.
The first decisive check is the context test. Neighborhood-conditioned gates must beat global gates and a linear adapter on the unseen-entity split by a margin larger than run-to-run variation over three seeds. The second is the sparsity test. Sparse gates must match or beat the unconstrained reweighting of equal size on unseen entities, even if they trail it on seen ones. The third is the redundancy diagnostic. Within each coarse entity type, closed dimensions should be enriched for context-redundant dimensions under the adapted Sutera measure and overlap with high-variance principal components more than chance. Average open-gate count should fall well below $D$ and vary across types.
A negative result on any of these checks would be informative. If global gates suffice, then fine-grained linking failure is a fixed property of the embedding space and not a context effect. If the matched reranker wins on unseen entities, then shared sparse masks are the wrong inductive bias. Either outcome would redirect effort, toward retraining embeddings in the first case or toward cheaper cross-encoders in the second.
References
- Can Pre-trained Vision and Language Models Answer Visual Information-Seeking Questions?
- Contextual Feature Selection with Conditional Stochastic Gates
- Context-dependent feature analysis with random forests
- Gaussian Image Anomaly Detection with Greedy Eigencomponent Selection
- Learning Robust Visual-Semantic Embeddings
- EntRAG: Entity-Centric Retrieval-Augmented Generation for Knowledge-based Visual Question Answering
- Multimodal Reranking for Knowledge-Intensive Visual Question Answering