In short: Embeddings in RAG are lists of numbers that represent the meaning of a piece of text. Both your document chunks and the user’s question are converted into these vectors by the same model, and retrieval works by finding the chunks whose vectors sit closest to the question’s vector. The embedding model decides what “close” means, which makes it the single component that defines what your system can and cannot find.
Every guide to embeddings in RAG explains the same thing: text goes in, numbers come out, similar meanings sit near each other. That part is genuinely simple and it is covered well in a dozen places.
Almost none of them answer the question an engineer actually has after shipping: what happens when you need to change the model?
That turns out to be the hardest operational problem in RAG, it has an active academic argument running through it right now, and the pages ranking for this keyword do not mention it at all. This guide covers the fundamentals properly, then goes where they stop.
This page goes deep on one layer of the retrieval stack. If you are still deciding how the whole pipeline should be shaped, start with Agentic RAG vs Traditional RAG and come back here.
What you will get here
- How text actually becomes a vector, including the step most guides skip
- Why the leaderboard’s top model is usually the wrong pick, with measured numbers
- Storage arithmetic you can run against your own corpus
- What embeddings are genuinely bad at, and what to pair them with
- The migration problem, and why two 2026 papers disagree about the fix
On this page
- What are embeddings in RAG?
- Where embeddings sit in a RAG pipeline
- Choosing a model: the leaderboard trap
- Dimensions, storage, and Matryoshka
- How chunk size and embedding quality interact
- What embeddings are genuinely bad at
- The migration problem
- How to evaluate on your own data
- Production checklist
- Frequently asked questions
What are embeddings in RAG?
An embedding model is a neural network that reads text and outputs a fixed-length list of floating-point numbers. For text-embedding-3-small that list is 1,536 numbers long by default. For many open models it is 768 or 1,024.
Those numbers are coordinates. Text with similar meaning lands in a similar region of that space, so “forgot my login” and “reset my password” end up near each other even though they share no words. That is the entire trick, and it is why embeddings in RAG can retrieve by meaning instead of keyword overlap.
The step most explanations skip
Guides tend to say “the model converts text to a vector” and move on. The actual sequence matters, because two of these steps are where your retrieval quality is decided:
- Tokenise. The text is split into subword tokens from a fixed vocabulary. BERT’s is around 30,000 entries. Words outside it are assembled from pieces.
- Contextualise. Transformer layers produce one vector per token, and each token’s vector is shaped by the tokens around it. This is why “river bank” and “investment bank” get different vectors for the same word.
- Pool. You now have one vector per token but you need one per passage. The model collapses them, usually by averaging (mean pooling) or by taking a designated
[CLS]token. This is the lossy step. A 500-token chunk is compressed into the same 1,024 numbers as a 10-token chunk. - Normalise. Vectors are usually scaled to unit length, which makes cosine similarity and dot product equivalent and keeps long passages from dominating purely by magnitude.

Figure 1: The four stages that turn a passage into one vector. Pooling is the lossy step — a 500-token chunk is compressed into the same number of dimensions as a 10-token one.
Step 3 is why chunking and embedding are not independent decisions, and step 4 is why a model that skips normalisation will quietly rank long chunks higher. Neither point appears in the pages currently ranking for this keyword.
Where embeddings sit in a RAG pipeline
Embeddings in RAG do two jobs, not one, and they happen at completely different times. The retrieval layer comes down to four decisions: how you split your documents, how you turn each piece into a vector, where you store those vectors, and how you fetch them back at query time. This page covers the second. Get it wrong and the other three cannot save you.
| Phase | What gets embedded | When |
|---|---|---|
| Indexing | Every document chunk | Once, ahead of time |
| Query | The user’s question | On every request |
| Retrieval | Nothing — vectors are compared | On every request |
The non-negotiable rule: the query and the chunks must be embedded by the same model. Vectors from two different models — or even two versions of the same model — are not comparable. They describe positions in different spaces.

