AI Tools.

Search

sentence similarity by sentence-transformers

all-MiniLM-L12-v2

A 12-layer sentence encoder producing 384-dimensional embeddings, offering a quality step up from all-MiniLM-L6-v2 at roughly 2x the inference cost. Fine-tuned on a billion sentence pairs using contrastive objectives for semantic similarity and retrieval.

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-L12-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, 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)
3,722,980
Likes (HF counter at last fetch)
327
Model card
https://huggingface.co/sentence-transformers/all-MiniLM-L12-v2

Use cases

  • Semantic search where L6 quality is insufficient but latency allows L12
  • Document clustering in medium-throughput pipelines
  • Semantic textual similarity scoring
  • Cross-encoder training data preparation via hard negative mining

Pros

  • 12-layer depth improves ranking quality over L6 on MTEB
  • Apache-2.0 licensed
  • Identical API to other sentence-transformers models
  • 384-dim output is lightweight for storage at scale

Cons

  • Still outperformed by E5-large and GTE models on most MTEB tasks
  • English-only
  • Twice the inference time of L6 for modest quality improvement
  • Not suitable for long documents — 256-token context window

Tags

sentence-transformerspytorchrustonnxsafetensorsopenvinobertfeature-extractionsentence-similaritytransformersendataset:s2orcdataset:flax-sentence-embeddings/stackexchange_xmldataset:ms_marcodataset:gooaqdataset:yahoo_answers_topicsdataset:code_search_netdataset:search_qadataset:eli5dataset:snli