Skip to content
sinc-LLMBook a 15-minute call
Page signal: 10 sections as samples, joined by sinc reconstruction; computed from this page's text.

How to Choose an Embedding Model for RAG Retrieval

A practical guide to picking and testing an embedding model for RAG on your own data, with metrics, cost math, and a decision table.

Quick Answer & Verified Key Facts

Direct Answer: Choose an embedding model for RAG by shortlisting 3-4 models from MTEB, then testing on 50 to 200 real queries with known answers, scoring recall@10 and nDCG@10, and weighing storage, price, and language needs. Pick the cheapest model that meets your recall threshold.

On this page

Pick an embedding model by testing a few candidates on your own queries, not by reading a leaderboard. Build a small set of real questions with known answers, score each model with recall@k and nDCG, and then weigh storage, price, and language needs. Public benchmarks help you shortlist. Your own test decides.

By Mario AlexandreLLM Performance & Reliability

Choosing an embedding model starts with your own data

The best embedding model for your RAG system is the one that finds the right chunks for your users' real questions. A leaderboard rank does not tell you that. A small test on your own data does.

This guide walks through that test step by step. It covers what an embedding model does, how to read public benchmarks, how to build a test set, how to score it, and how to weigh cost. It ends with a decision table and a checklist.

This page is about the first stage of retrieval: turning text into vectors and finding near neighbors. It does not cover how to rerank the results. For that second stage, see our guide to reranking for RAG retrieval. It also does not cover how to split documents. For that, see RAG chunking strategies. Both choices interact with the embedding model, so we point to them where it matters.

An embedding model reads a piece of text and returns a list of numbers. Texts with similar meaning get lists that point in a similar direction. Search then becomes a math problem: find the stored vectors closest to the query vector.

OpenAI's launch post for its third-generation models puts it in plain terms. It calls an embedding "a sequence of numbers that represents the concepts within content such as natural language or code." That is the whole idea. The rest is about how well a given model maps your text, and how much it costs to store and search those numbers.

If you want the geometry behind this, our post on embedding distance and linear algebra covers cosine similarity and dot products in more depth.

Why dense search finds what keyword search misses

Keyword search looks for the same words. Dense search looks for the same meaning. The Sentence Transformers guide to retrieve and re-rank states the gap clearly. It says lexical search "will not recognize synonyms, acronyms or spelling variations." Dense search can.

That is the main reason teams add embeddings to search. A user asks "how do I cancel my plan" and the doc says "end your subscription." A keyword match fails. A good embedding model links the two.

Why dense search also misses things

Dense search has the opposite weak spot. It can blur exact strings. Anthropic's contextual retrieval post gives a clean example. A user searches for the error code "TS-999." An embedding model "might find content about error codes in general, but could miss the exact" code. BM25, a keyword method, finds it.

So the choice of model is only part of the story. We come back to hybrid search later in this guide.

Three ways a model can score a query against a document

There are three main designs for scoring a query against a document. They trade speed for accuracy in different ways. Most RAG stacks use the first one for recall and may add the second one on top.

Bi-encoders embed each side alone

A bi-encoder embeds the query and each document on their own. The Sentence Transformers docs say a bi-encoder "produces embeddings independently for your paragraphs and for your search queries." You embed all your chunks once, store them, and only embed the query at search time.

This is what people mean by "an embedding model." It is fast, because the hard work happens ahead of time. It scales to millions of chunks with a vector index. The cost is that the model never sees the query and the document together, so it can miss fine detail.

Cross-encoders read both sides together

A cross-encoder reads the query and one document at the same time. Per the Sentence Transformers docs, the pair "is passed simultaneously to transformer network, which then outputs a single score between 0 and 1 indicating how relevant the document is for the given query."

That joint read makes cross-encoders more accurate. It also makes them slow at scale. The same docs warn that "scoring thousands or millions of (query, document)-pairs would be rather slow." So cross-encoders are used as rerankers on a short list, not as the first stage. Our reranking guide covers that stage.

Late interaction keeps one vector per token

Late interaction sits between the two. ColBERT is the best known example. Its authors write that ColBERT "independently encodes the query and the document using BERT and then employs a cheap yet powerful interaction step that models their fine-grained similarity."

The key point is that ColBERT can still "pre-compute document representations offline." But it stores many vectors per chunk, one per token, instead of one. That raises storage a lot. It can be worth it when your queries hinge on small details that a single vector blurs.