Figure 2: The indexing path runs once, the query path runs on every request, and the same model has to sit on both sides.
The asymmetry nobody mentions
Many retrieval models are trained with separate instructions for queries and passages. E5 and BGE families expect prefixes like query: and passage:. Jina’s v3 goes further and swaps in a different LoRA adapter depending on whether you are encoding a retrieval.query or a retrieval.passage, with five task-specific adapters totalling under 3% of the model’s parameters.
Skip the prefix and you lose quality silently. Nothing errors. Recall just drops, and you spend a week blaming your chunker.
Choosing an embedding model: the leaderboard trap
Most advice reduces to “check the MTEB leaderboard and take the top one.” The MTEB paper itself says otherwise.
MTEB covers 8 tasks across 58 datasets and 112 languages, and benchmarked 33 models. Its headline finding, stated in the abstract:
“We find that no particular text embedding method dominates across all tasks.”
That is the benchmark’s authors telling you the ranking does not transfer. Section 4.2 is blunter still: no model claims state of the art across even the seven English tasks.
Three reasons the top entry misleads you
1. The overall average is not a retrieval score. MTEB averages classification, clustering, summarisation, STS and retrieval together. A model tuned for sentence similarity can rank high overall and fail at retrieval. One 2026 benchmarking report measured exactly this: LaBSE and mMPNet, both strong similarity models, scored 0.188 and 0.243 average nDCG@10 on retrieval — against 0.638 for the best model in its set.
2. The leaderboards disagree with each other. As of late 2026, third-party roundups variously place Qwen3-Embedding-8B, QZhou-Embedding, Yuan Embedding 2.0, Nemotron-3-Embed-8B or voyage-4-large at the top, depending on whether they cite MTEB English, MTEB multilingual, or the newer retrieval-specific RTEB board. Qwen3-Embedding-8B is the most consistently high-ranked open model across sources, but the top spot moves. Check the official MTEB and RTEB leaderboards yourself rather than trusting any blog’s table, this one included.
3. Quality is not the only axis. From the same 2026 report’s measured latency:
| Model type | Avg nDCG@10 | Median latency | Cost |
|---|---|---|---|
| Commercial API (top scorer) | 0.638 | 231.6 ms | $0.025 / 1M tokens |
| Multilingual E5-large | 0.546 | ~31 ms | self-hosted |
| E5-large | 0.538 | ~31 ms | self-hosted |
The best model was 7 to 14 times slower for a 0.09 nDCG gain. On an interactive assistant where embedding latency lands on every keystroke-triggered query, that trade is often not worth making.

Figure 3: Retrieval quality plotted against median latency. The top scorer buys 0.09 nDCG@10 for roughly 7× the response time.
Source: Baidya, “Choosing a Text Embedding Model”, arXiv:2607.23507, July 2026. Single-author technical report, not peer reviewed; its top model is a commercial API reported under an alias. Treat the ranking as directional and the latency gap as the durable finding.
A selection order that works
- Retrieval score, not overall score. Filter the leaderboard to retrieval, or use RTEB.
- Your language. Multilingual averages hide wide per-language variance.
- Your domain. If your corpus entities are findable on the open web, a general model will likely handle them. If they are internal codes, part numbers or clinical shorthand, test a domain model or plan to fine-tune.
- Sequence limit vs your chunk size. A model with a 512-token limit silently truncates your 800-token chunks.
- Latency and cost at your query volume.
- Licence. Several strong open models, including Jina v3, ship under CC BY-NC — non-commercial.
- Then test on your own queries. Everything above only narrows the shortlist.
Dimensions, storage, and the Matryoshka escape hatch
Dimension count is the number nobody does arithmetic on. Here it is, for one million chunks at float32:
| Dimensions | Bytes per vector | 1M chunks | 10M chunks |
|---|---|---|---|
| 1,536 | 6,144 | 6.1 GB | 61 GB |
| 1,024 | 4,096 | 4.1 GB | 41 GB |
| 768 | 3,072 | 3.1 GB | 31 GB |
| 384 | 1,536 | 1.5 GB | 15 GB |
| 256 | 1,024 | 1.0 GB | 10 GB |
Add your ANN index on top — an HNSW graph is a substantial multiplier, not a rounding error. Halve every figure if you store float16.
The obvious move is to pick a smaller model. The better move is Matryoshka Representation Learning (MRL), which trains a model so that the leading dimensions remain useful on their own. You store 1,024 numbers, then truncate to 256 at query time and the vector still works.
The measured effect, from Hugging Face’s write-up comparing an MRL-trained mpnet-base against the standard version on STSBenchmark:
At 8.3% of the embedding size, the Matryoshka model preserved 98.37% of its performance — against 96.46% for the standard model truncated the same way.
Two practical notes the write-up is explicit about: re-normalise after truncating, and the speed-up is downstream only — generating a short embedding is no faster than generating a long one, you simply store and search less. Jina v3 supports truncation down to 32 dimensions; models that are not MRL-trained degrade far more steeply when you cut them.

