TowerBridge: a closed-form fix for CLIP retrieval that an LLM agent discovered
The modality gap is exonerated; the fix is a closed-form shrink of the directions where the towers agree more on hard negatives than on matched pairs.

A Virginia Tech team reports that the "modality gap" in CLIP-style dual encoders is not the cause of retrieval failure — removing it post hoc degrades retrieval on every checkpoint they test, while shrinking the directions where the two towers agree more on hard negatives than on matched pairs helps. An LLM agent discovered the correction by editing weights directly (no backpropagation); the team then distilled it into TowerBridge, a closed-form recipe that runs in seconds from 25,000 labelled pairs and improves retrieval on all 21 CLIP checkpoints they evaluate, leaving architecture and inference cost unchanged.
What shipped
TowerBridge is a post-hoc weight edit for contrastive dual encoders (CLIP and similar image-text models). It targets the failure mode where a hard negative — a high-scoring wrong match — outranks the correct one.
The paper's central negative result upends the usual story. The modality gap, the separation between the image and text regions of the shared embedding space, has long been treated as the culprit behind retrieval failures. The authors report that removing it post hoc degrades retrieval on every CLIP checkpoint they test, and that prior methods that remove mean or top-variance directions without pair labels (centering, all-but-the-top) also lower retrieval. The two leading hard-negative directions, they find, "align with the common mean and the modality gap" — removing them hurts every checkpoint, while shrinking them by 10% helps every one.
The mechanism is a paired statistic, D, that identifies "directions where the two towers agree more on hard negatives than on matched pairs." It compares the mean outer product of normalized embeddings on matched pairs versus on hard negatives (by default the 5 hardest wrong images per caption and 25 hardest wrong captions per image). The eigenvalues of its symmetric part decompose the margin between matched and hard-negative agreement along orthogonal directions; negative eigenvalues mark directions where hard negatives agree more than matched pairs. A 10% shrink of these directions gains +12.5 COCO validation RSUM on average, versus at most +0.3 for the same number of top principal directions chosen without pair labels.

The correction was discovered through weight-space programming: an LLM agent named Astra inspects both towers and writes short programs that edit weights directly, without gradients, free to touch any component "from attention heads to output projections." One session per checkpoint on 13 CLIP checkpoints produced a patch each; 12 of the 13 final patches rewrite an output projection (the final projection layer into the shared embedding space), and most mildly attenuate the directions identified by D. Astra improves COCO test retrieval on all 13 checkpoints, +12.2 RSUM on average.
TowerBridge is the distilled, agent-free version of that recurring correction. Three steps: compute D from 25,000 labelled pairs; apply a 10% shrink in both output projections to the quarter of directions that most favour hard negatives; then re-mine hard negatives on the edited embeddings and apply a second, smaller shrink. The shrink is written as S = I − 0.10·UUᵀ. It takes seconds per model, needs no model-specific tuning, and leaves the architecture and inference cost unchanged. The recipe is motivated by a first-order analysis of the hard-negative margin, which establishes optimality of the uniform shrink for a bilinear margin surrogate under per-direction and total contraction constraints.
Why it matters
The headline numbers, all author-reported: +16.8 RSUM average on COCO test retrieval and +6.6 on Flickr30k test across all 21 evaluated CLIP checkpoints, including 8 the agent never saw (3 of which were downloaded after the recipe was fixed). ImageNet zero-shot accuracy drops by no more than 0.5 points on any checkpoint. Hubness — the tendency for a few "hub" embeddings to dominate retrieval — is reduced on all 21 checkpoints, with the median share of text-to-image misses landing on hub images falling from 28% to 19%. For OpenAI's ViT-B/16, 41% of text-to-image misses on COCO concentrate on hub images. Retrieval improves on 4 of 5 dual encoders from other families, and TowerBridge beats the agent's own patches on all 13 checkpoints that had a session.
RSUM is the paper's retrieval metric: the sum of recall at 1, 5, and 10 in both directions — R@1 + R@5 + R@10 for text→image plus the same for image→text, six recall terms out of a maximum of 600.
Two things are actionable for engineers building retrieval. First, the practical fix is cheap and model-agnostic: a closed-form shrink of a quarter of the directions in both output projections, computed in seconds from a labelled pair set, with zero inference overhead and a bounded zero-shot tradeoff. Second, the meta-lesson: this is a concrete, deployable case of an LLM agent doing weight-space programming — a backprop-free weight edit that transfers to checkpoints the agent never saw and beats the agent's own patches once distilled into a recipe. That is a template for turning agent-discovered corrections into shipping code.
Caveats
This is a preprint (v1, 23 Nov 2026), not peer-reviewed, and every number above is author-reported with no independent human replication. Code is not yet released — a secondary source says the authors plan to release source, prompts, and logs — so the headline gains are not yet reproducible by third parties.
The recipe is not fully unsupervised: it needs 25,000 labelled image-text pairs to compute D, and it targets contrastive dual encoders, not generative vision-language models. The theoretical justification is for a bilinear margin surrogate while evaluation is under cosine retrieval; the paper's defense is empirical (the uniform shrink beats an eigenvalue-weighted shrink), with a derivative analysis in the supplement. The default hard-negative counts (5 per caption, 25 per image) are not ablated, which a machine review flags as the strongest remaining objection. Only ImageNet zero-shot accuracy is cited as the classification safeguard. The exact list of the 21 checkpoints and the names of the 5 "other dual encoder families" are not stated in the accessible text.
Sources
- arXiv abstract: https://arxiv.org/abs/2611.31233v1
- arXiv full text (HTML): https://arxiv.org/html/2611.31233v1
- Machine review of the full text: https://pith.science/paper/2611.31233
- Secondary coverage: https://www.bioscience.com.pk/en/subject/technology/towerbridge-bridging-the-dual-encoder-modality-gap-via-weight-space-programming