What is the difference between similarity search and semantic search?
- 1 min — mechanism vs goal.
- 2 min — relatedness vs relevance; why rerankers and HyDE exist.
- 2 min — metric choice and ANN approximation knobs.
Similarity search is the mechanism: find the nearest vectors under a distance metric. It's agnostic about what the vectors mean. Semantic search is the goal: return results that match the user's intent. You can do similarity search over vectors that encode nothing semantic — image histograms, say — and that's not semantic search. And semantic search can be achieved with other mechanisms, including a well-tuned lexical system with query expansion.
The practical consequence: cosine similarity measures relatedness, not relevance to a question. A question and its answer are often less similar than the question and a rephrasing of the question. This is precisely why reranking exists, and why HyDE works.
Two short additions that land well: the metric must match how the model was trained (cosine for normalised embeddings, dot product where magnitude carries information), and vector search in production is approximate — HNSW and IVF trade recall for speed, so there's a tuning knob (efSearch, nprobe) that silently affects quality.
Org scope: the platform team should publish the measured ANN recall and the metric per index as part of the index contract, so product teams don't each rediscover that their 'semantic search' is running at 88% of exact recall.
What the answer sounds like at each level
Similarity search finds nearest vectors; semantic search means results match intent, which similarity search only approximates.
Explains relatedness vs relevance with a question/answer example, names asymmetric embedding models and query prefixes, and knows ANN is approximate.
Treats the distance metric and ANN recall as part of an index's published contract and decides where a reranker or HyDE is needed to bridge relatedness to relevance.
Follow-ups the interviewer will push
1Your model expects 'query: ' and 'passage: ' prefixes and you forgot them. What happens?
Recall drops quietly — often several points of nDCG on MTEB-style retrieval tasks — because the model was trained asymmetrically. Nothing errors. Catch it with a golden-set check whenever the embedding call path changes.
2When does HyDE help and when does it hurt?
It helps when queries are short and answers are long-form prose, because a generated hypothetical answer lands nearer real answers than the question does. It hurts on identifier lookups and when the LLM hallucinates domain specifics; it also adds a full LLM call (300–800ms) to retrieval latency.
Red flags interviewers listen for
- Uses 'semantic search' and 'vector search' as synonyms without qualification.
- Doesn't know the metric has to match the model's training objective.
- Assumes ANN returns the exact nearest neighbours.
How it's scored
| Dimension | What strong looks like |
|---|---|
| Precision | Separates mechanism from goal with a counter-example in each direction. |
| Practical consequence | Explains why cosine similarity is not relevance and what bridges the gap. |
| Production awareness | Mentions metric/model match and ANN recall knobs. |
Sources
- Precise Zero-Shot Dense Retrieval without Relevance Labels (HyDE) — Gao et al., 2022paper
- Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs — Malkov & Yashunin, 2016paper