Figure 4: Index size by dimension count for one million chunks, and where Matryoshka truncation lets you cut storage without retraining.
How chunk size and embedding quality interact
Because pooling compresses a whole chunk into one vector, chunk length changes what survives. The 2026 benchmarking report measured this directly across six models:
- Every model reached at least 95% of its peak nDCG@10 by 32 tokens per chunk.
- Below roughly 16 tokens, quality collapsed for every model tested.
- At 16 tokens, semantic chunking beat fixed-size chunking by 0.090 nDCG@10 on the top model and 0.075 on the next.
Read that carefully, because it cuts both ways. There is a hard floor — fragments under ~16 tokens are not retrievable, which is exactly why enforcing size bounds after any splitter matters. But above ~32 tokens the embedding model stops being the constraint, and chunk size becomes a question about what the generator needs, not what the retriever can encode.

Figure 5: Retrieval quality against chunk length. Quality plateaus by about 32 tokens and collapses below roughly 16.
What embeddings are genuinely bad at
Vector similarity is a blunt instrument in four specific ways, and knowing them saves you from blaming the wrong component:
| Failure | Why it happens | Fix |
|---|---|---|
| Exact identifiers — part numbers, error codes, SKUs | A rare token contributes little to a pooled vector | Hybrid search with BM25 |
| Negation — “contracts without an arbitration clause” | “with” and “without” are near-neighbours in embedding space | Metadata filters, or a reranker |
| Dates and numbers | Numerals carry weak semantic signal | Structured metadata, not vectors |
| Very short or ambiguous queries | Two words give the model nothing to contextualise | Query expansion, or a reranker |
The standard fix is to stop relying on vectors alone. Anthropic’s measured results, using 1 − recall@20 as the retrieval failure rate against a 5.7% baseline:
| Configuration | Failure rate | Reduction |
|---|---|---|
| Embeddings only | 5.7% | — |
| + context prepended to each chunk | 3.7% | −35% |
| + BM25 hybrid search | 2.9% | −49% |
| + reranking (150 → top 20) | 1.9% | −67% |
Adding BM25 alongside dense retrieval cut failures from 3.7% to 2.9% on its own. If your RAG system has no keyword path, that is the cheapest improvement available to you — and no page currently ranking for this keyword mentions it.
Anthropic also notes that while contextual retrieval helped across every embedding model they tested, some models benefited more than others — another reason the leaderboard cannot pick for you.

