AI SeedbankHelp preserve open and free AI for humanity's future

← All models

sentence-transformers_multi-qa-mpnet-base-cos-v1

sentence-transformers · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: 1 · Leechers: 0

Observed 2026-09-02T13:56:39Z via announce.aitorrent.org:7070.

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


language:

  • en library_name: sentence-transformers tags:
  • sentence-transformers
  • feature-extraction
  • sentence-similarity
  • transformers
  • text-embeddings-inference pipeline_tag: sentence-similarity

multi-qa-mpnet-base-cos-v1

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and was designed for semantic search. It has been trained on 215M (question, answer) pairs from diverse sources. For an introduction to semantic search, have a look at: SBERT.net - 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, util

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

#Load the model
model = SentenceTransformer('sentence-transformers/multi-qa-mpnet-base-cos-v1')

#Encode query and documents
query_emb = model.encode(query)
doc_emb = model.encode(docs)

#Compute dot score between query and all document embeddings
scores = util.dot_score(query_emb, doc_emb)[0].cpu().tolist()

#Combine docs & scores
doc_score_pairs = list(zip(docs, scores))

#Sort by decreasing score
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)

#Output passages & scores
for doc, score in doc_score_pairs:
    print(score, doc)

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 correct 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 average of all tokens
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output.last_hidden_state # 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)


# Encode text
def encode(texts):
    # Tokenize sentences
    encoded_input = tokenizer(texts, padding=True, truncation=True, return_tensors='pt')

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

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

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


# Sentences we want sentence embeddings for
query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/multi-qa-mpnet-base-cos-v1")
model = AutoModel.from_pretrained("sentence-transformers/multi-qa-mpnet-base-cos-v1")

# Encode query and docs
query_emb = encode(query)
doc_emb = encode(docs)

# Compute dot score between query and all document embeddings
scores = torch.mm(query_emb, doc_emb.transpose(0, 1))[0].cpu().tolist()

# Combine docs & scores
doc_score_pairs = list(zip(docs, scores))

# Sort by decreasing score
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)

# Output passages & scores
for doc, score in doc_score_pairs:
    print(score, doc)

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/multi-qa-mpnet-base-cos-v1 --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/multi-qa-mpnet-base-cos-v1 --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/multi-qa-mpnet-base-cos-v1",
    "input": "How many people live in London?"
  }'

Or check the Text Embeddings Inference API specification instead.

Technical Details

In the following some technical details how this model must be used:

Setting Value
Dimensions 768
Produces normalized embeddings Yes
Pooling-Method Mean pooling
Suitable score functions dot-product (util.dot_score), cosine-similarity (util.cos_sim), or euclidean distance

Note: When loaded with sentence-transformers, this model produces normalized embeddings with length 1. In that case, dot-product and cosine-similarity are equivalent. dot-product is preferred as it is faster. Euclidean distance is proportional to dot-product and can also be used.


Background

The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised contrastive learning objective. 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 Google's Flax, JAX, and Cloud team members about efficient deep learning frameworks.

Intended uses

Our model is intended to be used for semantic search: It encodes queries / questions and text paragraphs in a dense vector space. It finds relevant documents for the given passages.

Note that there is a limit of 512 word pieces: Text longer than that will be truncated. Further note that the model was just trained on input text up to 250 word pieces. It might not work well for longer text.

Training procedure

The full training script is accessible in this current repository: train_script.py.

Pre-training

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

Training

We use the concatenation of multiple datasets to fine-tune our model. In total we have about 215M (question, answer) pairs. We sampled each dataset given a weighted probability which configuration is detailed in the data_config.json file.

The model was trained with MultipleNegativesRankingLoss using Mean-pooling, cosine-similarity as similarity function, and a scale of 20.

Dataset Number of training tuples
WikiAnswers Duplicate question pairs from WikiAnswers 77,427,422
PAQ Automatically generated (Question, Paragraph) pairs for each paragraph in Wikipedia 64,371,441
Stack Exchange (Title, Body) pairs from all StackExchanges 25,316,456
Stack Exchange (Title, Answer) pairs from all StackExchanges 21,396,559
MS MARCO Triplets (query, answer, hard_negative) for 500k queries from Bing search engine 17,579,773
GOOAQ: Open Question Answering with Diverse Answer Types (query, answer) pairs for 3M Google queries and Google featured snippet 3,012,496
Amazon-QA (Question, Answer) pairs from Amazon product pages 2,448,839
Yahoo Answers (Title, Answer) pairs from Yahoo Answers 1,198,260
Yahoo Answers (Question, Answer) pairs from Yahoo Answers 681,164
Yahoo Answers (Title, Question) pairs from Yahoo Answers 659,896
SearchQA (Question, Answer) pairs for 140k questions, each with Top5 Google snippets on that question 582,261
ELI5 (Question, Answer) pairs from Reddit ELI5 (explainlikeimfive) 325,475
Stack Exchange Duplicate questions pairs (titles) 304,525
Quora Question Triplets (Question, Duplicate_Question, Hard_Negative) triplets for Quora Questions Pairs dataset 103,663
Natural Questions (NQ) (Question, Paragraph) pairs for 100k real Google queries with relevant Wikipedia paragraph 100,231
SQuAD2.0 (Question, Paragraph) pairs from SQuAD2.0 dataset 87,599
TriviaQA (Question, Evidence) pairs 73,346
Total 214,988,242

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:60369de6ce47e58ab1819eb46c626812af7d3166&dn=sentence-transformers_multi-qa-mpnet-base-cos-v1

