alt.freeweights.embed / all-mpnet-base-v2
From: sentence-transformers <huggingface.co/sentence-transformers>Newsgroups: alt.freeweights.embedSubject:

all-mpnet-base-v2

Date: 2026-11-14Commit: e8c3b32Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 109M parameters. Onnx and openvino and safetensors weights, 3.82 GB in all. Published by sentence-transformers under Apache-2.0.

109M params3.82GBall-mpnet-base-v2onnx openvino safetensorspermissive
FactsParams109MSize3.82 GBFormatsonnx, openvino, safetensorsTasksentence similarityLicenseApache-2.0From sourcepermissive
$ fw get sentence-transformers/all-mpnet-base-v2
# manifest sha256 61a96167f662… · 3.82 GB · 28 files
$ fw verify ./all-mpnet-base-v2 sentence-transformers/all-mpnet-base-v2
From sourceHosted (signed)sentence-transformers/all-mpnet-base-v2Last check: 2026-11-14 21:10 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Evaluate with

Overview

Size
3.82 GB
Weights
438 MB (safetensors)
Parameters
109M
Formats
onnx, openvino, safetensors
Task
sentence similarity
License
Apache-2.0 (permissive)
Files
28, each with a sha256
Publisher
sentence-transformers
Added
2026-11-14
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:10 UTCpassed

Model card

From the publisher at commit e8c3b32. Shown as plain text with links; images open at the publisher.

all-mpnet-base-v2#

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.

Usage (Sentence-Transformers)#

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')
embeddings = model.encode(sentences)
print(embeddings)

Usage (HuggingFace Transformers)#

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F

#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] #First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)


# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-mpnet-base-v2')
model = AutoModel.from_pretrained('sentence-transformers/all-mpnet-base-v2')

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)

# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])

# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)

print("Sentence embeddings:")
print(sentence_embeddings)

Usage (Text Embeddings Inference (TEI))#

Text Embeddings Inference (TEI) is a blazing fast inference solution for text embedding models.

  • CPU:
docker run -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-latest --model-id sentence-transformers/all-mpnet-base-v2 --pooling mean --dtype float16
  • NVIDIA GPU:
docker run --gpus all -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-latest --model-id sentence-transformers/all-mpnet-base-v2 --pooling mean --dtype float16

Send a request to /v1/embeddings to generate embeddings via the OpenAI Embeddings API:

curl http://localhost:8080/v1/embeddings \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "sentence-transformers/all-mpnet-base-v2",
    "input": ["This is an example sentence", "Each sentence is converted"]
  }'

Or check the Text Embeddings Inference API specification instead.


Background#

The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised contrastive learning objective. We used the pretrained microsoft/mpnet-base model and fine-tuned in on a 1B sentence pairs dataset. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.

We developed this model during the Community week using JAX/Flax for NLP & CV, organized by Hugging Face. We developed this model as part of the project: Train the Best Sentence Embedding Model Ever with 1B Training Pairs. We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.

Intended uses#

Our model is intented to be used as a sentence and short paragraph encoder. Given an input text, it outputs a vector which captures the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.

By default, input text longer than 384 word pieces is truncated.

Training procedure#

Pre-training#

We use the pretrained microsoft/mpnet-base model. Please refer to the model card for more detailed information about the pre-training procedure.

Fine-tuning#

We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch. We then apply the cross entropy loss by comparing with true pairs.

Hyper parameters#

We trained our model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core). We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer with a 2e-5 learning rate. The full training script is accessible in this current repository: train_script.py.

Training data#

We use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences. We sampled each dataset given a weighted probability which configuration is detailed in the data_config.json file.

