SAVRN
Search Contact SAVRN

Open-weight model · Zero-shot classification

nli-distilroberta-base

by Sentence Transformers - Cross-Encoders cross-encoder/nli-distilroberta-base

This model was trained using SentenceTransformers Cross-Encoder class. The model was trained on the SNLI and MultiNLI datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral.

Parameters82M
Context514
Weights3.2 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads41.6k

Runs On

What it takes to serve nli-distilroberta-base (82M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.2 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Sentence Transformers - Cross-Encoders, published under apache-2.0, revision b14d131f9d32.

This model was trained using SentenceTransformers Cross-Encoder class. The model was trained on the SNLI and MultiNLI datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral. For evaluation results, see SBERT.net - Pretrained Cross-Encoder. Pre-trained models can be used like this: You can use the model also directly with Transformers library (without SentenceTransformers library): This model can also be used for zero-shot-classification

Read Sentence Transformers - Cross-Encoders's full model card

Cross-Encoder for Natural Language Inference

This model was trained using SentenceTransformers Cross-Encoder class.

Training Data

The model was trained on the SNLI and MultiNLI datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral.

Performance

For evaluation results, see SBERT.net - Pretrained Cross-Encoder.

Usage

Pre-trained models can be used like this:

from sentence_transformers import CrossEncoder
model = CrossEncoder('cross-encoder/nli-distilroberta-base')
scores = model.predict([('A man is eating pizza', 'A man eats something'), ('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')])

#Convert scores to labels
label_mapping = ['contradiction', 'entailment', 'neutral']
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]

Usage with Transformers AutoModel

You can use the model also directly with Transformers library (without SentenceTransformers library):

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model = AutoModelForSequenceClassification.from_pretrained('cross-encoder/nli-distilroberta-base')
tokenizer = AutoTokenizer.from_pretrained('cross-encoder/nli-distilroberta-base')

features = tokenizer(['A man is eating pizza', 'A black race car starts up in front of a crowd of people.'], ['A man eats something', 'A man is driving down a lonely road.'],  padding=True, truncation=True, return_tensors="pt")

model.eval()
with torch.no_grad():
    scores = model(**features).logits
    label_mapping = ['contradiction', 'entailment', 'neutral']
    labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
    print(labels)

Zero-Shot Classification

This model can also be used for zero-shot-classification:

from transformers import pipeline

classifier = pipeline("zero-shot-classification", model='cross-encoder/nli-distilroberta-base')

sent = "Apple just announced the newest iPhone X"
candidate_labels = ["technology", "sports", "politics"]
res = classifier(sent, candidate_labels)
print(res)

Configuration

Architecture
RobertaForSequenceClassification
Context length (tokens)
514
Layers
6
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
50,265
Model type
roberta

Identity and Version

Repository
cross-encoder/nli-distilroberta-base
Publisher
Sentence Transformers - Cross-Encoders
Task
Zero-shot classification
Modality
Text
Library
sentence-transformers
Parameters
82M parameters
Languages
en
Revision
b14d131f9d32668a5e6a982729b57ff6ed5dfcbd
First published
2022-03-02
Last updated
2025-04-11

Files and Weights

25 files, 3.2 GB in total. The weights are 14 files totalling 3.2 GB in bin, msgpack, onnx, safetensors.

Weights14 files · 3.2 GB
Configuration2 files · 1.7 KB
Tokenizer4 files · 4.8 MB
Documentation1 file · 2.7 KB
Other3 files · 591.2 KB
Repository1 file · 445 B
Every file
FileTypeSizeSHA-256
flax_model.msgpackWeights328.5 MB f1d007c150a2
model.safetensorsWeights328.5 MB 9df3eb5d3711
onnx/model.onnxWeights328.6 MB 3ace438d5b0a
onnx/model_O1.onnxWeights328.6 MB a62134fe4bba
onnx/model_O2.onnxWeights328.5 MB 4a35e10df486
onnx/model_O3.onnxWeights328.5 MB adf3cf5cbdd7
onnx/model_O4.onnxWeights164.3 MB 64e07a6eeeb5
onnx/model_qint8_arm64.onnxWeights82.8 MB a3aec44a4d2a
onnx/model_qint8_avx512.onnxWeights82.8 MB a3aec44a4d2a
onnx/model_qint8_avx512_vnni.onnxWeights82.8 MB a3aec44a4d2a
onnx/model_quint8_avx2.onnxWeights82.8 MB cd21e27865fd
openvino/openvino_model.binWeights328.5 MB f65f6143f284
openvino/openvino_model_qint8_quantized.binWeights82.8 MB 709915885467
pytorch_model.binWeights328.5 MB d272bba7769a
config.jsonConfiguration701 B
special_tokens_map.jsonConfiguration1.0 KB
README.mdDocumentation2.7 KB
CESoftmaxAccuracyEvaluator_AllNLI-dev_results.csvOther337 B
openvino/openvino_model.xmlOther212.1 KB
openvino/openvino_model_qint8_quantized.xmlOther378.8 KB
.gitattributesRepository445 B
merges.txtTokenizer456.3 KB
tokenizer.jsonTokenizer3.6 MB
tokenizer_config.jsonTokenizer1.3 KB
vocab.jsonTokenizer798.3 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
3.2 GB
Download from Sentence Transformers - Cross-Encoders