Comparing the three designs

Design What it stores Speed at query time Typical role in RAG
Bi-encoder One vector per chunk Fast, scales to millions First stage retrieval
Late interaction (ColBERT) One vector per token Medium First stage or rerank when detail matters
Cross-encoder Nothing ahead of time Slow, runs per pair Rerank a short list

The BEIR benchmark paper tested all of these styles. It found that "re-ranking and late-interaction-based models on average achieve the best zero-shot performances, however, at high computational costs." It also found that dense and sparse models "are computationally more efficient but often underperform other approaches." That is the core trade you are making.

Public benchmarks are good for a shortlist

Public benchmarks let you skip models that are clearly weak. They do not tell you which model will win on your data. Use them to cut a list of fifty models down to four.

What MTEB measures

The MTEB paper set out to fix a real problem. Before it, models were often tested on one task. MTEB "spans 8 embedding tasks covering a total of 58 datasets and 112 languages." Retrieval is one of those tasks. Others include clustering, classification, and reranking.

The most useful line in the paper is its main finding. The authors wrote: "We find that no particular text embedding method dominates across all tasks." Keep that in mind when you read the leaderboard. The top overall score blends tasks you may not care about.

The MTEB toolbox now calls itself a "Multimodal toolbox for evaluating embeddings and retrieval systems." You can run its tasks on any model with a few lines of Python. Its README shows the core call as results = mteb.evaluate(model, tasks=tasks). That makes it easy to rerun the retrieval tasks that look most like your data.

What MMTEB adds

MMTEB is a larger, community-built version of MTEB. It covers "over 500 quality-controlled evaluation tasks across 250+ languages." It adds tasks such as "instruction following, long-document retrieval, and code retrieval."

One finding stands out for buyers. The MMTEB authors report that "the best-performing publicly available model is multilingual-e5-large-instruct with only 560 million parameters." Bigger LLM-based models did well on some subsets. But a mid-sized model led overall. Size is not a proxy for fit.

What BEIR measures

BEIR is focused on retrieval only. It uses "a careful selection of 18 publicly available datasets from diverse text retrieval tasks and domains." It tests models zero-shot, which means on domains they were not trained on. That is close to the RAG case, where your docs are new to the model.

BEIR's headline result is humbling for dense models. The authors found that "BM25 is a robust baseline." A plain keyword method held up well against neural models on new domains. The E5 paper later claimed that "E5 is the first model that outperforms the strong BM25 baseline on the BEIR retrieval benchmark without using any labeled data." That shows how strong BM25 was.

Where public benchmarks fall short

Benchmarks have limits you should name before you trust them.

  • Domain gap. Benchmark text is often news, science, or web pages. Your text may be contracts, tickets, or code.
  • Query style gap. Benchmark queries are often clean. Real users type short, messy, or half-formed questions.
  • Averaging. A blended score can hide a weak retrieval score behind strong scores on other tasks.
  • Leakage risk. Public test sets are public. A model may have seen similar text in training.
  • Version drift. Leaderboards change. A rank from six months ago may not hold today.

None of this makes benchmarks useless. It means they answer "which models are worth testing," not "which model should we ship."

A small in-domain eval set decides the winner

The single most useful thing you can build is a small test set from your own data. It does not need to be big. It needs to be real.

An eval set for retrieval is a list of queries. Each query has one or more chunk IDs that count as correct answers. You run each query through each candidate model, look at the top results, and check whether the correct chunks show up.

Step 1: collect real queries

Pull queries from places where users already ask questions. Good sources are search logs, support tickets, chat logs, and sales questions. Aim for 50 to start. Grow toward 200 over time.

Avoid writing queries by reading a chunk and asking about it. Those queries tend to reuse the chunk's exact words. They make every model look good, and they hide the cases where users phrase things in their own way.

Step 2: label the correct chunks

For each query, find the chunk or chunks that answer it. Record their IDs. If two chunks both help, mark both. If one is a full answer and one is partial, you can grade them, for example 2 for full and 1 for partial. Graded labels let you use nDCG later.

Label against a fixed chunking of your corpus. If you change chunk size later, you must relabel or map the old IDs. This is one more reason to settle chunking early. Our chunking strategies guide covers the options.

Step 3: cover the hard cases on purpose

