AI Tools.

Search

sentence similarity by sentence-transformers

all-MiniLM-L6-v2

Distilled BERT model that encodes sentences into 384-dimensional vectors for measuring semantic similarity. Trained on over a billion sentence pairs spanning scientific papers, web QA, NLI datasets, and community forums. At 22M parameters and 6 transformer layers, it is fast enough for CPU inference while remaining competitive on standard sentence similarity benchmarks.

Summary text generated by an automated pipeline from the model card · Not individually reviewed or run by us · How this page is made

From the model card

Fields below are copied from the tags and counters on the HuggingFace repository sentence-transformers/all-MiniLM-L6-v2 at our last fetch. They are set by the uploader, not verified by us; rows with no tag are omitted. How this page is made.

Publisher (HF namespace)
sentence-transformers
Pipeline tag
sentence-similarity
Library
Sentence Transformers, Transformers
Framework tags
PyTorch, TensorFlow, Rust (candle)
Weight formats
ONNX, safetensors, OpenVINO
License tag
apache-2.0 — read the license file in the repo before relying on it
Lineage
Language tags
English (en)
Papers cited
arXiv:1904.06472, arXiv:2102.07033, arXiv:2104.08727, arXiv:1704.05179, arXiv:1810.09305
Datasets declared
s2orc, flax-sentence-embeddings/stackexchange_xml, ms_marco, gooaq, yahoo_answers_topics, code_search_net, search_qa, eli5 and 13 more on the model card
Downloads (HF counter at last fetch)
246,135,287
Likes (HF counter at last fetch)
5,463
Model card
https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2

Use cases

  • Semantic search over document collections at scale
  • Clustering similar support tickets automatically
  • Duplicate detection in FAQ or knowledge base entries
  • Cross-sentence relevance scoring in retrieval pipelines
  • Building paraphrase detection for content deduplication

Pros

  • Fast CPU-friendly inference due to compact 22M parameters
  • 384-dim output keeps vector store costs low at scale
  • Apache 2.0 license; ONNX and OpenVINO export supported
  • Broad training data reduces out-of-domain gaps for general English text
  • Drop-in compatible with sentence-transformers library

Cons

  • English-only; no cross-lingual transfer capability
  • 384-dim precision ceiling lags behind 768-dim alternatives on hard STS benchmarks
  • Sensitive to input phrasing — asymmetric queries degrade similarity scores
  • No instruction prefix support, unlike newer embedding models

Tags

sentence-transformerspytorchtfrustonnxsafetensorsopenvinobertfeature-extractionsentence-similaritytransformersendataset:s2orcdataset:flax-sentence-embeddings/stackexchange_xmldataset:ms_marcodataset:gooaqdataset:yahoo_answers_topicsdataset:code_search_netdataset:search_qadataset:eli5