Figure 6: Retrieval failure rate falling from 5.7% to 1.9% as context, keyword search and reranking are layered on top of embeddings.
The migration problem: what happens when you change the model
This is the section the other guides do not have, and it is the one that costs real money.
Vectors from different models cannot be mixed. Not across providers, not across versions of the same model, not even when the dimension count happens to match. They are coordinates in unrelated spaces. So the day you want to upgrade your embedding model, you face re-encoding your entire corpus and rebuilding your ANN index.
For a million chunks that is hours of GPU time and a service interruption. For ten million it is a project.
The proposed shortcut
Drift-Adapter (Vejendla, Rutgers, EMNLP 2025) trains a small transform that maps new-model query vectors back into the old model’s space, so the existing index keeps serving. You fit it on ~20,000 paired old/new embeddings — 2% of a million-item corpus.
Reported results on 1M-item corpora:
| Metric | Result |
|---|---|
| Recall retention vs new model | 95–99% (Recall@10, MRR) |
| Added query latency | 3.0 – 9.8 µs |
| Adapter training cost | ~0.5 GPU-hr vs ~100 GPU-hr for full re-index |
| AG-News Recall@10 ratio | 0.652 unadapted → 0.992 with an MLP adapter |
The paper is candid that this defers full re-computation rather than eliminating it, and that it degrades when the architecture change is drastic — it tested GloVe-300d → MPNet-768d and saw a 28.5% recall drop. (arXiv:2509.23471)
The 2026 rebuttal
A November 2026 paper from Northwestern Polytechnical University — “When the Bill Falls: Reusing the Old Index Defers, Never Avoids, Re-encoding” — attacks the framing directly. Its argument:
“Reuse never avoids re-encoding: if migration must complete, every strategy eventually encodes every document.”
And more sharply, it says 95–99% is measured against the wrong baseline. An adapter is only worth deploying if it beats the old model you are already serving, not if it approximates the new model you have not deployed. Measured that way, on 15 model pairs across MS MARCO, NQ and CodeSearchNet:
- A Procrustes adapter reached 46.8% of the bar needed to beat the old model on one representative pair.
- The best of five adapter families reached 64%.
- Only a bridge between two LLM embedders of the same family (Qwen3-0.6B → 8B) cleared the old model at all, and the authors call that margin “too small to count as an improvement.”
Their alternative is window re-ranking: let the old index nominate a deep candidate set, re-score it with the new model, and encode those documents inline as traffic arrives. On their worked pair, that served within 0.0023 Recall@10 of the new model after re-encoding only 26.4% of the corpus — while a background blue-green rebuild had encoded just 3% by the same point and was still serving the full quality gap. (arXiv:2611.20702)
What to actually do
The two papers use different corpora and model pairs, so neither falsifies the other’s measurements. What they jointly establish is clearer than either alone:
- Same model family, modest upgrade? An adapter may genuinely hold quality. Validate it against your old model’s recall, not the new one’s.
- Different family or a big architecture jump? Adapters will not save you. Plan the re-encode.
- Cannot take downtime? Window re-ranking pays the cost gradually in the order your traffic actually needs it.
- Either way, budget for the full re-encode. It is deferred, not cancelled.