Make sure the set includes the queries that break search. Add a few of each kind that shows up in your data.

  • Exact codes, SKUs, error IDs, and version numbers.
  • Acronyms and internal jargon.
  • Questions in each language your users write in.
  • Questions whose answer sits in a long table or a long section.
  • Questions that mix two topics.
  • Questions with no answer in the corpus, to test score thresholds.

That last group matters for later tuning. Our post on how to choose a RAG retrieval score threshold uses them.

Step 4: freeze it and version it

Store the eval set in version control with the date and the corpus snapshot. Do not edit it in place while you compare models. If you add queries, make a new version and rerun every candidate. Otherwise your numbers stop being comparable.

Recall@k, MRR, and nDCG measure different things

Three metrics cover most retrieval testing. Recall@k asks whether the right chunk made the cut. MRR asks how high the first right chunk ranked. nDCG asks how good the whole ranking was, with credit that fades as you go down.

For a wider view that also scores the generated answer, see our guide to RAG evaluation metrics. Here we stay with retrieval only.

Recall@k

Recall@k is the share of correct chunks that appear in the top k results. If a query has one correct chunk and it shows up in the top 10, recall@10 for that query is 1. If it does not, recall@10 is 0. Average across queries.

Recall@k is the metric that matters most for RAG. If the right chunk is not retrieved, the LLM cannot use it, and no prompt can fix that. Anthropic's contextual retrieval study used this framing. Its authors wrote: "We use 1 minus recall@20 as our evaluation metric." In plain words, they counted how often the right chunk failed to make the top 20.

MRR

The name stands for mean reciprocal rank. For each query, find the rank of the first correct chunk. Take one over that rank. A hit at rank 1 scores 1. A hit at rank 2 scores 0.5. A hit at rank 4 scores 0.25. A miss scores 0. Average across queries.

MRR rewards putting the best chunk at the top. It is useful when you only pass a few chunks to the LLM.

nDCG

The name stands for normalized discounted cumulative gain. Each correct chunk earns credit. The credit shrinks the lower it ranks, using a log scale. The total is then divided by the best possible total, so the score runs from 0 to 1.

nDCG handles graded labels and more than one correct chunk. It is the main metric on BEIR and on the MTEB retrieval tasks. Use it when your queries often have several useful chunks.

Worked example: scoring five queries

This is illustrative arithmetic with made-up ranks, not a measured result. Suppose you run five queries through one model. Each query has one correct chunk. Here is where that chunk landed.

Query Rank of correct chunk Recall@5 Reciprocal rank DCG (1 over log2 of rank plus 1)
A 1 1 1.000 1.000
B 3 1 0.333 0.500
C 2 1 0.500 0.631
D not in top 10 0 0.000 0.000
E 5 1 0.200 0.387

Now average each column.

  • Recall@5 is 4 hits out of 5 queries, so 0.80.
  • MRR is (1 + 0.333 + 0.5 + 0 + 0.2) divided by 5. That is 2.033 over 5, or about 0.41.
  • nDCG@5 is (1 + 0.5 + 0.631 + 0 + 0.387) divided by 5. That is 2.518 over 5, or about 0.50. With one correct chunk per query, the best possible DCG is 1, so no extra step is needed.

Read the three numbers together. Recall@5 says the model usually finds the chunk. MRR and nDCG say it often does not put it first. A reranker could help here. Query D is a true miss. Look at it by hand. It may be an exact code that needs BM25, or a chunk that got cut badly.

Which metric to use as the main bar

Pick one metric as your pass bar so the choice is clear. For most RAG systems, use recall at the number of chunks you pass to the LLM. If you pass 10 chunks, use recall@10. Track nDCG@10 next to it to see ranking quality. Use MRR if you pass only one to three chunks.

Dimensions drive storage and memory cost

Every vector takes space. The space grows with the number of chunks and the number of dimensions. Before you pick a large model, do the storage math.

OpenAI states the trade directly. Using larger embeddings "generally costs more and consumes more compute, memory and storage than using smaller embeddings." Its large model, text-embedding-3-large, "creates embeddings with up to 3072 dimensions."

Worked example: storage for one million chunks

This is illustrative arithmetic. The inputs are one million chunks and 32-bit floats, which take 4 bytes per number. It counts raw vectors only. Index overhead, metadata, and replicas come on top.

Dimensions Bytes per vector Raw size for 1,000,000 vectors
3072 3072 x 4 = 12,288 about 12.3 GB
1536 1536 x 4 = 6,144 about 6.1 GB
1024 1024 x 4 = 4,096 about 4.1 GB
768 768 x 4 = 3,072 about 3.1 GB
256 256 x 4 = 1,024 about 1.0 GB

