Mid-level interview question
How does embedding retrieval work, and what's its catch?
Model answer
Embed every chunk once; at query time embed the query with the same model and return the k nearest vectors.
The catch: there's always a nearest neighbour, so it returns k results even when nothing is relevant. A similarity threshold helps, but it's model-specific. It can also struggle outside the domain its model was trained on.
Practise the rest
6 Retrieval algorithms questions, 492 in all, each with a model answer. Free.
More Retrieval algorithms interview questions
- What do TF and IDF measure?
- What does BM25 add to TF-IDF?
- Why is term-based search fast, and what does it never return?
- Exact k-NN is too slow at your scale. What do you give up with an ANN index, and how do you choose one?
- Term-based or embedding retrieval for a support search full of error codes and paraphrased questions?