Tool
all-MiniLM-L6-v2
all-MiniLM-L6-v2 is an English sentence and short-paragraph encoder. It turns text into 384-dimensional vectors intended for semantic search, clustering and sentence similarity.
What it is
The model maps each input text to a dense vector that represents semantic information. Texts with related meaning can be compared through their vectors, which makes the model usable for information retrieval, clustering and similarity tasks.1
It is intended for English inputs, and text longer than 256 word pieces is truncated by default. The model card describes it as a sentence and short-paragraph encoder.1
How it works
The input is tokenized and passed through the transformer to produce a contextual embedding for each token. The token embeddings are averaged to make one sentence vector; an attention mask ensures that padding tokens are excluded from the average. The resulting vector is L2-normalized.1
During fine-tuning, the model learns from paired sentences using a contrastive objective. It computes cosine similarities between possible sentence pairs in a batch, then applies cross-entropy loss so the true pair is favored over the other candidates.1
Where it came from
The model uses nreimers/MiniLM-L6-H384-uncased as its pretrained starting point, then fine-tunes it on more than one billion sentence pairs. It was developed during Hugging Face’s Community Week project, “Train the Best Sentence Embedding Model Ever with 1B Training Pairs.”1
Versions and relatives
The named starting checkpoint is nreimers/MiniLM-L6-H384-uncased. all-MiniLM-L6-v2 is fine-tuned from that checkpoint for sentence embeddings.1
How recent papers use it
In “Music Similarity Learning in Sparse Latin Scenarios,” the model generates dense embeddings for item descriptions and top reviews. The paper uses those embeddings as part of its music-item similarity system.2
In “GuardAgent: A Memory-Augmented Agentic Framework for Adaptive Detection of Adversarial Promotions in LLM-Based Recommendation,” the model implements the textual embedding function used by the detector.3
In “Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL,” the model is served locally to embed schema-node text offline.4
Papers that mention all-MiniLM-L6-v2
17 Nov 2026Used
Music Similarity Learning in Sparse Latin Scenarios
The Sentence Transformer model used to generate dense embeddings for item descriptions and top reviews.
17 Nov 2026Used
GuardAgent: A Memory-Augmented Agentic Framework for Adaptive Detection of Adversarial Promotions in LLM-Based Recommendation
This textual encoder is used to implement the embedding function.
16 Nov 2026Used
Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL
This locally served embedding model is used to embed node text offline.
Sources
- 1huggingface.cohuggingface.co
- 2Music Similarity Learning in Sparse Latin ScenariosPaper explained on this site
- 3GuardAgent: A Memory-Augmented Agentic Framework for Adaptive Detection of Adversarial Promotions in LLM-Based RecommendationPaper explained on this site
- 4Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQLPaper explained on this site
Every paragraph above was checked against the sources it cites before it was published.