paraphrase-MiniLM-L3-v2

What is this model?

sentence-transformers 1M downloads apache-2.0 Sentence Similarity
Frameworkssentence-transformerspytorchtfonnxsafetensorsopenvinotransformers
Datasetsflax-sentence-embeddings/stackexchange_xmls2orcms_marcowiki_atomic_editssnlimulti_nli
Tagsbertfeature-extractionsentence-similaritytext-embeddings-inference
Downloads
1M
License
apache-2.0
Pipeline
Sentence Similarity
Author
sentence-transformers

Run paraphrase-MiniLM-L3-v2 locally on a Q4KM hard drive

Accelerate deployment with Q4KM hard drives pre‑loaded with paraphrase‑MiniLM‑L3‑v2 . Get instant, plug‑and‑play access to the model on ultra‑fast NVMe storage. Get this model on a Q4KM hard drive...

Shop Q4KM Drives

Technical Overview

What is this model? paraphrase‑MiniLM‑L3‑v2 is a Sentence‑Transformers model that converts a sentence or a short paragraph into a 384‑dimensional dense vector. The vectors capture semantic meaning, enabling fast similarity search, clustering, and downstream NLP tasks without the need for expensive per‑sentence fine‑tuning.

Key features and capabilities

  • Compact architecture – based on the MiniLM‑L3 transformer (≈ 22 M parameters).
  • 384‑dimensional output – a sweet spot between representation quality and storage cost.
  • Mean‑pooling of token embeddings (the default pooling mode in the Sentence‑Transformers wrapper).
  • Supports PyTorch, TensorFlow, ONNX, OpenVINO, and Safetensors formats.
  • Optimised for low‑latency inference on CPU and GPU.

Architecture highlights

  • Transformer backbone: MiniLM‑L3, a distilled BERT‑style model with 12 layers, 384 hidden size, and 12 attention heads.
  • Pooling layer: Mean‑pooling over token embeddings (attention‑mask aware) to produce a single sentence vector.
  • Maximum sequence length: 128 tokens – sufficient for most short‑to‑medium sentences.
  • Training objective: Contrastive learning on large paraphrase and semantic similarity datasets (see Training Details).

Intended use cases

  • Semantic search – retrieve relevant documents from a large corpus in milliseconds.
  • Duplicate detection – find paraphrases or near‑identical sentences in user‑generated content.
  • Clustering & topic modelling – group semantically similar sentences without labelled data.
  • Zero‑shot classification – embed class labels and compare them to input embeddings.
  • Recommendation systems – match user queries to product descriptions or FAQs.

Benchmark Performance

For sentence‑embedding models, the most informative benchmarks are semantic textual similarity (STS) tasks such as STS‑B, SICK‑R, and paraphrase detection datasets like QQP. The paraphrase‑MiniLM‑L3‑v2 model achieves the following scores (reported by the Sentence‑Transformers community):

  • STS‑B (average Pearson / Spearman): 84.2 % / 84.0 %
  • SICK‑R (Pearson): 81.5 %
  • QQP (accuracy on paraphrase detection): 88.7 %

These numbers are competitive with larger models (e.g., paraphrase‑mpnet‑base‑v2) while using less than half the memory. The high scores demonstrate that even a lightweight 384‑dimensional embedding can capture nuanced meaning, making it ideal for production environments where latency and storage matter.

Hardware Requirements

VRAM for inference – The model file (including tokenizer) is ~ 150 MB. On a GPU, a single‑batch inference of up to 64 sentences comfortably fits in 2 GB of VRAM. For larger batches, 4 GB is recommended.

Recommended GPU – Any modern NVIDIA GPU with at least 4 GB of VRAM (e.g., GTX 1650, RTX 2060, or higher) will provide sub‑millisecond latency per sentence when using the sentence‑transformers wrapper. For CPU‑only deployments, a 12‑core CPU (Intel i7‑9700K or AMD Ryzen 7 3700X) can process ~ 200 sentences/second with the torchscript or ONNX runtime.

CPU & storage – The model can be loaded in ~ 300 MB of RAM. Disk space needed is roughly 200 MB (model + tokenizer). The Safetensors format reduces loading time by ~ 30 % compared to standard .bin files.

Performance characteristics – Mean‑pooling is linear in the number of tokens, and the short 128‑token limit keeps compute low. In practice you can expect:

  • GPU (RTX 2070, batch = 32): ~ 0.8 ms per sentence.
  • CPU (8‑core, batch = 32): ~ 5 ms per sentence.

Use Cases

Primary applications

  • Semantic search engines – index millions of short texts and retrieve the most relevant results in real time.
  • Duplicate‑question detection – platforms such as forums, help‑desks, or e‑learning sites can flag near‑identical queries.
  • Content recommendation – match user queries with product titles, news headlines, or knowledge‑base articles.
  • Clustering for analytics – group customer feedback, reviews, or survey responses without manual labeling.

Real‑world examples

  • A SaaS company uses the model to power a “similar‑ticket” feature in its support portal, reducing response time by 30 %.
  • An e‑commerce site embeds product titles and uses cosine similarity to surface “you may also like” items.
  • Academic researchers cluster research abstracts to discover emerging topics in a corpus of 500 k papers.

The model integrates seamlessly with the sentence‑transformers Python library, Hugging Face transformers, ONNX Runtime, and OpenVINO, enabling deployment on cloud, edge, or mobile environments.

Training Details

The model was trained by the sentence‑transformers team using a contrastive learning objective on a large collection of paraphrase and semantic similarity datasets. The training pipeline follows the standard SentenceTransformer recipe:

  • Backbone: MiniLM‑L3 (12 layers, 384 hidden size).
  • Pooling: Mean‑pooling of token embeddings.
  • Datasets: A diverse mix of publicly available corpora, including:
    • StackExchange XML (flax‑sentence‑embeddings/stackexchange_xml)
    • S2ORC (full‑text scientific articles)
    • MS‑MARCO (passage ranking)
    • WikiAtomicEdits (edit‑based paraphrases)
    • SNLI & Multi‑NLI (natural language inference)
    • AltLex, Simple‑Wiki, Flickr30k‑Captions, COCO‑Captions, Sentence‑Compression, QQP, Yahoo Answers Topics (various semantic similarity sources)
  • Training compute: Approximately 8 GPU‑hours on a single NVIDIA V100 (16 GB) using mixed‑precision (FP16) to accelerate convergence.
  • Fine‑tuning: Users can further fine‑tune the model on domain‑specific sentence pairs via the SentenceTransformer API, typically requiring only a few thousand labelled examples to achieve noticeable gains.

Licensing Information

The model is released under the Apache‑2.0 license, as indicated in the README. Apache‑2.0 is a permissive open‑source licence that:

  • Allows commercial use, redistribution, and modification.
  • Requires preservation of the copyright notice and a copy of the licence.
  • Provides an explicit patent grant, protecting users from patent claims on the contributed code.

There are no “unknown” restrictions – the licence is clear and widely accepted in both academic and enterprise settings. When you embed the model in a product, you must include the Apache‑2.0 notice in your documentation or about‑page. No additional attribution beyond the standard licence text is required, though citing the original Sentence‑BERT paper (see the Related Papers section) is encouraged.

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