DatasetPaperNumber of training tuples
Reddit comments (2015-2018)paper726,484,430
S2ORC Citation pairs (Abstracts)paper116,288,806
WikiAnswers Duplicate question pairspaper77,427,422
PAQ (Question, Answer) pairspaper64,371,441
S2ORC Citation pairs (Titles)paper52,603,982
S2ORC (Title, Abstract)paper41,769,185
Stack Exchange (Title, Body) pairs-25,316,456
Stack Exchange (Title+Body, Answer) pairs-21,396,559
Stack Exchange (Title, Answer) pairs-21,396,559
MS MARCO tripletspaper9,144,553
GOOAQ: Open Question Answering with Diverse Answer Typespaper3,012,496
Yahoo Answers (Title, Answer)paper1,198,260
Code Search-1,151,414
COCO Image captionspaper828,395
SPECTER citation tripletspaper684,100
Yahoo Answers (Question, Answer)paper681,164
Yahoo Answers (Title, Question)paper659,896
SearchQApaper582,261
Eli5paper325,475
Flickr 30kpaper317,695
Stack Exchange Duplicate questions (titles)304,525
AllNLI (SNLI and MultiNLIpaper SNLI, paper MultiNLI277,230
Stack Exchange Duplicate questions (bodies)250,519
Stack Exchange Duplicate questions (titles+bodies)250,460
Sentence Compressionpaper180,000
Wikihowpaper128,542
Altlexpaper112,696
Quora Question Triplets-103,663
Simple Wikipediapaper102,225
Natural Questions (NQ)paper100,231
SQuAD2.0paper87,599
TriviaQA-73,346
Total1,170,060,424

Files

28 files · 3.82 GBWeights 438 MB (safetensors). Sizes and sha256 from the signed manifest.
Show all 28 files with their sha256
FileSizesha256
.gitattributes1.23 KB98ccb431c012ebfe976280fbd45aea4cec7409935868ccecf3954370f96732a1
1_Pooling/config.json190 Ba37f83ada23e7887be6b88f4998927dbeac0038af301553c7cd5461413bf1a56
README.md11.6 KB89a1a9c3290fe58e76c939b578c48a14331dc7bfcaaf5a53102adb183da6f96a
config.json571 Bd46a3e04ded82bba22528424480697d394eeda6a27484e08c5bb2bdf5906cfa0
config_sentence_transformers.json116 B061ca9d39661d6c6d6de5ba27f79a1cd5770ea247f8d46412a68a498dc5ac9f3
data_config.json39.3 KB32edcb108fc2516b920734a862ae0692bcae1c5d45d5f8d972cb0d53434a4c54
model.safetensors438 MB78c0197b6159d92658e319bc1d72e4c73a9a03dd03815e70e555c5ef05615658
modules.json349 B84e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf
onnx/model.onnx436 MB74187b16d9c946fea252e120cfd7a12c5779d8b8b86838a2e4c56573c47941bd
onnx/model_O1.onnx436 MB5c0b47004076ab40bf15a2c52b98a53e985ebb84faaeeb6d2551768f96e384b0
onnx/model_O2.onnx436 MB14d01256f5f3d2245b15b596173bca4367c9405fde5700dd7fb4e110708c1793
onnx/model_O3.onnx436 MBdd55510706038d0817b7d41bf2078f01472e4865190584ad624e8ab79bbcb310
onnx/model_O4.onnx218 MBcab2a54139fc4fd5b8e2a23cb5729ee28dc44cfde685ad3356d533653e635310
onnx/model_qint8_arm64.onnx110 MBc392a9c545c7d4438a16fed8287a76a576b27eaf029c1c23bbf78a7a666d197f
onnx/model_qint8_avx512.onnx110 MBc392a9c545c7d4438a16fed8287a76a576b27eaf029c1c23bbf78a7a666d197f
onnx/model_qint8_avx512_vnni.onnx110 MBc392a9c545c7d4438a16fed8287a76a576b27eaf029c1c23bbf78a7a666d197f
onnx/model_quint8_avx2.onnx110 MBaa5c27172d77bbd1cbae3628cbac4b26d7c12adabff25d2d4285d0f29159b237
openvino/openvino_model.bin436 MB5c3279d833888eaab745e24b652126c5a71375af185ac21aa47e112e2468dec0
openvino/openvino_model.xml433 KBa2912e3dbd3426b77984992953998d8026a3d2377104093079e810b53fc51bf6
openvino/openvino_model_qint8_quantized.bin110 MBfde0c650018f5e244f793316b666aaf4758d4e19072f430e59eb2bcc414895ce
openvino/openvino_model_qint8_quantized.xml742 KB930bc2a849d48941bb4752d8dac018f0c0ee8709ba023e47aeab4f8bb9c25b59
pytorch_model.bin438 MBa8fd120b1a0032e70ff3d4b8ab8e46a6d01c2cb08ffe7c007a021c1788928146
sentence_bert_config.json53 Bcabfacded9272091a06ff595a46ef027a76ddf4ac9e77d0fcf11c605748f1667
special_tokens_map.json239 B9ef40e9c160511bf3f46ceb71f1471dafa1e9473d5120bb816c36b2efa75f8ba
tokenizer.json466 KBb8be2c30ba5dd723a6d5ee26d013da103d5408d92ddcb23747622f9e48f1d842
tokenizer_config.json363 B67f2ff7e223518e729869bb3a70f0caf8368fe549383fc11cfe2dfb42fffc268
train_script.py13.1 KBdea86a7066caa55d0c84c343890dfd849714b6affd8b424ba12372a091578cc8
vocab.txt232 KBdbd90cb94e2247bd4d4ccaecbf616d2290e66691d7d5e5bb81f063c2d0649ada
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
e8c3b32edf pinned now manifest updated, same commit2026-11-14 21:10 UTC28 files · 3.82 GB
e8c3b32edf2026-11-14 21:10 UTC28 files · 3.82 GB

Use it

$ fw get sentence-transformers/all-mpnet-base-v2
# manifest sha256 61a96167f662… · 3.82 GB · 28 files
$ fw verify ./all-mpnet-base-v2 sentence-transformers/all-mpnet-base-v2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/sentence-transformers/all-mpnet-base-v2.json --dir ./all-mpnet-base-v2 $ python3 fw.py verify ./all-mpnet-base-v2 ./sentence-transformers__all-mpnet-base-v2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download sentence-transformers/all-mpnet-base-v2 --revision e8c3b32edf5434bc2275fc9bab85f82640a19130 --local-dir ./all-mpnet-base-v2
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("sentence-transformers/all-mpnet-base-v2", revision="e8c3b32edf5434bc2275fc9bab85f82640a19130") model = AutoModel.from_pretrained("sentence-transformers/all-mpnet-base-v2", revision="e8c3b32edf5434bc2275fc9bab85f82640a19130", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2", revision="e8c3b32edf5434bc2275fc9bab85f82640a19130") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
89a1a9c3290fe58e76c939b578c48a14331dc7bfcaaf5a53102adb183da6f96a
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: sentence-transformers <huggingface.co/sentence-transformers>Newsgroups: alt.freeweights.embedSubject: all-mpnet-base-v2Date: 2026-11-14Commit: e8c3b32Signed: 2DC28CC7B26A283B ✓
Upstream
sentence-transformers/all-mpnet-base-v2
Pinned commit
e8c3b32edf5434bc2275fc9bab85f82640a19130
Manifest
all-mpnet-base-v2.json · .minisig
Manifest sha256
61a96167f6626b018abf78e27de9f20dcf2c859a7ec836953e2a89b1b9c6c112
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:10 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/sentence-transformers/all-mpnet-base-v2.json $ curl -O https://freeweights.allternit.com/manifests/sentence-transformers/all-mpnet-base-v2.json.minisig $ minisign -Vm all-mpnet-base-v2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download sentence-transformers/all-mpnet-base-v2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. all-mpnet-base-v2.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens