esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

How Do You Choose an Embedding Model?

How to pick an embedding model by testing it on your own data, weighing cost and privacy, and planning for a switch later, explained simply for your AI interview.

In short

Test two or three candidate models on your own real questions, then pick the one that finds the right text most often at a cost, speed and privacy level you can accept. Public leaderboards are only a starting point.

12 min readIntermediateCommon · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

An embedding model turns text into a list of numbers, so texts with similar meaning sit close together. To choose one, I start with the job: what text I have, how much, which languages, and where it is allowed to go. Then I test two or three candidates on real questions where I already know the right answer. I pick the one that finds the right text most often at a fair cost and speed. Public leaderboards help me shortlist. My own test settles it.

What is an embedding model, in plain words?

An embedding model reads a piece of text and returns a vector, which is a list of numbers. The numbers are a position on a map of meaning. Texts that mean similar things land close together, so a search can match a question to a clause even when they share few words.

Think of a records clerk at an insurance firm who files each claim under a short code, so similar claims sit in the same drawer. A different clerk with a different filing system would put the same claims in different drawers. Your search only works as well as the filing system, and the model is that system.

If you later change to a different model, every chunk must be turned into vectors again with the new model. That is called re-embedding.

Key words

Vector
A list of numbers that stands for the meaning of a piece of text.
Chunk
A slice of a document, such as one clause or paragraph, that gets its own vector.
Input limit
The most text a model reads in one go. Longer chunks do not fit.
Index
The stored set of vectors that search runs over.
Open-weight model
A model whose files you can download and run on your own servers.

How do you test models on your own data?

Say an insurance firm wants to search its policy wording to answer claim questions. It has 300 past questions, and a claims handler marked the right policy clause for each one. Each candidate model gets the same chunks and the same questions, and we check whether the right clause shows up in the top three results.

Testing candidate models on your own questions

Your docs and questions

real files and past queries

Hosted model (API)

you send text to the vendor

Open model on your servers

text stays on your own servers

Score each one

right answer in the top results?

Pick the best fit

accurate enough, fast, fair cost

  1. 1The same files and questions go to the hosted model.
  2. 2The same files and questions go to the open model, so the test is fair.
  3. 3The hosted model's answers go to scoring.
  4. 4The open model's answers go to scoring the same way.
  5. 5The best score at a fair cost is chosen.
Two candidates get the same files and the same test questions. Each one's answers are scored on how often the right chunk comes back near the top. The best score at a fair cost wins.
  1. 1

    Build the test set

    Collect a few hundred real questions with the right chunk marked. Take them from the claims team's logs.

  2. 2

    Embed each chunk with each candidate

    Embedding means turning each chunk into a vector. Keep the chunking and the documents the same for every model, so only the model changes.

  3. 3

    Measure how often it finds the answer

    Count how often the right chunk is in the top three. Made-up numbers for illustration: one model found it 81 times in 100, another 88 times.

The open model wins here, but that is not free: someone has to run, patch and update it on your own servers. The script below is the same idea in miniature. It uses ten made-up questions and counts how often the right clause lands in the top three. Ten is far too few for a real decision, but it shows the logic.

Python
# Score two embedding models on the same past questions (made-up numbers).
# Each number is the rank where the right policy clause came back; 1 is the top result.
TOP_K = 3
ranks = {
    "Model A (hosted)": [1, 4, 2, 1, 7, 3, 2, 1, 9, 2],
    "Model B (open, own servers)": [1, 2, 1, 3, 2, 1, 5, 1, 2, 2],
}
def hits(found):
    return sum(1 for r in found if r <= TOP_K)
for name, found in ranks.items():
    print(f"{name}: right clause in top {TOP_K} for {hits(found)} of {len(found)} questions")
best = max(ranks, key=lambda name: hits(ranks[name]))
print("Pick:", best)

Output

Model A (hosted): right clause in top 3 for 7 of 10 questions
Model B (open, own servers): right clause in top 3 for 9 of 10 questions
Pick: Model B (open, own servers)

