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

← All models

sentence-transformers_all-distilroberta-v1

sentence-transformers · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

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 license: apache-2.0 library_name: sentence-transformers tags:

  • sentence-transformers
  • feature-extraction
  • sentence-similarity
  • transformers datasets:
  • s2orc
  • flax-sentence-embeddings/stackexchange_xml
  • ms_marco
  • gooaq
  • yahoo_answers_topics
  • code_search_net
  • search_qa
  • eli5
  • snli
  • multi_nli
  • wikihow
  • natural_questions
  • trivia_qa
  • embedding-data/sentence-compression
  • embedding-data/flickr30k-captions
  • embedding-data/altlex
  • embedding-data/simple-wiki
  • embedding-data/QQP
  • embedding-data/SPECTER
  • embedding-data/PAQ_pairs
  • embedding-data/WikiAnswers pipeline_tag: sentence-similarity

all-distilroberta-v1

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-distilroberta-v1')
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-distilroberta-v1')
model = AutoModel.from_pretrained('sentence-transformers/all-distilroberta-v1')

# 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)

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 distilroberta-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 developped this model during the Community week using JAX/Flax for NLP & CV, organized by Hugging Face. We developped 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 ouptuts 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 128 word pieces is truncated.

Training procedure

Pre-training

We use the pretrained distilroberta-base. 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 ou model on a TPU v3-8. We train the model during 920k steps using a batch size of 512 (64 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.

Dataset Paper Number of training tuples
Reddit comments (2015-2018) paper 726,484,430
S2ORC Citation pairs (Abstracts) paper 116,288,806
WikiAnswers Duplicate question pairs paper 77,427,422
PAQ (Question, Answer) pairs paper 64,371,441
S2ORC Citation pairs (Titles) paper 52,603,982
S2ORC (Title, Abstract) paper 41,769,185
Stack Exchange (Title, Body) pairs - 25,316,456
MS MARCO triplets paper 9,144,553
GOOAQ: Open Question Answering with Diverse Answer Types paper 3,012,496
Yahoo Answers (Title, Answer) paper 1,198,260
Code Search - 1,151,414
COCO Image captions paper 828,395
SPECTER citation triplets paper 684,100
Yahoo Answers (Question, Answer) paper 681,164
Yahoo Answers (Title, Question) paper 659,896
SearchQA paper 582,261
Eli5 paper 325,475
Flickr 30k paper 317,695
Stack Exchange Duplicate questions (titles) 304,525
AllNLI (SNLI and MultiNLI paper SNLI, paper MultiNLI 277,230
Stack Exchange Duplicate questions (bodies) 250,519
Stack Exchange Duplicate questions (titles+bodies) 250,460
Sentence Compression paper 180,000
Wikihow paper 128,542
Altlex paper 112,696
Quora Question Triplets - 103,663
Simple Wikipedia paper 102,225
Natural Questions (NQ) paper 100,231
SQuAD2.0 paper 87,599
TriviaQA - 73,346
Total 1,124,818,467

Magnet link

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

magnet:?xt=urn:btih:248d0a9e15961293eb9b0b5a51575707946139e3&dn=sentence-transformers_all-distilroberta-v1

Open magnet in torrent client · infohash 248d0a9e15961293eb9b0b5a51575707946139e3

Files & hashes

PathSizesha1sha256
1_Pooling/config.json190 B (190 B)4e09f293dfe90bba49f87cfe7996271f07be2666a37f83ada23e7887be6b88f4998927dbeac0038af301553c7cd5461413bf1a56
README.md9.9 KB (10,132 B)8b8229cbb0b1550fb6f3a154ba93de824d954861565f15ef1c8232cf21b91aa9125bd852f54f2f676c662324732ee3d4d3a43a8c
config.json653 B (653 B)991311fa61295e619c32a79fc4e05a921761f66a6f9efb40bd192274dd2e6f43c326cd4571cbefe647f4a274e83073be4f13f928
config_sentence_transformers.json116 B (116 B)fd1b291129c607e5d49799f87cb219b27f98acdf061ca9d39661d6c6d6de5ba27f79a1cd5770ea247f8d46412a68a498dc5ac9f3
data_config.json15.3 KB (15,679 B)a52c955464a48cc01e51f73c50aa91d82344cd482ba682c372ee7ac37d519df39571ec0543f55ae31273844be05f8a5acdf92e2a
merges.txt445.7 KB (456,356 B)6636bda4a1fd7a63653dffb22683b8162c8de956fe36cab26d4f4421ed725e10a2e9ddb7f799449c603a96e7f29b5a3c82a95862
model.safetensors313.3 MB (328,489,328 B)1b8a3d119a8740eedc6844064bce7ca756be423d3c739fad12f3f12428a677cfcc73391a5860a8bad0ff7a971fd67e6065201fc2
modules.json349 B (349 B)952a9b81c0bfd99800fabf352f69c7ccd46c5e4384e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf
openvino/openvino_model.bin311.0 MB (326,115,476 B)fd70324721f43210acf79d0f71ad85f5dc3521d3212d7661f0a72e6cfafdbc9ce156c32c9ec3030663913b983e9ee7f3bb7bc2f1
openvino/openvino_model.xml211.5 KB (216,537 B)55072d95962b7f39190a01fb50ddca63ae954ec556e64ede58f6346edb466651bd2b5203638d8cdb950a0e590af63d7b564a3a04
openvino/openvino_model_qint8_quantized.bin78.4 MB (82,214,692 B)9ebf7acbbec0c836b560b8e4331a0a5a48176022308b23332854f2f9ce36f15c94fb43607055e287af5db067c76366c1f7730b55
openvino/openvino_model_qint8_quantized.xml364.4 KB (373,106 B)7746f199327697a5cedee13d0000f8f8036972c072af68bafc907dab889336ab0929745674744dfd9fde1bce483ebb97413c19c2
pytorch_model.bin313.3 MB (328,509,745 B)99b1e4e3ee307689cdd5add2da21f910656ecb98b90e424e0e828f48fc6f61110570e46f6ad7c566c9de13c317cf8408e0e81fd6
rust_model.ot313.3 MB (328,508,051 B)a14c45281488e9a99ca6950b8792b2caef4ae5d3d1a9901b8d3bf5c8ae697f6601759dde10427392d055bf65bac4e9b9191a5039
sentence_bert_config.json53 B (53 B)f789d99277496b282d19020415c5ba9ca79ac875ec8e29d6dcb61b611b7d3fdd2982c4524e6ad985959fa7194eacfb655a8d0d51
special_tokens_map.json239 B (239 B)2ea7ad0e45a9d1d1591782ba7e29a703d0758831378eb3bf733eb16e65792d7e3fda5b8a4631387ca04d2015199c4d4f22ae554d
tokenizer.json1.3 MB (1,356,047 B)7a7f517f71e7a3286b03572ece4fb2e5a0571db67a6751507c44ab383cc8ba8ab97cd857d35025ff1b29162b1690cc5e0c6030e9
tokenizer_config.json333 B (333 B)f0f9eb3c7cf00c97fa0bb29e72b5563a0bbc7f195066b57002ab15418f3472aa53a8b083878f84050e8153ba62b9d40e10651a4c
train_script.py12.8 KB (13,129 B)3f8c6e165a759be8780e1cd5ee228f3022063392cfb4284ab26ca8aa95b9bddeb6b676ef759e565305890efaaa8b5e7dc5db7ebb
vocab.json779.6 KB (798,293 B)4ebe4bb3f3114daf2e4cc349f24873a1175a35d7ed19656ea1707df69134c4af35c8ceda2cc9860bf2c3495026153a133670ab5e

Cite this release

Canonical URL
https://aiseedbank.org/models/sentence-transformers_all-distilroberta-v1/
Slug
sentence-transformers_all-distilroberta-v1
Infohash
248d0a9e15961293eb9b0b5a51575707946139e3
License
apache-2.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: sentence-transformers_all-distilroberta-v1.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorysentence-transformers/all-distilroberta-v1
Revision (pinned)842eaed40bee4d61673a81c92d5689a8fed7a09f
Fetched at2026-09-04T05:35:29Z
License at fetchapache-2.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-04T05:35:44Z

apache-2.01.30 GB (1,397,078,504 bytes)sentence-transformerspytorchrustonnxsafetensorsopenvinorobertafill-maskfeature-extractionsentence-similaritytransformerstext-embeddings-inferenceendpoints_compatible1 language (en)paper: 1904.06472paper: 2102.07033paper: 2104.08727paper: 1704.05179paper: 1810.09305