Open magnet in torrent client · infohash 60369de6ce47e58ab1819eb46c626812af7d3166

Files & hashes

PathSizesha1sha256
1_Pooling/config.json190 B (190 B)4e09f293dfe90bba49f87cfe7996271f07be2666a37f83ada23e7887be6b88f4998927dbeac0038af301553c7cd5461413bf1a56
README.md10.2 KB (10,453 B)b8d3008139c1ce68c199c6efef0681bf31b76e7b6e1014700cb903b18265b7f85db5cf45a4d3e71bc2a9b05989b6648abdcf3c1c
config.json571 B (571 B)b9fd4298819da011007a6a4ceb728c860914fc88d46a3e04ded82bba22528424480697d394eeda6a27484e08c5bb2bdf5906cfa0
config_sentence_transformers.json116 B (116 B)fd1b291129c607e5d49799f87cb219b27f98acdf061ca9d39661d6c6d6de5ba27f79a1cd5770ea247f8d46412a68a498dc5ac9f3
data_config.json24.9 KB (25,457 B)a3294881c9834ac6fb99d420008f30b741fe7e86163295fe27834a12a37d9ef1a6175a6c1c530a48ee42b640149b518e0bedae62
model.safetensors417.7 MB (437,971,872 B)703bdf5e147428ab020871a143086c8038dd69ba7b42b8f6259f5a9b83c5d0acd7cfde8f6fa9833a2edd3f8da4a94da7a03fa037
modules.json349 B (349 B)952a9b81c0bfd99800fabf352f69c7ccd46c5e4384e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf
openvino/openvino_model.bin415.4 MB (435,583,684 B)ed1b9b603cf4a22f41a71c073a9bca0a60da6970d0f8059856ed8850f349fad7f3781f43656b68073aa899ed326400c51d72c5e1
openvino/openvino_model.xml422.6 KB (432,773 B)e48a396d55a3e10c09ba5b0c86068f3a730b126ef060ac3e60a0cb4e9ee54f2eb97fc186630531f776447129117ab12d4bec09ad
openvino/openvino_model_qint8_quantized.bin104.9 MB (109,974,792 B)8a885b14de1b7535230c5f082e772e1755a43b64636a2d8f9d82becc80c2a1ee4f7da3231ef00abf32f66747adfd5da17a674f73
openvino/openvino_model_qint8_quantized.xml724.7 KB (742,101 B)78d12ee2369e01393f6c0ec3f1f158bcb8a715472d798c38d805db0efbf9171a462437764221878c2c87d8b23dbb98584b8e9dfa
pytorch_model.bin417.7 MB (438,011,953 B)658a4455273b53fa35b9215cb752cd347bfc4f7f5aba022a15fe19a16a4a78271c9289705066308dbf65765618cc7f4856bcd582
sentence_bert_config.json53 B (53 B)f789d99277496b282d19020415c5ba9ca79ac875ec8e29d6dcb61b611b7d3fdd2982c4524e6ad985959fa7194eacfb655a8d0d51
special_tokens_map.json239 B (239 B)378d4fa393d5eaccf69c437a20f1cda6ac65c14d9ef40e9c160511bf3f46ceb71f1471dafa1e9473d5120bb816c36b2efa75f8ba
tokenizer.json455.1 KB (466,021 B)99ab0363136b2901455b583971ad62829c311cfe0930eac956e241b04141ce21b990a5d818feb3be3c559357a4ef5cf261d086ce
tokenizer_config.json363 B (363 B)20ae1276042f43d1c80f4f7b7f084a8704592c1d67f2ff7e223518e729869bb3a70f0caf8368fe549383fc11cfe2dfb42fffc268
train_script.py13.5 KB (13,860 B)9f4d21eac22ab68ce4267c7a4a9daa1f54d388c00da65b3892940cf585dd5fca04a9d9499a6d0067e7f19f314b4abf4f06ec85e2
vocab.txt226.1 KB (231,536 B)1c51ab79a2298a340952d3e6012042a9c84bbe4ddbd90cb94e2247bd4d4ccaecbf616d2290e66691d7d5e5bb81f063c2d0649ada

Cite this release

Canonical URL
https://aiseedbank.org/models/sentence-transformers_multi-qa-mpnet-base-cos-v1/
Slug
sentence-transformers_multi-qa-mpnet-base-cos-v1
Infohash
60369de6ce47e58ab1819eb46c626812af7d3166
License
no license recorded
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: sentence-transformers_multi-qa-mpnet-base-cos-v1.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorysentence-transformers/multi-qa-mpnet-base-cos-v1
Revision (pinned)d51b22a1dfa8184e9258074e56e2875e50612dca
Fetched at2026-09-02T04:44:06Z
License at fetchno license recorded
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-02T04:44:22Z

no license recorded1.33 GB (1,423,466,383 bytes)sentence-transformerspytorchonnxsafetensorsopenvinompnetfill-maskfeature-extractionsentence-similaritytransformerstext-embeddings-inferenceendpoints_compatible1 language (en)