A support team ships a semantic search box over six years of tickets, runbooks and release notes. The demo is convincing: type "customers cannot log in after password reset" and the right article comes back first. Two weeks after launch the complaints arrive. A search for an error code such as E4017 returns articles about errors in general. A query written in Vietnamese finds the English runbook it should find but misses the Vietnamese ticket that describes the same incident. A long incident postmortem ranks below a three-line FAQ because the model only saw the first few hundred tokens of it. Nothing is broken in the code. The embedding model is doing exactly what it was trained to do, and that is not quite what the team needed.
Choosing an embedding model is one of the few AI decisions that is cheap to make badly and expensive to undo, because every document in the index is tied to the model that produced its vectors. Changing the model means re-embedding the corpus, rebuilding the index and re-validating every threshold and filter built on top of it. This article walks through how dense, sparse and multi-vector representations differ, what the commonly shortlisted options (BGE-M3, Nomic Embed, Voyage's hosted models, and Qdrant as the store that holds the vectors) are good at, why public leaderboards only get you to a shortlist, and how to build a small benchmark from your own data that settles the question. There are no invented benchmark numbers here. The point is a method you can run in an afternoon.
1. What an embedding model is actually optimizing
An embedding model maps a piece of text to a point in a vector space so that texts the training data considered related land near each other. Most modern retrieval embedders are transformer encoders fine-tuned with a contrastive objective: given a query and a passage that answers it (the positive) and a pile of passages that do not (the negatives), the loss pulls the pair together and pushes the negatives away. Everything the model "knows" about similarity comes from which pairs it was shown. If the training pairs were question and answer, the space reflects topical answerability. If they were duplicate questions, it reflects paraphrase. This is why one model can be excellent at finding an answer for a question and mediocre at clustering documents by theme.
Four mechanical details decide most of the practical behavior, and all four are easy to get wrong in integration code.
- Asymmetry between queries and documents. Queries are short and underspecified; documents are long and detailed. Many models are trained with different treatment for each side, either through instruction prefixes (Nomic Embed expects task prefixes such as
search_query:andsearch_document:) or through an API parameter that marks the input as a query or a document (Voyage's API exposes an input type for this). Embedding both sides with no prefix when the model expects one quietly lowers retrieval quality without raising any error. - Maximum input length. Encoders truncate. A model with a 512-token limit never sees the end of a long page, and a model with an 8,192-token limit can see it but may represent it as a blurry average. Chunking strategy and model context length have to be chosen together.
- Pooling and normalization. The sentence vector is produced by pooling token states (CLS token or mean pooling, depending on the model). Cosine similarity assumes normalized vectors; if the vectors are not unit length and the index uses dot product, long and short texts get different effective weight.
- Dimensionality. A 1,024-dimensional float32 vector costs 4 KB. Ten million of them are about 41 GB before any index overhead, which is why dimension is a cost decision and not only a quality one.
The consequence is that "which embedding model is best" has no answer without a corpus, a query distribution and a definition of relevant. A model that wins on a general leaderboard is a statistical statement about the leaderboard's datasets, not a promise about your error codes.
2. Dense, sparse and multi-vector: three different ideas of similarity
The word "embedding" now covers three representations with different strengths. Understanding what each one encodes explains most of the retrieval surprises teams hit in production.
Dense vectors
A dense embedding is one fixed-length vector per text, typically a few hundred to a few thousand floats. Similarity is a dot product or cosine. Dense vectors capture meaning that survives paraphrase: "cannot sign in" and "login fails" land close together even though they share no words. The price is that the whole passage is compressed into one point, so exact tokens such as part numbers, identifiers, rare names and error codes are represented weakly. A dense model has often never seen E4017 as a unit and will place it near whatever text looks vaguely similar.
Sparse vectors
A sparse representation has one dimension per vocabulary term and almost all entries are zero. Classic BM25 is a hand-built sparse scorer: term frequency, inverse document frequency and length normalization. Learned sparse models (BGE-M3's lexical weights, or SPLADE-style models) predict a weight for each term in the passage, which lets them up-weight informative tokens and, in some designs, expand the passage with related terms. Sparse scoring is strong precisely where dense is weak: exact identifiers, rare terms and queries where the user knows the vocabulary. It is weak on pure paraphrase and on cross-language matching, because it needs term overlap.
Multi-vector (late interaction)
A multi-vector model, in the ColBERT family, keeps one vector per token instead of pooling to one vector per passage. At query time each query token finds its best-matching document token, and the scores are summed (the MaxSim operator). This preserves fine-grained matching, so it handles long passages and specific phrases better than a single pooled vector, at the cost of storing tens or hundreds of vectors per passage and a more expensive comparison. In practice it is used as a second stage: a cheap first stage retrieves a hundred or so candidates and the multi-vector scorer reorders them.
| Representation | Good at | Weak at | Storage per passage | Typical role |
|---|---|---|---|---|
| Dense | Paraphrase, cross-language meaning, short queries | Exact identifiers, rare terms, long passages squeezed into one point | One vector (a few KB) | First-stage recall |
| Sparse (BM25 or learned) | Exact terms, codes, names, vocabulary-matched queries | Paraphrase, cross-language queries | Only non-zero terms (small, grows with passage length) | First-stage recall, fused with dense |
| Multi-vector | Fine-grained phrase matching, long passages | Cost: many vectors per passage, slower scoring | One vector per token (tens to hundreds) | Second-stage rescoring |
3. The usual candidates and what each is for
Four names appear on most shortlists, and they are not four competitors of the same kind. Two are open-weight models you host, one is a hosted API, and one is a database. The table summarizes what is publicly documented about each; confirm current versions, licenses and limits on their official pages, since this area changes quickly.
| Option | What it is | Distinguishing design points | Check before adopting |
|---|---|---|---|
| BGE-M3 | Open-weight embedding model from BAAI | One model emits dense, learned-sparse and multi-vector outputs; multilingual; long input (up to 8,192 tokens); 1,024-dim dense vector | License terms, GPU memory for your batch size, how you store the token vectors |
| Nomic Embed (text) | Open-weight text embedding family | Long context; task prefixes for queries and documents; Matryoshka-trained variants allow truncating dimensions; multilingual variants exist | Which version you use (language coverage differs), whether your pipeline adds the prefixes |
| Voyage models | Hosted embedding API | General models plus domain-tuned ones (for example code or legal); query versus document input type; companion reranker models | Data-residency and privacy terms, rate limits, per-token cost at your volume, vendor lock-in on re-embedding |
| Qdrant | Vector database (not a model) | Named vectors per point, sparse vectors, multi-vector with MaxSim, payload filtering, quantization, server-side fusion in one query | Memory sizing, shard and replica layout, snapshot and upgrade story |
Two points follow from this. First, BGE-M3 is unusual because a single forward pass can supply all three representations, so a team can try hybrid retrieval and late-interaction rescoring without hosting three models. Second, Qdrant matters to the model decision because it determines which representations you can serve cheaply: named vectors let one point carry a dense vector, a sparse vector and a multi-vector side by side, and its query API can fuse them server-side, so hybrid retrieval is a query-shape question and not an application-code project.
A hosted API and a self-hosted model trade different risks. A hosted model removes GPU operations and often gives strong quality quickly, but your text leaves your network, you pay per token at indexing and at query time, and you cannot pin the weights forever. A self-hosted open model gives control, predictable cost at scale and reproducibility, but you own batching, GPU sizing and upgrades. Neither choice is wrong; the mistake is making it before measuring.
4. Why public leaderboards only get you to a shortlist
Public benchmarks such as MTEB aggregate many datasets across retrieval, classification, clustering and other tasks. They are useful for ruling out weak models and for finding families worth testing. They are poor at predicting the winner on a specific private corpus, for reasons that are structural and not a criticism of the benchmark.
- Domain mismatch. Leaderboard retrieval sets are mostly web, Wikipedia, forum and scientific text. Your corpus has product vocabulary, internal acronyms and templated tickets.
- Language mix. An average over English datasets says little about Vietnamese-English code-switching, or about a corpus that is 30 percent one language and 70 percent another.
- Possible training overlap. Models are trained on large collections that can overlap with public evaluation sets. Some leaderboards flag this and some models disclose their training data; many do not. Treat very high scores with measured skepticism.
- Averages hide your slice. A model can win the average and lose on exactly the query type that drives your business, such as short identifier lookups.
- The metric differs. A leaderboard may report nDCG@10 on a curated judged set. Your product may care about whether the correct article is in the top three, or whether any result is good enough to answer without a click.
5. Building a benchmark from your own corpus: a worked example
You need three things: a set of queries, a set of documents the system will search, and a judgment of which documents are relevant to each query. The labeling cost is the barrier, so it helps to be systematic about where queries come from.
- Harvest real queries. Search logs are best. Where there are none, take support tickets or chat messages and rewrite each into the query a user would have typed.
- Stratify. Include short keyword queries, full-sentence questions, identifier lookups, queries in each language you serve, and a few queries with no correct answer in the corpus at all.
- Label with adjudication. For each query, retrieve the union of the top ten from every candidate model, then have a person mark which results are relevant. Pooling the candidates' results keeps labeling effort bounded and avoids favoring any single model.
- Hold some out. Tune chunk size and fusion weights on one half of the queries and report on the other half, so your final number is not fitted to what you tuned.
Scoring is a short script. The functions below compute recall at k, mean reciprocal rank and nDCG for a ranked list against a set of relevant document IDs, and a loop evaluates any retriever exposed as a function from query text to a ranked list of IDs. The embedding call is left abstract on purpose so you can plug in any of the candidates.
import math
from collections import defaultdict
def recall_at_k(ranked, relevant, k):
"""Fraction of relevant docs found in the top k."""
if not relevant:
return None # undefined for no-answer queries
return len(set(ranked[:k]) & relevant) / len(relevant)
def reciprocal_rank(ranked, relevant, k=10):
for i, doc_id in enumerate(ranked[:k], start=1):
if doc_id in relevant:
return 1.0 / i
return 0.0
def ndcg_at_k(ranked, relevant, k=10):
"""Binary-relevance nDCG."""
dcg = sum(1.0 / math.log2(i + 1)
for i, d in enumerate(ranked[:k], start=1) if d in relevant)
ideal = sum(1.0 / math.log2(i + 1)
for i in range(1, min(len(relevant), k) + 1))
return dcg / ideal if ideal else None
def evaluate(retriever, queries, k=10):
"""retriever(text) -> ranked list of doc ids.
queries: list of dicts {"id", "text", "relevant": set, "tag": str}"""
by_tag = defaultdict(lambda: defaultdict(list))
for q in queries:
ranked = retriever(q["text"])
for name, value in (
("recall@5", recall_at_k(ranked, q["relevant"], 5)),
("mrr@10", reciprocal_rank(ranked, q["relevant"], 10)),
("ndcg@10", ndcg_at_k(ranked, q["relevant"], 10)),
):
if value is not None:
by_tag[q["tag"]][name].append(value)
by_tag["ALL"][name].append(value)
return {tag: {m: sum(v) / len(v) for m, v in ms.items()}
for tag, ms in by_tag.items()}
The per-tag breakdown is the useful part. A table with one row for "identifier lookup", one for "Vietnamese question", one for "long natural-language question" and one for "ALL" exposes the trade-off that a single average hides: a model that wins overall can lose on the rows your users care about most. Run each candidate with its correct query and document treatment (prefixes, input types, normalization), and run the same harness on a plain BM25 baseline. If a hosted embedding model cannot clearly beat BM25 on your identifier queries, that tells you something no leaderboard will.
Reading the result
With a few hundred queries, small differences are noise. Compare candidates per query, not only on the mean: count the queries where model A found the answer and B did not, and the reverse. If the split is 40 to 38, the models are equivalent for your purposes and the choice should be made on cost, latency and operations. If the split is 60 to 12, you have a real difference. Also read the failures by hand. Ten minutes spent on the queries a model got wrong usually reveals whether the cause is the model, the chunking or the labels.
6. Hybrid retrieval and fusion in Qdrant
If section 5 shows that dense wins on paraphrase and sparse wins on identifiers, the answer is rarely to pick one. Hybrid retrieval runs both and fuses the ranked lists. The fusion method that needs the least tuning is reciprocal rank fusion (RRF), which scores each document by summing 1 / (k + rank) across lists (with a small constant k, commonly 60), so a document that ranks well in either list rises and no score scales have to be reconciled. Qdrant exposes this as a server-side fusion query, which means one round trip and no merging code in the application.
The sketch below creates a collection with a dense vector, a sparse vector and a multi-vector configured for MaxSim, then issues a hybrid query: two prefetch branches (dense and sparse) fused with RRF and optionally reranked by the multi-vector. Treat the client calls as a starting point and check them against the client version you install, since the API has evolved between releases. The vector sizes assume a 1,024-dimensional model such as BGE-M3.
from qdrant_client import QdrantClient, models
client = QdrantClient(url="http://localhost:6333")
client.create_collection(
collection_name="support_docs",
vectors_config={
"dense": models.VectorParams(
size=1024, distance=models.Distance.COSINE),
"colbert": models.VectorParams(
size=1024,
distance=models.Distance.COSINE,
multivector_config=models.MultiVectorConfig(
comparator=models.MultiVectorComparator.MAX_SIM),
# Used only for reranking, so skip building an HNSW graph.
hnsw_config=models.HnswConfigDiff(m=0),
),
},
sparse_vectors_config={"sparse": models.SparseVectorParams()},
)
def search(dense_q, sparse_q, colbert_q, limit=10):
"""dense_q: list[float]; sparse_q: (indices, values); colbert_q: list[list[float]]"""
indices, values = sparse_q
fused = models.Prefetch(
prefetch=[
models.Prefetch(query=dense_q, using="dense", limit=100),
models.Prefetch(
query=models.SparseVector(indices=indices, values=values),
using="sparse", limit=100),
],
query=models.FusionQuery(fusion=models.Fusion.RRF),
limit=50,
)
return client.query_points(
collection_name="support_docs",
prefetch=fused,
query=colbert_q, # rescore the fused candidates
using="colbert",
limit=limit,
with_payload=True,
).points
Skipping the HNSW graph for the multi-vector (setting m=0) is a deliberate choice: it is only ever used to rescore a short candidate list, so building an approximate-nearest-neighbor graph over many token vectors would cost memory and indexing time for nothing. Payload filters, such as language, product or tenant, belong on the prefetch branches so that filtering happens before the candidate set is cut.
Hybrid is not free. It doubles the indexing work, adds a second scoring path to debug, and requires you to decide how many candidates each branch contributes. The benchmark from section 5 answers whether it earns that cost: run dense only, sparse only, fused, and fused plus rescoring through the same harness and keep the cheapest configuration whose per-tag results meet your target.
7. Costs that never appear on a leaderboard
Quality is one axis of the decision. The others show up on the invoice and in the on-call rotation.
Storage and memory
Vector count times dimension times bytes per component sets the floor. Ten million 1,024-dimensional float32 vectors are about 41 GB; the same count at 256 dimensions is about 10 GB. Two levers reduce this without changing the model. Matryoshka-trained models are built so that the leading dimensions of the vector carry most of the signal, which lets you truncate to a shorter length and re-normalize, trading a small quality loss for a proportional storage saving. Quantization stores each component in fewer bits: scalar quantization to 8 bits cuts memory roughly fourfold, and binary quantization cuts it far more, typically combined with rescoring against the original vectors kept on disk. Both change recall, so measure with the harness, not on faith.
Latency
Query latency has two parts: embedding the query and searching the index. A hosted API adds a network round trip to every search. A self-hosted model adds GPU or CPU inference time, usually small for short queries. Index search with HNSW is typically fast; the tail comes from filtered searches with highly selective filters, large candidate limits, and multi-vector rescoring over many candidates.
Indexing throughput and re-embedding
Embedding the corpus is a batch job whose cost scales with total tokens. Hosted APIs bill by token; self-hosted models bill in GPU hours. Plan for at least one full re-embedding in the life of the system, because model upgrades, chunking changes and bug fixes in preprocessing all require it. A reasonable pattern is to write new vectors into a second named vector or a second collection, compare quality on the benchmark, and then switch traffic. Storing a model identifier and a preprocessing version in each point's payload makes mixed-version indexes detectable instead of silent.
Operations
Self-hosting a model means capacity planning, batching, health checks and version pinning. Self-hosting a vector database means backup, upgrades and shard balancing. Hosted options shift that work but add dependency and data-handling constraints. Decide who is on call for each piece before choosing.
8. Failure modes and when not to use embeddings
Several failures recur often enough to check for explicitly.
- Prefix or input-type omission. Queries embedded as documents, or the reverse. Retrieval quality is lower than it should be and nothing errors. Test by embedding a known pair both ways.
- Silent truncation. Long chunks exceed the model's limit and the tail is dropped. The answer is in the part the model never saw. Log token counts and alert on truncation.
- Chunk boundaries that destroy meaning. A table row separated from its header, or a code snippet split mid-block. Chunk on structure (headings, paragraphs, rows) and keep a title or breadcrumb in each chunk.
- Language drift. A multilingual model can still place the same content closer to its own language. If cross-language retrieval matters, put a cross-language query set in the benchmark.
- Negation and numbers. "Does not support SSO" and "supports SSO" embed close together. Dense retrieval is poor at distinguishing them; a reranker or an explicit check is needed.
- Stale vectors. A document is edited and its vector is not refreshed. Treat re-embedding on change as part of the write path.
- Mixed model versions. Vectors from two models in one index are not comparable. Enforce one model per vector name.
Embeddings are also the wrong tool for some problems. Exact lookup by identifier belongs in a keyword index or a database column. Questions that need aggregation or arithmetic over records belong in SQL. Questions whose answer depends on freshness within seconds need the source of truth, not an index that lags it. A small corpus of a few thousand short documents can often be served well enough by BM25 plus a reranker, with no vector store at all. Use semantic retrieval where meaning matches vocabulary poorly, not as a default.
9. Decision checklist and what to do on Monday
Use this checklist before committing to a model and an index design.
- Write down the query types and languages that matter, and the failure that hurts most (a missed identifier, a wrong language, a long document ranked too low).
- Collect at least a hundred real queries, tag them by type, and label relevance by pooling candidate results.
- Shortlist three or four candidates from public leaderboards and your constraints (license, data residency, GPU budget, languages).
- Integrate each correctly: prefixes or input types, normalization, truncation checks, the same chunking for all.
- Run the harness for dense, sparse and fused configurations and read the per-tag table and the per-query wins and losses.
- Price the winner: storage at your corpus size, indexing cost, query latency, and the cost of one full re-embedding.
- Store the model name and preprocessing version with every vector, and keep the benchmark in the repository so the next model change is a measured decision.
What to do Monday. Export a week of real search queries, pick eighty to a hundred, label them with a colleague, and run the harness above against your current setup and one alternative. Even one afternoon of this usually turns an opinion into a table.
Short FAQ
Is a bigger embedding dimension always better? No. Higher dimensions can capture more nuance, but gains flatten and storage and latency grow linearly. Measure truncated or quantized variants on your queries before paying for the full width.
Do I need a reranker as well? Often yes, if precision at the top matters. A cross-encoder reranker reads query and document together and fixes ordering errors that vector similarity cannot. It adds latency per candidate, so rerank a short list.
Can I mix models across languages? You can, but queries must then be routed by language, and cross-language search stops working. A single multilingual model with a benchmark covering your languages is usually simpler.
How often should I re-run the benchmark? On every model, chunking or preprocessing change, and on a schedule if your content or query mix drifts. A benchmark that runs in minutes can live in CI.