What is the modality gap in CLIP-style embedding spaces, and when does it actually bite you?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Even though CLIP trains images and text into one shared space, the two modalities do not interleave: they occupy separate cones. The nearest caption to an image sits at a much lower cosine similarity than the nearest other image does. That separation is the modality gap.
Full worked answer
Even though CLIP trains images and text into one shared space, the two modalities do not interleave: they occupy separate cones. The nearest caption to an image sits at a much lower cosine similarity than the nearest other image does. That separation is the modality gap.
It comes from two things. Random initialisation already puts each encoder's outputs in a narrow cone (the cone effect), and the contrastive loss never has any reason to close the distance: it only needs the matched pair to rank above the mismatched ones within a batch, which relative ordering achieves fine while both cones stay far apart. The learned temperature interacts with how tightly each cone concentrates.
Where it bites, in order of how often it burns people:
- Thresholds do not transfer. A rule like "cosine above 0.3 means a match" tuned on text-to-image is meaningless for image-to-image, where typical similarities are far higher. Calibrate a separate threshold per modality pair, on your own data.
- Mixed-modality indices skew. Put text documents and images in one ANN index and a text query will preferentially pull text, because same-modality neighbours are simply closer. Fix by keeping per-modality indices and fusing the ranked lists, or by mean-centring each modality's embeddings before scoring.
- Arithmetic across modalities is shakier than it looks. Averaging an image embedding with a text embedding lands you between two cones, in a region the model never trained on.
The misconception worth pre-empting: the gap is not straightforwardly a bug that better training removes. Retrieval only needs correct ranking within a modality, which is why CLIP works well despite it, and forcing the gap closed does not reliably improve downstream quality. Treat it as a calibration and indexing constraint, not a defect to fix.
What a good answer covers
- Even though CLIP trains images and text into one shared space, the two modalities do not interleave
- The nearest caption to an image sits at a much lower cosine similarity than the nearest other image does
- That separation is the modality gap
- Random initialisation already puts each encoder's outputs in a narrow cone (the cone effect), and the…
- The learned temperature interacts with how tightly each cone concentrates
Key terms: Thresholds do not transfer · Mixed-modality indices skew
In the glossary: CLIP · Cosine similarity · Modality gap · Temperature · ANN · Calibration
Interviewer follow-ups to expect
How would mean-centring per modality change your retrieval results, and what could it break?
If you had to compare "how similar is this image to this caption" against "how similar is this image to that image" in one ranking, how would you make the scores comparable?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep