Mid-level interview question
What does BM25 add to TF-IDF?
Model answer
Two corrections to term frequency:
- Saturation: the tenth mention adds less than the first (parameter k1).
- Length normalisation: long documents contain terms by chance, so their counts are discounted (parameter b; 0 turns it off).
It's still a strong baseline. On the course's help-centre data, length alone decides which of two equally matching toy articles wins.
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?
- Why is term-based search fast, and what does it never return?
- How does embedding retrieval work, and what's its catch?
- 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?