Going from 3072 to 256 dimensions cuts raw size by a factor of 12 in this example. Many vector indexes keep vectors in RAM for speed. So the gap shows up in your server bill, not only in disk use. Search is also faster on shorter vectors, since each distance takes fewer steps.

Matryoshka embeddings let you cut dimensions

Some models are trained so that the first part of the vector holds most of the meaning. You can then cut off the end and keep a shorter vector. This is called Matryoshka Representation Learning, after the nested dolls.

The Matryoshka paper says the method "allows a single embedding to adapt to the computational constraints of downstream tasks." It also "imposes no additional cost during inference and deployment." On image tasks, the authors report "up to 14x smaller embedding size for ImageNet-1K classification at the same level of accuracy." That result is for images, so treat it as a sign of what is possible, not a promise for your text.

OpenAI built the same idea into its API. Per its launch post, developers "can shorten embeddings (i.e. remove some numbers from the end of the sequence) without the embedding losing its concept-representing properties by passing in the dimensions API parameter." It also reported that "a text-embedding-3-large embedding can be shortened to a size of 256 while still outperforming an unshortened text-embedding-ada-002 embedding with a size of 1536" on MTEB.

How to test truncation safely

Do not assume a short vector is good enough. Test it.

  1. Embed your eval corpus once at full size.
  2. Make copies cut to a few sizes, such as 1024, 512, and 256.
  3. Normalize each cut vector again if you use cosine or dot product.
  4. Run your eval set on each size and record recall@k and nDCG@k.
  5. Pick the smallest size where recall stays within the margin you set.

Only cut vectors from models trained for it. If a model was not trained with Matryoshka loss, cutting its vectors can hurt quality a lot. The model card should say whether it supports this.

Max input length must fit your chunk size

Every embedding model has a max input length in tokens. Depending on the library or API, text past that limit may be cut off silently or rejected with an error. Check which one yours does. If your chunks are longer than the limit, the end of each chunk is never embedded.

Short-context models

Many strong open models were built for short passages. The E5 authors note that they "set the maximum text length to 512 for evaluation." A 512-token limit is common for models of that design. It is fine for chunks of a few hundred tokens. It is not fine for chunks of a thousand.

Long-context models

Some newer models accept much longer inputs. BGE-M3 handles inputs "spanning from short sentences to long documents of up to 8,192 tokens." That lets you embed whole sections or short documents in one go.

Long input is not free. One vector for a long text has to summarize a lot. Detail can wash out. A long limit gives you room to choose bigger chunks. It does not mean bigger chunks will retrieve better. Test both.

Worked example: a silent truncation check

This is illustrative arithmetic. Suppose your chunker targets 700 tokens and your model's limit is 512. Then up to 188 tokens at the end of each full chunk are dropped. If answers often sit at the end of a section, recall will suffer and nothing will warn you.

The check is simple. Count tokens for every chunk with the model's own tokenizer. Report how many chunks exceed the limit. If more than a handful do, either shrink the chunks or pick a model with a longer limit. Our chunking guide explains how to pick a chunk size that fits.

Language coverage and model features change the shortlist

Some needs rule models in or out before you test recall. Language is the big one. Prefixes and multi-mode output are two more.

Multilingual needs

If your users or documents span several languages, pick models trained for that. BGE-M3 offers "semantic retrieval of more than 100 working languages." In MMTEB, the top public model was a multilingual E5 variant. OpenAI also published scores on MIRACL, a multilingual retrieval benchmark, for its models.

Test cross-language queries on purpose. A user may ask in Portuguese about a document in English. Make sure your eval set has a few of these if they happen in your product.

One model, three retrieval modes

BGE-M3 is unusual in another way. Its paper says it can do "dense retrieval, multi-vector retrieval, and sparse retrieval" from one model. Dense output works like a normal bi-encoder. Multi-vector output works like ColBERT. Sparse output works like a learned keyword index.

That can simplify a hybrid stack, since one model feeds both sides. It does not remove the need to test. Check each mode on your eval set and see which mix wins.

Instruction and prefix formats

Some models expect a marker at the start of each input. The E5 authors write: "We use a shared encoder for all input texts and break the symmetry by adding two prefix identifiers." Those prefixes are "query:" and "passage:". Instruction-tuned models may expect a short task line instead.

