Skip to main content
Back

Cyber Monday Deal: Get 20% off all AlphaSignal Pro subscriptions. Ends soon.

E5-base Pushes Users to E5-base-v2 With 5-Point Accuracy Gains

Intfloat posted a deprecation notice on the original E5-base embedding model, telling users to migrate to E5-base-v2 for better performance.

Pro

  • Intfloat posted a deprecation notice on E5-base, telling users to switch to v2.
  • E5-base-v2 is a drop-in replacement with the same 768-dim output and prefix convention.
  • MTEB classification scores improve meaningfully, for example AmazonPolarity accuracy jumps from 87.97 to 92.81.
  • Both models are MIT-licensed, 12-layer BERT encoders at roughly 110M parameters.
  • V2 downloads already exceed 1.25M per month on Hugging Face, versus 796K for v1.
  • Still English-only, still capped at 512 tokens, still requires query and passage prefixes.

The E5 family provides open text encoders for semantic search, retrieval-augmented generation, clustering, and related tasks. Its maintainers have added a migration notice to the original E5-base card, directing users to E5-base-v2 for better reported performance with the same usage pattern. Existing deployments can retain their input conventions and vector dimensions, but they must rebuild stored embeddings.

V2 keeps the 768-dimensional contract

Both checkpoints use 12-layer BERT-style encoders, produce 768-dimensional vectors, and carry an MIT license. They follow the contrastive training method described in the E5 paper, which trains the encoder to place related texts close together and unrelated texts farther apart.

E5-base-v2 retains the query: and passage: prefixes, attention-mask-aware average pooling, L2 normalization, and cosine similarity scoring. The new checkpoint creates a separate embedding space, so every indexed document needs a v2 embedding before the query encoder switches. Mixing v1 document vectors with v2 query vectors can produce unreliable rankings even though their dimensions match.

Published scores move upward

The model cards report higher v2 scores on the selected MTEB classification datasets below. MTEB covers several embedding tasks, including retrieval, classification, clustering, and semantic similarity; these rows represent its classification slice.

Selected MTEB results reported on the E5 model cards
Dataset and metric E5-base E5-base-v2 Change
AmazonPolarity accuracy 87.97 92.81 +4.84
AmazonPolarity F1 87.94 92.80 +4.86
AmazonReviews accuracy 42.65 46.71 +4.06

These self-reported results show gains of 4.06 to 4.86 points on the listed tasks. Retrieval performance still depends on the corpus, query distribution, document length, and relevance labels, so production teams should compare recall, MRR, or nDCG on an in-domain evaluation set.

Rebuild the index during migration

Changing the model identifier takes one line with sentence-transformers, while the existing prefix and normalization conventions remain in place:

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("intfloat/e5-base-v2")

query_embeddings = model.encode(
    ["query: how much protein should an adult eat?"],
    normalize_embeddings=True,
)

passage_embeddings = model.encode(
    ["passage: The average daily protein requirement is 46 grams..."],
    normalize_embeddings=True,
)
  1. Pin the artifact. Record the model identifier and Hugging Face commit hash so later deployments load the same weights and configuration.
  2. Re-encode the corpus. Generate a v2 vector for every document using the passage: prefix.
  3. Build a separate index. Keep v1 and v2 vectors in separate collections. The new index can use the same 768 dimensions and cosine metric. With normalized vectors, inner product produces the same ranking as cosine similarity.
  4. Refresh dependent data. Invalidate cached query vectors and regenerate clusters, centroids, classifiers, or other artifacts derived from v1 embeddings.
  5. Run relevance and systems tests. Compare retrieval metrics, latency, throughput, memory use, and score distributions under representative traffic.
  6. Switch traffic atomically. Route v2 queries to the v2 index through an alias or versioned endpoint, retaining the v1 path for rollback during validation.

Prefixes and pooling control quality

The training recipe makes input formatting and post-processing part of the model contract:

  • Use query: for search queries and passage: for candidate documents in asymmetric retrieval.
  • Use query: on every input for symmetric tasks such as semantic similarity and paraphrase matching.
  • Include the prefixes exactly, including the colon and trailing space, because omitting them reduces measured performance.
  • When using raw transformers, apply masked average pooling to the final hidden states and L2-normalize the result. The packaged sentence-transformers configuration handles these steps.
  • Inputs are limited to 512 tokens. Chunk or summarize longer documents before encoding to avoid losing content through truncation.
  • The model targets English text. Multilingual applications need a multilingual checkpoint or domain-specific evaluation.
  • Training used an InfoNCE temperature of 0.01, which causes many cosine scores to fall between 0.7 and 1.0. Use rank-based metrics and recalibrate any absolute similarity thresholds after migration.

Re-encoding is the main migration cost

At roughly 100 million parameters, E5-base-v2 preserves the deployment profile of the original base model. It can run on CPUs or common single-GPU setups, keeps vector storage unchanged at 768 values per item, and has a broadly comparable inference cost. The material migration expense comes from encoding the corpus again and rebuilding the nearest-neighbor index.

The maintainer notice makes v2 the current default for new E5-base deployments. Existing systems can build the replacement index alongside v1, measure quality on their own data, and promote v2 once the evaluation and operational checks pass.