Concept guide · Embeddings and vector search
What should happen when you change an embedding model?
A slower explanation for when the short interview answer is not enough. Start with the intuition, then connect it to the technical idea and the way an interviewer expects you to reason about it.
ML area
Generative AI → Embedding migrations
Interview format
Core · Concept
Question
GENAI-045
Start with the idea
In simple terms
When an embedding model changes, build a new versioned index instead of mixing old and new vectors. Re-embed, compare the new search results with a baseline, and switch only after the new index is trustworthy.
Make it concrete
Keep `docs-v1` serving while `docs-v2` is built, evaluate both on the same labelled queries, then canary the new index and retain v1 for rollback.
Build the answer
How to reason about it
- 1Version the corpus, embedding model, preprocessing, and index together.
- 2Evaluate retrieval and downstream answers before changing traffic.
- 3Keep rollback, cache invalidation, and re-embedding cost explicit.
Go one level deeper
The technical explanation
Vector dimensions, metric assumptions, preprocessing, and semantic geometry can all change between models. A safe migration includes an immutable corpus snapshot, reproducible embedding configuration, metadata and permission checks, retrieval evaluation, freshness verification, cost estimation, and a dual-read or canary strategy. Delete the old index only after rollback and cache invalidation are understood.
Say this in the interview
Build a new versioned index, re-embed the corpus, validate retrieval against the old baseline, and switch traffic deliberately. Do not mix incompatible vectors in one similarity space. Keep the old index until the new one passes quality, freshness, permission, and rollback checks.
Keep preparing