What happens to BM25, hybrid search and semantic ranking when the embedding model changes?
Part 6 of 7 in the Embedding Migration in Production series (change the model, not the reliability): engineer-level, on Azure AI Search and Microsoft Foundry, mapped to Microsoft exam AI-103.
TL;DR for managers. Changing the embedding model changes only the vector half of hybrid search. Keyword (BM25) results stay exactly the same, and the semantic ranker still reads the same text. But because the vector results change, the merged ranking and the candidates the semantic ranker sees change too. Swap the model first with every other setting unchanged, measure, and only then re-tune weights, thresholds and index parameters, one at a time.
Most production RAG systems on Azure don't run pure vector search. They run hybrid search (BM25 keyword search plus vector search, merged with Reciprocal Rank Fusion), and often the semantic ranker on top. When the embedding model changes, which of those pieces change? In part 5 we saw that BM25-only results should match exactly between the old and new index. This part goes through the rest of the stack.
What changes and what doesn't
| Component | Depends on the embedding model? | What to do |
|---|---|---|
| BM25 full-text search (analysers, text fields, BM25 parameters) | No | Copy unchanged; identical results are your parity check |
| Filters and security trimming | No | Copy unchanged and test anyway: the permission data was re-written during the backfill |
| Vector leg (nearest neighbours) | Yes | Measure retrieval quality and ANN recall on the new field |
| HNSW parameters, compression, oversampling | Indirectly | Re-check after the swap; tuned values don't automatically carry over |
| RRF fusion | Formula no, inputs yes | Expect a different merged order; re-tune vector weights later |
| Semantic ranker | Model no, candidates yes | Re-check reranker score thresholds on the new candidates |
| Thresholds on raw vector scores | Yes | Re-calibrate; never carry them over |
BM25: the part that shouldn't move
BM25 scores text with an inverted index. It doesn't use vectors at all. If you copied the text fields, analysers and similarity settings unchanged (part 2), keyword results on the new index are identical, question for question. That gives you a cheap, strict test: run the golden set as BM25-only on both indexes and diff the results. Any difference means a document is missing, a field differs or an analyser changed, and needs fixing before quality comparisons mean anything.
The vector leg: new neighbours, possibly new tuning
This is where the migration happens. The new model puts chunks in different places, so each question's nearest neighbours change. Two things deserve a separate check.
ANN recall. HNSW is approximate. Parameters such as m, efConstruction and
efSearch trade speed for how often it finds the true nearest neighbours, and settings chosen for 1,536
ada-002 vectors may behave differently for 3,072 text-embedding-3-large vectors. Measure it by comparing HNSW results
with an exhaustive search on the same field, as in our hybrid
search article:
# ANN recall on the NEW field: HNSW parameters tuned for the old vectors may not suit the new ones.
def ann_recall(question_vectors, field, k=50):
total = 0.0
for v in question_vectors:
approx = ids(search.search(None, vector_queries=[VectorizedQuery(
vector=v, k_nearest_neighbors=k, fields=field)], top=k))
exact = ids(search.search(None, vector_queries=[VectorizedQuery(
vector=v, k_nearest_neighbors=k, fields=field, exhaustive=True)], top=k)) # brute force
total += len(set(approx) & set(exact)) / k
return total / len(question_vectors) # e.g. 0.97 means HNSW finds 97% of the true top 50
Compression. If you enabled scalar or binary quantisation on the new field to fit the capacity budget, re-check oversampling and rescoring too. Microsoft's guide says to review compression and similarity settings "rather than assuming that settings tuned for the old model remain appropriate".
RRF: same formula, different inputs
Hybrid search merges the two result lists with Reciprocal Rank Fusion: each chunk scores 1/(60 + rank) from each list it appears in, and the sums decide the order. The formula and k = 60 don't change. The vector ranks do. An illustrative example with two chunks:
| Chunk | BM25 rank | Vector rank (old model) | RRF (old) | Vector rank (new model) | RRF (new) |
|---|---|---|---|---|---|
| A | 3 | 2 | 1/63 + 1/62 = 0.0320 | 9 | 1/63 + 1/69 = 0.0304 |
| B | 8 | 15 | 1/68 + 1/75 = 0.0280 | 1 | 1/68 + 1/61 = 0.0311 |
BM25 didn't change at all, yet B now ranks above A. Whether that's an improvement is exactly what the golden set in
part 5 decides. It also explains why vector weight values tuned on the old model may no longer be right:
the weight multiplies the vector leg's contribution, and the vector leg now behaves differently. And because hybrid
scores depend on how many legs a query has, don't threshold on them either.
The semantic ranker: same judge, different shortlist
The semantic ranker re-ranks the top 50 results using the text in your semantic configuration (title, content and
keyword fields), not the vectors. Its model doesn't change when yours does. What changes is the shortlist of 50 it
receives, because that comes from the hybrid results above. Its @search.rerankerScore runs from 0 to 4
with a documented meaning for each level, so it's a much better basis for an "I couldn't find this" cut-off than any
vector score. But the distribution of scores on your questions can still shift when the shortlist changes, so re-check
any reranker threshold on the golden set, including the no-answer questions.
Raw vector scores: never carry thresholds over
Some applications drop results below a fixed similarity, say 0.80. Cosine similarities from different models live on different scales: one model's typical relevant match might score 0.85, another's 0.45. Microsoft's validation checklist says to "review score-based thresholds rather than assuming raw vector scores are comparable across models". Either re-calibrate on the golden set or, better, move the cut-off to the reranker score.
Change one thing at a time
The temptation is to fix everything at once while the index is being rebuilt anyway. Resist it. A sequence that keeps every result explainable:
- Release 1, the swap: new model, everything else identical. Evaluate all four modes (BM25, vector, hybrid, hybrid + semantic). BM25 must match; the others show the model's effect.
- Release 2, re-tuning: on the new index only, tune the vector weight, HNSW parameters, compression and reranker threshold, each measured on the golden set.
- Release 3, optional: chunking or enrichment changes, as their own versioned experiment.
Each release goes through the same shadow, canary and rollback process from part 4.
# Step 2 (a separate release): tune the vector leg's weight in hybrid queries on the new index.
for w in (0.5, 1.0, 1.5, 2.0):
runs = [search.search(q.text, vector_queries=[VectorizedQuery(
vector=q.vector, k_nearest_neighbors=50, fields="content_vector_v2", weight=w)],
filter=q.security_filter, top=10) for q in golden]
print(w, mean_ndcg_at_10(runs, golden))
Common mistakes
- Assuming the semantic ranker "fixes" a weaker embedding model. It can only re-order the 50 candidates it's given.
- Keeping a vector similarity threshold from the old model.
- Tuning weights and HNSW at the same time as swapping the model, so no one can say which change did what.
- Skipping the BM25 parity check, then chasing "model regressions" that are really missing documents.
Key takeaways
- BM25 and filters don't change: identical keyword results prove data parity.
- The vector leg changes, which changes RRF order and the semantic ranker's shortlist.
- Re-calibrate thresholds and weights after the swap, on the new index, as a separate release.
- Prefer reranker scores over raw vector scores for "no good answer" cut-offs.
Next, part 7: the production playbook that ties it together, with release gates, permissions, monitoring, cutover and retiring the old index safely.
References
- Relevance scoring in hybrid search using Reciprocal Rank Fusion
- Semantic ranking
- Relevance in vector search
- Evaluate quality and operations
Learning this for AI-103? Microsoft's AI-103 exam (Azure AI Apps and Agents Developer Associate) covers implementing RAG with Azure AI Search, vector and hybrid search, and monitoring retrieval quality. Our live online AI-103 course builds these pipelines hands-on in Microsoft Foundry and Azure AI Search, on UK time, with mock assessments before you book the exam.
The Embedding Migration in Production series
Change the model, not the reliability.
- Part 1: Your embedding model is being retired
- Part 2: Why you can't simply swap embedding models
- Part 3: Re-embedding 10 million documents
- Part 4: Blue-green migration for Azure AI Search
- Part 5: Did the new model improve retrieval?
- Part 6: BM25, hybrid and semantic ranking (you are here)
- Part 7: The enterprise migration playbook
- Bonus: Document permissions in a migration