BM25 › Key Parameters
Michael BrenndoerferUpdated March 21, 20262 min read
Language AI HandbookAll chapters Part 2 of 67Classical Text Representations
BM25 › Key ParametersOne section · Sections in this chapter13 / 14 ↓
Sections in this chapter14
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Understanding BM25's parameters is essential for tuning retrieval performance:
| Parameter | Typical Value | Range | Effect |
|---|---|---|---|
k1 | 1.2 | 0.0 - 3.0 | Controls term frequency saturation. Lower values cause faster saturation. Higher values make scoring more linear with term frequency. |
b | 0.75 | 0.0 - 1.0 | Controls length normalization strength. At 0, document length is ignored. At 1, term frequencies are fully normalized by document length. |
delta (BM25L/BM25+) | 0.5 - 1.0 | 0.0 - 2.0 | Additive constant ensuring minimum contribution from term matches. Higher values boost scores for documents with query terms. |
Tuning guidance:
- Start with defaults (, ): These work well for most text collections and are the defaults in Elasticsearch and Lucene.
- Increase (toward 2.0) when term frequency is highly informative, such as in longer documents where repeated mentions indicate relevance.
- Decrease (toward 0.5) for collections where a single mention is as informative as multiple mentions, such as short documents or when keyword stuffing is a concern.
- Decrease (toward 0.25) when document length variation is meaningful, for example, when longer documents contain more relevant information rather than just more filler.
- Increase (toward 1.0) when longer documents tend to match queries spuriously due to containing more vocabulary.
- Use BM25+ or BM25L when your collection has highly variable document lengths and you observe short, relevant documents being ranked too low.