Flash Cards · Vector stores

Flash Card: The Silent Distance-Metric Bug

July 15, 2026 · 3 min read

Exam-style

After swapping to a new embedding model, retrieval quality collapses. Ingestion completes without error, every query returns the requested number of results, and spot checks show the embeddings themselves look reasonable. What is the first thing to check?

Reveal the answer

E. Confirm the index distance metric and dimension count match what the new embedding model expects

Distance metric is a silent setting: an index built for Euclidean distance still accepts and ranks cosine-trained embeddings, it just ranks them badly, and dimension mismatches fail in similarly quiet ways. Nothing errors, results still come back, and the quality drop looks like a retrieval-tuning problem. Widening top-k, reranking, or hybrid search will each paper over a little of the damage while leaving the ranking function wrong underneath.

Generative AI Development · part of The Exam Room

Q. Retrieval quality is poor even though the embeddings look fine. What silent config is worth checking?

A. The index distance metric must match how the embedding model was trained (cosine, Euclidean/L2, or dot product). A mismatch quietly wrecks ranking, and the vector dimensions must match the model too.

Why? Dimension and distance-metric mismatches produce plausible-but-wrong retrieval, a classic trap.

These posts are LLM-aided. Backbone, original writing, and structure by Craig. Research and editing by Craig + LLM. Proof-reading by Craig.