Superlinked's E5 Guide Exposes the Silent Prefix Bug Breaking Your Retrieval
Superlinked published a hands-on guide to the E5 embedding family, showing benchmark scores, prefix pitfalls, and self-hosting costs starting at $0.0038 per million tokens.
ProTakeaways
- Superlinked published a comparison guide covering all five intfloat E5 embedding variants with benchmarks and pricing.
- Prefix rule warning: omit query: or passage: prefixes and retrieval quality silently drops.
- Self-hosting on L4 GPUs starts at $0.0038 per million tokens for e5-small-v2.
- e5-base-v2 flagged as the value pick; large-v2 offers modest gains over base on many benchmarks.
- multilingual-e5-large-instruct leads quality benchmarks; FiQA NDCG@10 hits 0.477 versus 0.370.
- Runs on the open source Superlinked Inference Engine under Apache 2.0.
Superlinked has published a technical guide covering all five variants of intfloat's E5 embedding family, and it doubles as a warning. The family is the one most teams reach for after all-MiniLM-L6-v2, and also the family most likely to be silently misused in production. The guide compares e5-small-v2, e5-base-v2, e5-large-v2, multilingual-e5-large, and multilingual-e5-large-instruct on dimensions, benchmark scores, latency, and per-token self-hosting cost on an L4 GPU, then explains the input formatting rule that quietly tanks retrieval quality when you get it wrong.
The five variants, side by side
The English v2 models are built on BERT backbones. The multilingual pair uses XLM-RoBERTa-large and covers roughly 100 languages. All five truncate input at 512 tokens. The guide's catalog numbers, measured on a single L4:
| Model | Params | Dims | Languages | $/1M tokens | p50 latency |
|---|---|---|---|---|---|
| e5-small-v2 | 33M | 384 | English | $0.0038 | 50 ms |
| e5-base-v2 | 109M | 768 | English | $0.0042 | 58 ms |
| e5-large-v2 | 335M | 1024 | English | $0.0067 | 87 ms |
| multilingual-e5-large | 560M | 1024 | ~100 | $0.0074 | 109 ms |
| multilingual-e5-large-instruct | 560M | 1024 | ~100 | $0.0076 | 107 ms |
The prefix rule that quietly breaks retrieval
The most useful piece of the writeup is a plain warning about how E5 expects inputs. These models are trained with role prefixes on every input, and skipping them causes performance degradation that is worst exactly where you will not notice it in a demo. The rules split by variant:
- For v2 and multilingual (non-instruct) models, prepend
query:to search queries andpassage:to documents at index time. - For symmetric tasks like similarity and clustering, use
query:on both sides. - The instruct variant works differently. Queries get a one-sentence task instruction in the format
Instruct: {task description}\nQuery: {your query}, and documents get no prefix at all.
Concretely, that looks like this before you tokenize:
queries = [f"query: {q}" for q in user_queries]
passages = [f"passage: {d}" for d in documents]
# instruct variant only
task = "Given a web search query, retrieve relevant passages"
queries_instruct = [f"Instruct: {task}
Query: {q}" for q in user_queries]
passages_instruct = documents # no prefix
Mixing the two schemes, or carrying passage: habits over to the instruct model, is the second most common E5 bug.
What the size tiers actually buy you
The benchmark table is where the guide gets interesting, because it undermines the reflex to always reach for the largest model. Looking at NDCG@10 across FiQA2018, NFCorpus, SciFact, StackOverflowQA, and SCIDOCS, the small-to-base-to-large jump inside the English v2 line is surprisingly thin. On StackOverflowQA the three models score 0.835, 0.878, and 0.899 respectively; on FiQA all three sit around 0.35. The takeaways from the writeup:
- e5-base-v2 is called out as the value pick of the English tier, with e5-small-v2 punching well above its 33M parameter weight.
- The instruct variant is the family's real quality leader. It wins four of the five benchmark rows shown, sometimes decisively: FiQA jumps to 0.477 versus 0.370 for the non-instruct multilingual model.
- For English-only workloads, the guide suggests benchmarking stella_en_400M_v5 against your data before locking in e5-large-v2, since it wins most English retrieval rows at a similar $0.0082 per million tokens.
- Where E5 remains hard to beat is multilingual coverage: multilingual-e5-large-instruct spans roughly 100 languages at $0.0076 per million tokens with no serious open competition at that serving cost.
Self-hosting economics
The cost numbers assume you run the models yourself through Superlinked's inference engine. SIE is open source under Apache 2.0 and available on GitHub. The guide reports cluster-level batching throughput of 53,200 tokens per second for base-v2 and 29,800 tokens per second for multilingual-e5-large on a single L4. To put that in practical terms, embedding a million typical support tickets at around 200 tokens each is roughly an hour on one GPU with base-v2, coming in under a dollar at the listed rate.
Why this matters if you use E5
The underlying E5 family comes from Microsoft's Text Embeddings paper and ships under an MIT license. The models themselves are not new. What the guide changes is how easily you can pick the right variant for a given retrieval workload, avoid the prefix trap that silently degrades quality, and reason about serving cost before committing to a stack. If your retrieval quality has ever looked mysteriously mediocre with an E5 model, the writeup's advice is blunt: audit the prefixes first, because it is almost always the prefixes.