Released by Sentence Transformers - Cross-Encoders through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published3.2 GB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About nli-distilroberta-base

How much GPU memory does nli-distilroberta-base need?

About 0.2 GB at 16-bit and 0 GB at 4-bit: the weights (82M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run nli-distilroberta-base on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use nli-distilroberta-base commercially?

Yes. nli-distilroberta-base is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is nli-distilroberta-base's context length?

514 tokens, from the maximum position embeddings in its published configuration.

Similar Models

This model was trained using SentenceTransformers Cross-Encoder class. The model was trained on the SNLI and MultiNLI datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral. For evaluation results, see SBERT.net - Pretrained Cross-Encoder. Pre-trained models can be used like this: You can use the model also directly with Transformers library (without SentenceTransformers library): This model can also be used for zero-shot-classification

Open weights apache-2.0 82M parameters 514 tokens sentence-transformers

This model was trained using SentenceTransformers Cross-Encoder class. This model is based on microsoft/deberta-v3-xsmall The model was trained on the SNLI and MultiNLI datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral. For futher evaluation results, see SBERT.net - Pretrained Cross-Encoder. Pre-trained models can be used like this: You can use the model also directly with Transformers library (without SentenceTransformers library): This model can also be used for zero-shot-classification

Open weights apache-2.0 71M parameters 512 tokens sentence-transformers

This model was trained on 782 357 hypothesis-premise pairs from 4 NLI datasets: MultiNLI, Fever-NLI, LingNLI and ANLI. Note that the model was trained on binary NLI to predict either "entailment" or "not-entailment". This is specifically designed for zero-shot classification, where the difference between "neutral" and "contradiction" is irrelevant. The base model is DeBERTa-v3-xsmall from Microsoft. The v3 variant of DeBERTa substantially outperforms previous versions of the model by including a different pre-training objective, see the DeBERTa-V3 paper. For highest performance (but less speed), I recommend using…

Open weights mit 71M parameters 512 tokens transformers

This model was fine-tuned using the same pipeline as described in the model card for MoritzLaurer/deberta-v3-large-zeroshot-v1.1-all-33 and in this paper. The foundation model is microsoft/deberta-v3-xsmall. The model only has 22 million backbone parameters and 128 million vocabulary parameters. The backbone parameters are the main parameters active during inference, providing a significant speedup over larger models. The model is 142 MB small. This model was trained to provide a small and highly efficient zeroshot option, especially for edge devices or in-browser use-cases with transformers.js. For usage instructions and other details refer to this model card…

Open weights mit 71M parameters 512 tokens transformers

Model · Zero-shot classification

distilbert-base-uncased-mnli

Typeform

This is the uncased DistilBERT model fine-tuned on Multi-Genre Natural Language Inference (MNLI) dataset for the zero-shot classification task. This model can be used for text classification tasks. CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes. Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)). This model of DistilBERT-uncased is pretrained on the Multi-Genre Natural Language Inference (MultiNLI) corpus. It is a crowd-sourced collection of 433k sentence pairs annotated with textual entailment…

Open weights 67M parameters 512 tokens transformers

multilingual - zero-shot-classification - text-classification - nli - pytorch - accuracy - multinli - xnli pipelinetag: zero-shot-classification candidatelabels: "politics, economy, entertainment, environment" This multilingual model can perform natural language inference (NLI) on 100+ languages and is therefore also suitable for multilingual zero-shot classification. The underlying multilingual-MiniLM-L6 model was created by Microsoft and was distilled from XLM-RoBERTa-large (see details in the original paper and newer information in this repo). The model was then fine-tuned on the XNLI dataset, which contains hypothesis-premise pairs from 15 languages, as well as the English MNLI dataset.…

Open weights mit 107M parameters 514 tokens transformers