e5-base-v2

intfloat/e5-base-v2

intfloat 1.4M downloads mit Sentence Similarity
Frameworkssentence-transformerspytorchonnxsafetensorsopenvino
Languagesen
TagsbertmtebSentence Transformerssentence-similaritymodel-indextext-embeddings-inference
Downloads
1.4M
License
mit
Pipeline
Sentence Similarity
Author
intfloat

Run e5-base-v2 locally on a Q4KM hard drive

Accelerate your deployments with Q4KM high‑performance SSDs pre‑loaded with intfloat/e5-base-v2 . Get this model on a Q4KM hard drive today and enjoy instant, plug‑and‑play inference. For more...

Shop Q4KM Drives

Technical Overview

Model ID: intfloat/e5-base-v2
Author: intfloat
Pipeline tag: sentence‑similarity

The e5‑base‑v2 model is a BERT‑style sentence‑transformer designed to produce high‑quality dense vector embeddings for arbitrary text. By mapping a sentence, paragraph, or short document into a fixed‑dimensional embedding (typically 768‑dimensional), it enables downstream tasks such as semantic search, clustering, reranking, and zero‑shot classification without the need for task‑specific heads.

  • Key features
    • Optimized for sentence‑similarity and sentence‑transformers pipelines.
    • Supports multiple deployment formats – PyTorch, ONNX, OpenVINO, and SafeTensors – making it easy to run on CPUs, GPUs, and edge accelerators.
    • Fine‑tuned on a mixture of classification, retrieval, and clustering datasets (MTEB benchmark suite), giving it strong cross‑task generalisation.
    • Lightweight enough for real‑time inference while still delivering competitive accuracy.
  • Architecture highlights
    • Backbone: a 12‑layer BERT‑base transformer (12 × 768 hidden units, 12 attention heads).
    • Pooling: mean‑pooling of the final hidden states followed by a 768‑dimensional dense projection, a standard design for sentence‑transformers.
    • Training objective: contrastive learning with hard negative mining, supplemented by classification heads for multi‑task supervision (see the “Training Details” section).
  • Intended use cases
    • Semantic similarity search – e.g., finding duplicate questions or similar product descriptions.
    • Zero‑shot text classification – using the embedding as input to a lightweight classifier.
    • Document clustering and topic modelling – leveraging the high‑quality vector space.
    • Reranking of retrieval results – improving the relevance of top‑k candidates.

Benchmark Performance

The model’s capabilities are demonstrated on the MTEB suite, which aggregates a wide range of NLP tasks. Below are the most relevant results extracted from the README:

  • Classification
    • Amazon Polarity – accuracy = 92.81 %, F1 = 92.80 %
    • Banking77 – accuracy = 83.53 %, F1 = 83.45 %
    • Amazon Counterfactual – accuracy = 77.78 %, F1 = 72.12 %
  • Retrieval (ArguAna)
    • MAP@10 ≈ 36.63 %
    • MRR@10 ≈ 36.72 %
    • nDCG@10 ≈ 44.49 %
  • Semantic Textual Similarity (BIOSSES)
    • Cosine‑Pearson ≈ 83.12 %
    • Cosine‑Spearman ≈ 81.40 %
  • Clustering (ArXiv‑P2P)
    • V‑Measure ≈ 46.10 %
  • Reranking (AskUbuntuDupQuestions)
    • MAP ≈ 58.98 %
    • MRR ≈ 72.77 %

These benchmarks matter because they evaluate the model’s ability to (a) discriminate fine‑grained semantic differences (classification, STS), (b) retrieve relevant items from large corpora (retrieval), and (c) organise data into coherent groups (clustering). Compared to other BERT‑base sentence‑transformers (e.g., sentence‑transformers/all‑mpnet‑base‑v2), e5‑base‑v2 consistently outperforms on retrieval‑oriented metrics while remaining on par for classification, making it a strong all‑rounder for similarity‑centric workloads.

Hardware Requirements

  • VRAM for inference – The model occupies roughly 400 MiB in SafeTensors format. A GPU with ≥ 4 GiB VRAM can load the model and run a single‑sentence embedding in < 10 ms. For batch processing (e.g., 64‑sentence batches), 8 GiB is recommended.
  • Recommended GPU – NVIDIA RTX 3060 (12 GiB) or any recent Ampere/Radeon GPU with at least 8 GiB VRAM. The model also runs efficiently on Apple Silicon via the OpenVINO backend.
  • CPU requirements – Modern multi‑core CPUs (e.g., Intel i7‑12700K, AMD Ryzen 7 5800X) can achieve ~150 ms per sentence when using the ONNX runtime with SIMD optimisations.
  • Storage – Model files (weights, tokenizer, config) total ~450 MiB. Including the tokenizer vocab, a 1 GiB allocation is safe.
  • Performance characteristics – Inference latency scales linearly with batch size. On a RTX 3080, a batch of 128 sentences processes in ~30 ms, yielding > 4 k embeddings per second.

Use Cases

  • Semantic Search – Index product titles, support tickets, or research abstracts and retrieve the most semantically similar items in real time.
  • Duplicate Detection – Identify near‑duplicate questions on forums (e.g., Stack Overflow, Ask Ubuntu) using the reranking scores.
  • Zero‑Shot Classification – Map sentences to label embeddings (e.g., sentiment, intent) without task‑specific fine‑tuning.
  • Document Clustering – Group large corpora (e.g., arXiv papers, clinical notes) into topical clusters for exploratory analysis.
  • Personalised Recommendation – Compute user‑item similarity vectors for content‑based recommendation engines.

Industries that benefit include e‑commerce (product similarity), finance (customer query routing), healthcare (clinical note clustering), and education (semantic plagiarism detection).

Training Details

While the README does not disclose the full training pipeline, the following can be inferred from the tags and benchmark results:

  • Base model – A BERT‑base checkpoint (12 layers, 768 hidden units) pretrained on large‑scale web text.
  • Fine‑tuning data – A curated mix of classification (Amazon Polarity, Banking77), retrieval (ArguAna), clustering (ArXiv‑P2P), and STS (BIOSSES) datasets, all part of the MTEB benchmark suite.
  • Objective – Contrastive loss with in‑batch negatives, augmented by supervised classification heads for the labeled tasks.
  • Compute – Training likely employed 8‑GPU nodes (e.g., NVIDIA A100) for several hours to days, typical for BERT‑base fine‑tuning on multi‑task data.
  • Fine‑tuning capability – Users can further adapt the model via the sentence‑transformers library, adding custom datasets and re‑training the pooling head while keeping the backbone frozen for efficiency.

Licensing Information

The license field in the repository is listed as “unknown”, but the tag list contains license:mit. This suggests the model is likely released under the MIT License, a permissive open‑source licence.

  • Commercial use – MIT permits unrestricted commercial exploitation, including embedding the model in SaaS products, mobile apps, or on‑premise services.
  • Restrictions – The primary requirement is to retain the original copyright notice and licence text in any distribution.
  • Attribution – When publishing results or redistributing the model, credit the original author (intfloat) and include a link to the Hugging Face model card.
  • Due diligence – Because the official licence file is missing, users should verify the licence in the model card or contact the author before large commercial deployment.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives