all-mpnet-base-v2 is a sentence embedding model from the Sentence-Transformers library that maps English sentences and paragraphs into dense 768-dimensional vector representations. Based on the microsoft/mpnet-base transformer, the model is fine-tuned using over 1.17 billion sentence pairs via contrastive learning to perform tasks such as semantic search, information retrieval, clustering, and similarity detection. It supports both PyTorch and ONNX, and can be used via SentenceTransformers or Hugging Face Transformers with custom pooling. This model truncates input longer than 384 tokens and achieves strong results across a variety of datasets, including Reddit, WikiAnswers, StackExchange, MS MARCO, and more. Originally trained during Hugging Face’s Community Week using JAX/Flax and TPUs, it delivers high-quality semantic embeddings suitable for production-scale NLP applications.
Features
- Maps sentences to 768-dimensional dense vectors
- Trained on 1.17B sentence pairs using contrastive learning
- Fine-tuned from microsoft/mpnet-base
- Optimized for sentence similarity, clustering, and retrieval
- Truncates input longer than 384 tokens
- Available in PyTorch, ONNX, and OpenVINO formats
- Efficient inference using Sentence-Transformers or Transformers
- Pretrained on diverse datasets including Reddit, S2ORC, StackExchange