Why don't public leaderboards settle it?

  • Quality

    It depends on your data

    The top model on a public test can trail on your claims notes. Anthropic's guide says larger or more domain-specific data generally gives better embeddings for text in that domain.

  • Cost

    Vectors cost to keep

    Bigger vectors need more storage, memory and search time. Test whether the extra size helps your results at all.

  • Control

    Where the text goes

    A hosted model sends your text to a vendor. An open model on your servers keeps it in house, but someone has to run it.

Anthropic's embeddings guide says it does not offer its own embedding model, and tells readers to assess a variety of vendors for their use case. Researchers who built the MTEB benchmark (a public test that runs embedding models on many tasks) found the same thing from the other side: no single method wins every task.

  • “Anthropic does not offer its own embedding model.”

    Anthropic

  • “We find that no particular text embedding method dominates across all tasks.”

    The MTEB researchers

  • “Using larger embeddings, for example storing them in a vector store for retrieval, generally costs more and consumes more compute, memory and storage than using smaller embeddings.”

    OpenAI

What about vector size, input limits and switching later?

Some models let you shorten the vector, which is the count of numbers in it. OpenAI's guide says a dimensions setting shortens an embedding while keeping its ability to represent concepts. Anthropic's guide says models with several output sizes, such as voyage-code-4, generate Matryoshka embeddings. These pack a rough summary and finer detail into one vector.

Check the input limit too. Each model reads only so much text at once, counted in tokens (small pieces of text, roughly words). Anthropic's guide, which points to Voyage AI's models, says the total number of tokens across all inputs has a cap, so plan chunk sizes around the model you pick. Check the languages as well. Test each language your users write in, using real questions from those users.

Switching models means building the index again

Stored vectors

made by the old model

Re-embed every chunk

reads each chunk, costs time and money

Rebuild the index

all vectors from the new model

Queries use the new model

same model for questions and files

  1. 1Old vectors are set aside, because they cannot be compared with new ones.
  2. 2The new vectors are stored together to form a fresh index.
  3. 3The new index is built, and questions go through the same new model.
Old vectors cannot be mixed with the new model's vectors, so every chunk is read again and the index is rebuilt. Only then do questions go through the new model, and the two must match.

Microsoft's guidance for Azure AI Search says to always use the same embedding model for the stored documents and the queries. So a switch means re-embedding every chunk and rebuilding the index. Old and new vectors are never mixed.

Tip

Keep the test set after you launch. When a new model comes out, build the new index beside the old one, run the same test questions against both, and switch only if the new one wins on your data.

What does the interviewer want to hear?

A strong answer covers

  • Start from the job: the text, its length, its languages and where the data may go.
  • Test on your own real questions with the right answer marked, not on a public leaderboard alone.
  • Weigh accuracy against cost, speed and vector size.
  • Know that switching models means re-embedding everything and rebuilding the index.
  • Check that the input limit fits your chunks.
  • Say how you would know the choice is good enough, and what result would change your mind.

Common traps

  • Trap"Pick the model at the top of the leaderboard."

    BetterLeaderboards test general tasks. Test on your own questions, since no one model wins them all.

  • Trap"A bigger vector is always more accurate."

    BetterBigger vectors cost more to store and search. Check whether the extra size helps your results.

  • Trap"We can switch models later for free."

    BetterA switch means re-embedding every chunk and rebuilding the index. Plan it like a migration, with a cost and a date.

Can you spot the weak plan?

Spot the weak plan

A team is choosing an embedding model for its support search. Which plan is the weak one?

Quick check

Next month you switch from the current model to a new one. What must happen to the stored vectors?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q117What is a vector database?12 min
  2. Q118Cosine vs dot product vs Euclidean distance?11 min
  3. Q114Fixed vs recursive vs semantic chunking?12 min
  4. Q154Sparse vs dense embeddings?Coming soon
  5. Q301How do you fine-tune embedding models?Coming soon

Learn it in depth

Last updated on 26 November 2026

Choosing a model for search over your real documents?

I design and build AI search and agents, including how each model is tested on your own data before launch. Book a short call and tell me what you need to search and where that data has to live.