Figure 7: Three ways to change embedding model, compared on how much of the corpus gets re-encoded, when quality recovers, and what downtime costs.
The cheapest version of this problem is the one you avoid. Pin your model version explicitly, store the model name and revision as metadata on every vector, and treat a silent provider-side model update as a production incident — because it is one.
How to evaluate on your own data
Microsoft’s RAG guidance calls retrieval performance “the most practical way to evaluate embedding quality,” and warns that public benchmarks “might not directly apply to your business data.” Both correct. Neither tells you how.
It also suggests plotting embeddings with t-SNE and judging distance visually. Do not use that to compare models. t-SNE does not preserve global distances — two points that look far apart on the plot may not be, and the same data replotted with a different random seed will look different. It is a tool for spotting cluster structure, not for measuring retrieval.
Here is a method that actually produces a decision:
- Build a gold set of 50–100 real queries. Take them from your logs or your support inbox. For each, mark which chunk should be returned. This is the only step that requires effort and the only one you cannot skip.
- Shortlist 3 models using the selection order above. Include one small fast model as your baseline — you need to know what you are paying extra for.
- Index the same chunks with each. Same splitter, same size bounds, same metadata. Change one variable.
- Measure recall@10 and nDCG@10 against your gold set.
- Measure p95 embedding latency at your real query concurrency, not single-request latency on an idle machine. One paper notes a shared host raised their measured latency by up to 3×.
- Compute index size from the table above and price it on your actual infrastructure.
- Pick on the whole picture. If the expensive model wins by two points of nDCG and costs 8× the latency, the cheap one wins.
Then re-run it whenever you change chunking, add a corpus, or your provider ships a new model version.
Production checklist
- ☐ Model name and revision pinned, not floating on a provider alias
- ☐ Model version stored as metadata on every vector, so you can tell what encoded what
- ☐ Query and passage prefixes applied if your model expects them
- ☐ Chunk sizes above ~32 tokens — below ~16 they are not retrievable at all
- ☐ Chunk size under the model’s sequence limit, or you are silently truncating
- ☐ Vectors normalised before cosine similarity
- ☐ BM25 running alongside dense retrieval, with rank fusion
- ☐ A reranker on the top 100–150 before the LLM sees anything
- ☐ Metadata filters for dates, IDs and numeric ranges — not vector search
- ☐ A gold query set you re-run on every pipeline change
- ☐ A written migration plan with a re-encode cost estimate, before you need it
Frequently asked questions
Does RAG need an embedding model?
For semantic retrieval, yes. The embedding model is what lets RAG match a question to a passage that answers it without sharing its words. The only RAG systems that skip embeddings are pure keyword systems built on BM25 or similar, which work well for exact identifiers but fail on paraphrase. Most production systems run both and fuse the results — Anthropic measured adding BM25 to dense retrieval cutting the retrieval failure rate from 3.7% to 2.9%.
How do you create RAG embeddings?
Split your documents into chunks, send each chunk to an embedding model, and store the returned vector alongside the original text and its metadata in a vector database. At query time, send the user’s question to the same model and search for the nearest stored vectors. The two rules that matter: use one model for both sides, and record which model and revision produced each vector.
What is embedding and chunking in RAG?
Chunking decides where documents are cut; embeddings in RAG decide how each piece is represented as numbers. They are sequential and coupled. Because an embedding model pools a whole chunk into one fixed-length vector, chunk length changes what survives. Measured across six models, retrieval quality reached 95% of peak by 32 tokens per chunk and collapsed below about 16.
How do you choose an embedding model for your RAG system?
Filter the leaderboard to retrieval rather than the overall average, check your language and domain, confirm the model’s sequence limit exceeds your chunk size, check the licence, then benchmark your shortlist on 50–100 of your own queries. The MTEB paper states plainly that no single model dominates across tasks, and one 2026 report found the highest-scoring model was 7–14× slower for a 0.09 nDCG gain.
What is the best embedding model for RAG in 2026?
There is no single answer, and be sceptical of any article that gives one. Across late-2026 sources, Qwen3-Embedding-8B is the most consistently top-ranked open model, but different roundups name different leaders depending on which benchmark they cite. Rankings also change monthly. Check the official MTEB and RTEB leaderboards, shortlist two or three, and let your own gold query set decide.
How many dimensions should my embeddings have?
Enough for quality, no more. One million chunks at 1,536 dimensions is 6.1 GB of raw vectors before index overhead; at 256 dimensions it is 1.0 GB. If your model is Matryoshka-trained you can store the full vector and truncate at query time — one measurement retained 98.37% of performance at 8.3% of the dimensions. Re-normalise after truncating.
Can I change my embedding model later?
Yes, but it means re-encoding your whole corpus and rebuilding the index, because vectors from different models are not comparable. Adapters that map between embedding spaces exist and report 95–99% recall retention relative to the new model, but a 2026 paper argues the correct baseline is the old model and finds most adapter families fall short of it. Pin your model version from day one and store it with every vector.
Do embeddings understand dates and numbers?
Poorly. Numerals and dates carry weak semantic signal, so “contracts signed after March 2024” will not reliably retrieve by vector similarity. Store those as structured metadata and filter on them. The same applies to negation — “without an arbitration clause” sits very close to “with an arbitration clause” in embedding space.
1 thought on “What Are Embeddings in RAG? The Hidden Engine Behind Every Retrieval System”