all-MiniLM-L6-v2 is a lightweight sentence-transformers model that maps sentences and short paragraphs into 384-dimensional dense vectors optimized for semantic tasks. Designed for high-speed, low-resource environments, it supports clustering, semantic search, and similarity comparison. Based on the MiniLM architecture, the model uses a contrastive learning objective trained on over 1 billion sentence pairs from diverse datasets like Reddit, WikiAnswers, and Stack Exchange. It outperforms many larger models in embedding quality relative to size and is available in PyTorch, TensorFlow, ONNX, and other formats. all-MiniLM-L6-v2 can be used with the sentence-transformers library or directly via Hugging Face Transformers with custom pooling. Text longer than 256 tokens is truncated, making it ideal for short-form text processing. Released under the Apache 2.0 license, the model is widely adopted across academic and commercial applications for its balance of performance and efficiency.

Features

  • Maps sentences to 384-dimensional embeddings
  • Trained on over 1 billion sentence pairs using contrastive loss
  • Optimized for semantic similarity, clustering, and retrieval
  • Extremely lightweight with only 22.7M parameters
  • Supports multiple frameworks (PyTorch, TensorFlow, ONNX, Rust, OpenVINO)
  • Compatible with Hugging Face Transformers and sentence-transformers
  • Truncates input beyond 256 word pieces for efficient processing
  • Open-source under Apache 2.0, widely used in research and production

Project Samples

Project Activity

See All Activity >

Categories

AI Models

Follow all-MiniLM-L6-v2

all-MiniLM-L6-v2 Web Site

nel_h2
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of all-MiniLM-L6-v2!

Additional Project Details

Registered

2025-06-27