This is a common source of silent bugs. If you index with the passage prefix but query without the query prefix, the model still returns results. They are just worse. Read each model card. Write the prefix rules into your code, not into a comment. Then add a test that checks the prefix is there.

Hybrid search and contextual retrieval often beat a model swap

Before you spend weeks comparing dense models, test whether adding BM25 helps more. It often does, and it is cheap to try.

How hybrid search works

Hybrid search runs a keyword search and a dense search, then merges the two lists. The Weaviate hybrid search guide describes it as "combining the results of sparse vector search (e.g., BM25) and dense vector search into a single, ranked list."

Weaviate exposes a weight called alpha. Its docs list "alpha (optional, default is 0.75 ): weighting for each search algorithm alpha = 0 -> pure keyword search." An alpha of 1 is pure vector search. You can tune alpha on your eval set like any other setting.

Our post on hybrid search vs vector search for RAG goes deeper on fusion methods and tuning. The point here is that the embedding model is one input to a hybrid system. A model that looks weak alone may be fine once BM25 covers its gaps.

What contextual retrieval adds

Chunks often lose context when you cut them out of a document. A chunk may say "revenue grew 3 points" without naming the company or the year. Neither BM25 nor dense search can match a query that names them.

Anthropic's fix is called contextual retrieval. It works by "prepending chunk-specific explanatory context to each chunk before embedding." The same context also goes into the BM25 index. An LLM writes a short note for each chunk that says where it came from.

Anthropic reported that this "can reduce the number of failed retrievals by 49% and, when combined with reranking, by 67%." Those are their numbers on their test sets. Your gain may be larger or smaller. The same post lists several findings. The first is that "Embeddings+BM25 is better than embeddings on their own."

What this means for model choice

Run your model comparison inside the pipeline you plan to ship. If you will use hybrid search, compare models with BM25 turned on. If you will add context notes to chunks, add them before you embed for the test. A model's rank can change once the rest of the stack is in place.

API models and local models trade control for convenience

You can call an embedding API or run an open model on your own hardware. Both can work well. The right choice depends on data rules, volume, and team skills.

Hosted API models

APIs are fast to start. You send text and get vectors back. You do not manage GPUs. Prices are per token, and they can be low.

OpenAI's January 2024 post gives an example. It says pricing for text-embedding-3-small fell "from a price per 1k tokens of $0.0001 to $0.00002." It also says "text-embedding-3-large will be priced at $0.00013 / 1k tokens." Check the current price page before you budget. Prices change.

The same post published benchmark averages for its models. The table read "MIRACL average 31.4 44.0 54.9 MTEB average 61.0 62.3 64.6" for ada-002, 3-small, and 3-large in that order. Those are the vendor's own figures on public benchmarks.

The downsides are data flow and lock-in. Your text leaves your network. And your vectors only work with that model. If the vendor retires it, you must re-embed.

Local open models

Local models give you control. Your data stays inside. You can pin a version forever. You can fine-tune on your own pairs. Costs are fixed by hardware, which can be cheaper at high volume.

The downsides are ops work. Someone must serve the model, scale it, and watch it. Query latency depends on your setup. If you run models on GPUs, quantization can cut memory use. Our sibling guide on LLM quantization with AWQ, GPTQ, and FP8 covers that topic for generative models. The same rule applies to embedders: test accuracy after you compress.

Worked example: embedding cost for a corpus

This is illustrative arithmetic. The inputs are one million chunks at an average of 500 tokens each, so 500 million tokens. Prices are the per 1k token figures from OpenAI's January 2024 post.

  • At $0.00002 per 1k tokens: 500,000,000 divided by 1,000 is 500,000. Times $0.00002 is $10.
  • At $0.00013 per 1k tokens: 500,000 times $0.00013 is $65.

So the one-time cost to embed this corpus is small at those prices. The ongoing costs are storage, query traffic, and re-embedding when docs change. Do this math with your own token counts and current prices.

Re-embedding is the hidden cost of switching models

Vectors from two different models are not compatible. You cannot mix them in one index. If you switch models, you must embed every chunk again.

What a migration involves

A model change touches more than the embedding call. Plan for each of these steps.

  1. Embed the full corpus with the new model.
  2. Build a new index, with new dimension settings if they changed.
  3. Rerun your eval set and confirm the new model wins.
  4. Retune any score thresholds, since score scales differ by model.
  5. Retune hybrid weights such as alpha.
  6. Run both indexes in parallel while traffic moves over.
  7. Delete the old index once the new one is stable.

