1.  [](/)
2.  [Diagrams](/diagrams)
3.  The Modality Gap: A Shared Space Is Really Two Cones

[Back to Diagrams](/diagrams)IR Foundations

# The Modality Gap: A Shared Space Is Really Two Cones

Why cross-modal retrieval underperforms same-modality retrieval in one shared space.

![Train a dual encoder like CLIP and you would expect a matched image and its caption to land at nearly the same point in the shared space. They do not. All image embeddings occupy one narrow cone of the hypersphere and all text embeddings occupy a different, well-separated cone, and the two clouds barely overlap. A matched pair is closer to each other than to mismatched pairs, but both still sit inside their own modality's region, separated by a roughly constant offset vector. Three forces create and preserve it: a dual encoder runs each modality through a separate network with no shared weights, InfoNCE only requires a matched pair to outscore in-batch negatives which is satisfied with every image in cone A and every caption in cone B, and at initialization each encoder's outputs already occupy a small cone while a low softmax temperature sharpens matched against unmatched pairs without pulling the cones together. The model was trained to rank, not to register.](/diagrams/modality-gap.webp)Full screen

Why cross-modal retrieval underperforms same-modality retrieval in one shared space.

Train a dual encoder like CLIP and you would naively expect a matched image and its caption to land at nearly the same point in the shared space. They do not. All image embeddings occupy one narrow region, a cone, of the hypersphere, and all text embeddings occupy a different and well-separated region. The two clouds barely overlap.

A matched pair is still closer to each other than to mismatched pairs, which is why retrieval works at all. But both sit inside their own modality's cone, separated by an offset that is roughly constant in direction. Two facts make this counterintuitive. The gap is large relative to the within-modality spread, so raw cosine similarity is dominated by which-modality-is-this before it ever gets to what-does-this-mean. And because the offset is consistent, it is fixable.

Three forces create it and then keep it there. A dual encoder runs images through one network and text through another with no shared weights, so nothing forces the two into the same region of the output space. The contrastive objective only rewards a matched pair for scoring above the in-batch negatives, and that is perfectly satisfied with every image in cone A and every caption in cone B. And at initialization each encoder's outputs already occupy a small cone, while a low softmax temperature sharpens matched against unmatched pairs without ever pulling the cones together.

The cleanest framing: the model was trained to rank, not to register. Ranking is preserved by the gap; alignment is not, and nothing in the loss ever asked for alignment.

This is also why an absolute similarity threshold cannot transfer across modality pairs. A 0.3 text-to-image score can be as strong a match as a 0.7 image-to-image score, because the two are measured across different distances in the same space.

## Where this diagram appears

*   [Guide: The Modality Gap in Cross-Modal Retrieval →](/guides/modality-gap-cross-modal-retrieval)

Run this on your own data

Mixpeek turns video, images, audio, and documents in your object storage into searchable, timestamped results through one API.

[Search your own data](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=diagram_detail&utm_campaign=mvs_onramp)

## Related diagrams

[

![Diagram placing BM25, SPLADE and dense embeddings on a single axis measuring how much vocabulary survives compression, with what each one stores and why production systems run more than one.](/diagrams/sparse-vs-dense.webp)

Sparse and Dense Are One Spectrum, Not Two Camps



](/diagrams/sparse-vs-dense)[

![A 3072-dimensional embedding encodes everything about a video and distinguishes nothing: lighting, camera angle, dominant color, who is on screen, the room and the vibe of the room are all smeared across the same floats at equal weight, with no name you can filter on. That is why a search for a person holding a coffee cup returns videos with people, videos with cups, and a surprising number with neither, and why reranking and hybrid BM25 each help only a little. Decomposition is where the dimension reduction actually lives: a shot detector turns a thirty-second video into eight scenes with timestamps, a face identity model turns a frame into bounding boxes and 512-dimension face embeddings, a multimodal extractor turns a scene into a Gemini embedding plus OCR output plus dominant colors, and a custom plugin does the same for a proprietary file type. Each extractor's output becomes its own collection with its own schema and its own embedding space, so the features are named and filterable where a smear is not. Reduction alone leaves a smarter vector database; the leverage is placement. A new ad is placed against a brand taxonomy at ingest, and because the taxonomy that locates it is the same retriever a user invokes to ask for ads in that brand, enrichment and search become one traversal in two directions. Six primitives compose in one direction: bucket, extractor, collection, retriever, taxonomy, cluster.](/diagrams/the-3072-dimension-problem.webp)

The 3072-Dimension Problem: Reduce, Then Place



](/diagrams/the-3072-dimension-problem)[

![An ordinary embedding model spreads information across all dimensions with no ordering guarantee, so dimension 900 may carry as much signal as dimension 5 and truncating the vector discards random pieces of meaning. Matryoshka Representation Learning changes the objective so the model packs the most general information into the front of the vector and progressively finer detail toward the back, which makes every prefix a complete usable coordinate. The nesting is drawn as five bars that all start at dimension 0 and grow: the first 64 dimensions carry coarse semantics, enough to tell a cat photo from a car photo; 128 is the prefix the retrieval cascade indexes the whole corpus at; 256 gives mid resolution, enough to separate breeds of cat or a refund request from a refund confirmation; and the full 1024 gives fine resolution for ranking near-duplicates. The mechanism is a modified loss rather than a special architecture: one forward pass produces one d-dimensional output, the training loss is computed independently at each prefix size in the set 64, 128, 256, 512, 1024, and those losses are summed, so the front of the vector has to work on its own. What it buys is a retrieve-coarse, rerank-fine cascade: index 10,000,000 items at a 128-dimension truncation costing 5.1 GB instead of the full 41 GB, retrieve a top-200 shortlist with the truncated query, fetch the full 1024-dimension vectors for those 200 candidates only, and return a final top 10.](/diagrams/matryoshka-representation-learning.webp)

Matryoshka Representation Learning: One Vector, Five Resolutions



](/diagrams/matryoshka-representation-learning)