Score thresholds are easy to forget. A cosine score of 0.8 from one model does not mean the same thing as 0.8 from another. If you filter results by score, you must reset the cutoff. Our score threshold guide shows how.

How to keep the next switch cheap

You will likely change models again. Better ones keep coming out. Set up now so the next change is routine.

  • Store the raw chunk text and chunk IDs apart from the vectors.
  • Record the model name, version, dimensions, and prefix rules with each index.
  • Keep the eval set and a script that scores any model in one command.
  • Keep the code that calls the embedder behind one small interface.

With those in place, testing a new model is a day of work, not a project.

Decision table for common RAG situations

Use this table as a starting point. It does not replace your eval set. It narrows what to test first.

Your situation Start your shortlist with Why What to test hardest
English docs, small team, fast launch A hosted API model Low ops work and low per token prices Recall@10 on real queries, data rules
Many languages or cross-language queries Multilingual models such as BGE-M3 or multilingual E5 Trained for wide language coverage Queries in each language and across languages
Lots of codes, IDs, and names Any good dense model plus BM25 Dense search can miss exact strings Recall on code and ID queries
Long sections that must stay whole A long-context model Avoids silent truncation Recall with large and small chunks
Tight memory or very large corpus A model that supports shorter vectors Matryoshka cuts storage Recall at 256, 512, and full size
Strict data control or air gap A local open model Data stays inside Latency and recall on your hardware
Queries that hinge on fine detail Late interaction or a reranker Finer matching than one vector nDCG@10 and MRR

A step-by-step test plan you can run this week

Here is the whole process in order. Each step is small. Together they give you a choice you can defend.

  1. Set the bar. Decide how many chunks you pass to the LLM. Set a target recall at that k.
  2. Fix the chunking. Pick a chunk size and freeze it for the test.
  3. Build the eval set. Collect 50 real queries and label the correct chunks.
  4. Shortlist. Pick three or four models from MTEB retrieval scores, language needs, and max length.
  5. Check limits. Count chunk tokens against each model's limit. Read each model's prefix rules.
  6. Embed. Embed the corpus with each model. Log time and cost.
  7. Score. Run every query. Record recall@k, nDCG@k, and MRR per model.
  8. Add BM25. Rerun the best two models with hybrid search on.
  9. Try shorter vectors. For models that support it, test smaller sizes.
  10. Read the misses. Look at every failed query by hand. Note the cause.
  11. Decide. Pick the cheapest setup that clears your bar.
  12. Save the setup. Commit the eval set, the scores, and the scoring script.

If you want help designing this kind of test for a real system, our solutions page describes how sinc-LLM works with teams on retrieval and evaluation design.

Failure modes and how to spot them

Most embedding problems do not throw errors. They show up as worse answers. Here is what to watch for.

Missing or wrong prefixes

Symptom: a model that should do well scores low on your eval set. Check: print the exact strings sent to the model at index time and at query time. Compare them with the model card.

Silent truncation

Symptom: recall is low for answers that sit near the end of chunks. Check: count tokens per chunk with the model's tokenizer. Flag any chunk over the limit.

Mixed vectors in one index

Symptom: results look random after a partial migration. Check: store the model name with each vector. Query the index for more than one model name.

Missing normalization

Symptom: long chunks win too often with dot product search. Check: confirm whether the model outputs unit-length vectors. If not, normalize, or use cosine distance.

Exact-match misses

Symptom: queries with codes, SKUs, or names fail while plain questions pass. Check: split your eval results by query type. If code queries lag, add BM25.

Stale eval set

Symptom: test scores look fine but users complain. Check: sample fresh queries from recent logs every few months. Add the ones that fail.

Threshold drift after a switch

Symptom: after a model change, the system returns "no answer" too often or too rarely. Check: rerun the no-answer queries in your eval set and reset the cutoff.

Checklist before you commit to a model

Run down this list before you ship.

  • The eval set uses real queries, not queries written from the chunks.
  • Each candidate was tested on the same eval set and the same chunking.
  • The main metric matches how many chunks you pass to the LLM.
  • No chunk is longer than the model's max input length.
  • Prefix rules are in code and covered by a test.
  • Hybrid search was tested, not assumed.
  • Storage math was done at the dimension you plan to use.
  • Truncated vector sizes were tested if the model supports them.
  • Score thresholds were set for this model, not copied from an old one.
  • The model name, version, and settings are stored with the index.
  • There is a plan and a script for the next migration.

If every line is checked, you have a choice you can explain and repeat. That matters more than which model is at the top of a leaderboard this month. For related next steps, see query rewriting and HyDE to improve the query side, and metadata filtering and access control to scope what each user can retrieve.

Frequently asked questions

What is the best embedding model for RAG?

No single model is best for every RAG system. The MTEB paper found that no text embedding method wins across all tasks. The best model for you is the one that scores highest on your own queries and documents at a price and size you can run. Shortlist from a public leaderboard, then test three or four models on 50 to 200 real queries with known answers.

How many test queries do I need to compare embedding models?

Start with about 50 real queries that each have at least one known correct chunk. That is enough to catch large gaps between models. Grow toward 200 as you find edge cases such as codes, acronyms, and other languages. Take queries from logs or support tickets, not from the documents, so the test reflects how users really ask. Keep the set fixed so later runs stay comparable.

Is MTEB score a good way to pick an embedding model?

MTEB is a good way to build a shortlist, not to make the final call. It averages many tasks, and most of them are not retrieval over your kind of text. A model that ranks high overall can still lose on your domain. Look at the retrieval columns and at tasks close to your data, then confirm the choice with your own test set before you commit.

Do bigger embedding dimensions mean better retrieval?

Not always, and they always cost more storage. OpenAI reported that its large model, shortened to 256 dimensions, still beat the older ada-002 model at 1536 dimensions on MTEB. Dimension count is one factor among many. Test a shorter size of the same model against the full size on your own data. If recall holds, keep the shorter vectors and save memory.

Should I use hybrid search or only dense embeddings?

Most teams should test hybrid search. Dense embeddings handle synonyms and paraphrase well, but they can miss exact strings like error codes, part numbers, and names. BM25 catches those. Anthropic found that embeddings plus BM25 did better than embeddings alone in its tests. Run your eval set with and without BM25 and keep the hybrid setup if recall improves.

What does it cost to switch embedding models later?

Switching means you must embed every chunk again, because vectors from two models do not live in the same space. You pay for the compute or API calls, rebuild the index, and run both indexes side by side during the cutover. Estimate the cost as total chunk tokens times the new price, plus the time to backfill and test. Plan for this before you launch.

Do I need query and passage prefixes for E5 models?

Yes, if the model was trained with them. The E5 paper adds the prefixes query and passage to inputs so one shared encoder can tell questions from documents. If you skip them, results can drop and you will not see an error. Read the model card, apply the right prefix at both index time and query time, and test it on your eval set.

Should I use an embedding API or run a model locally?

Use an API when you want fast setup and low ops work, and your data may leave your network. Run a local open model when you need data control, fixed costs at high volume, or a custom fine-tune. Both choices need the same eval set. Compare recall, latency, and total cost per month at your real volume before you decide.

Sources

  1. MTEB: Massive Text Embedding Benchmark (Muennighoff et al.): Task, dataset, and language counts, and the finding that no method wins on every task.
  2. MMTEB: Massive Multilingual Text Embedding Benchmark: Scale of the multilingual extension and its best public model.
  3. BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models: Zero-shot retrieval results across 18 datasets, including the BM25 baseline.
  4. Matryoshka Representation Learning (Kusupati et al.): Method behind embeddings that can be truncated to fewer dimensions.
  5. ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT: Late interaction design that sits between bi-encoders and cross-encoders.
  6. BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity: One model for dense, sparse, and multi-vector retrieval with long inputs.
  7. Text Embeddings by Weakly-Supervised Contrastive Pre-training (E5): Query and passage prefixes, 512 token eval length, and the BM25 result on BEIR.
  8. Sentence Transformers: Retrieve and Re-Rank: Plain description of bi-encoders, cross-encoders, and lexical search limits.
  9. OpenAI: New embedding models and API updates: Published dimensions, benchmark scores, prices, and the dimensions parameter.
  10. Anthropic: Introducing Contextual Retrieval: Contextual embeddings, contextual BM25, and the 1 minus recall@20 metric.
  11. Weaviate: Hybrid Search Explained: How sparse and dense results merge, and the alpha weight.
  12. MTEB toolbox README: How to run MTEB tasks against a model.
Original source record

Skip to content

sinc-LLMAboutBlogServices