SAVRN
Search Contact SAVRN

Open-weight model · Zero-shot classification

ModernBERT-large-nli

by Tasksource tasksource/ModernBERT-large-nli

This model is ModernBERT multi-task fine-tuned on tasksource NLI tasks, including MNLI, ANLI, SICK, WANLI, doc-nli, LingNLI, FOLIO, FOL-NLI, LogicNLI, Label-NLI and all datasets in the below table). This is the equivalent of an "instruct" version.

Parameters396M
Context2,048
Weights1.6 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads21.1k

Runs On

What it takes to serve ModernBERT-large-nli (396M 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.8 GB 1.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.4 GB 0.5 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.2 GB 0.2 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 Tasksource, published under apache-2.0, revision ca476cb923a8.

This model is ModernBERT multi-task fine-tuned on tasksource NLI tasks, including MNLI, ANLI, SICK, WANLI, doc-nli, LingNLI, FOLIO, FOL-NLI, LogicNLI, Label-NLI and all datasets in the below table). This is the equivalent of an "instruct" version. The model was trained for 200k steps on an Nvidia A30 GPU. It is very good at reasoning tasks (better than llama 3.1 8B Instruct on ANLI and FOLIO), long context reasoning, sentiment analysis and zero-shot classification with new labels. The following table shows model test accuracy. These are the scores for the same single transformer with different classification heads on top. Further gains can be obtained by fine-tuning on a single-task, e.g.…

Read Tasksource's full model card

Model Card for Model ID

This model is ModernBERT multi-task fine-tuned on tasksource NLI tasks, including MNLI, ANLI, SICK, WANLI, doc-nli, LingNLI, FOLIO, FOL-NLI, LogicNLI, Label-NLI and all datasets in the below table). This is the equivalent of an "instruct" version. The model was trained for 200k steps on an Nvidia A30 GPU.

It is very good at reasoning tasks (better than llama 3.1 8B Instruct on ANLI and FOLIO), long context reasoning, sentiment analysis and zero-shot classification with new labels.

The following table shows model test accuracy. These are the scores for the same single transformer with different classification heads on top. Further gains can be obtained by fine-tuning on a single-task, e.g. SST, but it this checkpoint is great for zero-shot classification and natural language inference (contradiction/entailment/neutral classification).

test_name test_accuracy
glue/mnli 0.89
glue/qnli 0.96
glue/rte 0.91
glue/wnli 0.64
glue/mrpc 0.81
glue/qqp 0.87
glue/cola 0.87
glue/sst2 0.96
super_glue/boolq 0.66
super_glue/cb 0.86
super_glue/multirc 0.9
super_glue/wic 0.71
super_glue/axg 1
anli/a1 0.72
anli/a2 0.54
anli/a3 0.55
sick/label 0.91
sick/entailment_AB 0.93
snli 0.94
scitail/snli_format 0.95
hans 1
WANLI 0.77
recast/recast_ner 0.85
recast/recast_sentiment 0.97
recast/recast_verbnet 0.89
recast/recast_megaveridicality 0.87
recast/recast_verbcorner 0.87
recast/recast_kg_relations 0.9
recast/recast_factuality 0.95
recast/recast_puns 0.98
probability_words_nli/reasoning_1hop 1
probability_words_nli/usnli 0.79
probability_words_nli/reasoning_2hop 0.98
nan-nli 0.85
nli_fever 0.78
breaking_nli 0.99
conj_nli 0.72
fracas 0.79
dialogue_nli 0.94
mpe 0.75
dnc 0.91
recast_white/fnplus 0.76
recast_white/sprl 0.9
recast_white/dpr 0.84
add_one_rte 0.94
paws/labeled_final 0.96
pragmeval/pdtb 0.56
lex_glue/scotus 0.58
lex_glue/ledgar 0.85
dynasent/dynabench.dynasent.r1.all/r1 0.83
dynasent/dynabench.dynasent.r2.all/r2 0.76
cycic_classification 0.96
lingnli 0.91
monotonicity-entailment 0.97
scinli 0.88
naturallogic 0.93
dynahate 0.86
syntactic-augmentation-nli 0.94
autotnli 0.92
defeasible-nli/atomic 0.83
defeasible-nli/snli 0.8
help-nli 0.96
nli-veridicality-transitivity 0.99
lonli 0.99
dadc-limit-nli 0.79
folio 0.71
tomi-nli 0.54
puzzte 0.59
temporal-nli 0.93
counterfactually-augmented-snli 0.81
cnli 0.9
boolq-natural-perturbations 0.72
equate 0.65
logiqa-2.0-nli 0.58
mindgames 0.96
ConTRoL-nli 0.66
logical-fallacy 0.38
cladder 0.89
conceptrules_v2 1
zero-shot-label-nli 0.79
scone 1
monli 1
SpaceNLI 1
propsegment/nli 0.92
FLD.v2/default 0.91
FLD.v2/star 0.78
SDOH-NLI 0.99
scifact_entailment 0.87
feasibilityQA 0.79
AdjectiveScaleProbe-nli 1
resnli 1
semantic_fragments_nli 1
dataset_train_nli 0.95
nlgraph 0.97
ruletaker 0.99
PARARULE-Plus 1
logical-entailment 0.93
nope 0.56
LogicNLI 0.91
contract-nli/contractnli_a/seg 0.88
contract-nli/contractnli_b/full 0.84
nli4ct_semeval2024 0.72
biosift-nli 0.92
SIGA-nli 0.57
FOL-nli 0.79
doc-nli 0.81
mctest-nli 0.92
natural-language-satisfiability 0.92
idioms-nli 0.83
lifecycle-entailment 0.79
MSciNLI 0.84
hover-3way/nli 0.92
seahorse_summarization_evaluation 0.81
missing-item-prediction/contrastive 0.88
Pol_NLI 0.93
synthetic-retrieval-NLI/count 0.72
synthetic-retrieval-NLI/position 0.9
synthetic-retrieval-NLI/binary 0.92
babi_nli 0.98

Usage

[ZS] Zero-shot classification pipeline

from transformers import pipeline
classifier = pipeline("zero-shot-classification",model="tasksource/ModernBERT-large-nli")

text = "one day I will see the world"
candidate_labels = ['travel', 'cooking', 'dancing']
classifier(text, candidate_labels)

NLI training data of this model includes label-nli, a NLI dataset specially constructed to improve this kind of zero-shot classification.

[NLI] Natural language inference pipeline

from transformers import pipeline
pipe = pipeline("text-classification",model="tasksource/ModernBERT-large-nli")
pipe([dict(text='there is a cat',
  text_pair='there is a black cat')]) #list of (premise,hypothesis)

Backbone for further fune-tuning

This checkpoint has stronger reasoning and fine-grained abilities than the base version and can be used for further fine-tuning.

Citation

@inproceedings{sileo-2024-tasksource,
    title = "tasksource: A Large Collection of {NLP} tasks with a Structured Dataset Preprocessing Framework",
    author = "Sileo, Damien",
    booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
    month = may,
    year = "2024",
    address = "Torino, Italia",
    publisher = "ELRA and ICCL",
    url = "https://aclanthology.org/2024.lrec-main.1361",
    pages = "15655--15684",
}

Configuration

Architecture
ModernBertForSequenceClassification
Context length (tokens)
2,048
Layers
28
Hidden size
1,024
Feed-forward size
2,624
Attention heads
16
Vocabulary size
50,368
Stored precision
float32
Model type
modernbert

Identity and Version

Repository
tasksource/ModernBERT-large-nli
Publisher
Tasksource
Task
Zero-shot classification
Modality
Text
Library
transformers
Parameters
396M parameters
Languages
en
Revision
ca476cb923a8637073d4ceb0f19f7fc236e260d4
First published
2025-01-04
Last updated
2025-01-04

Files and Weights

7 files, 1.6 GB in total. The weights are 1 file totalling 1.6 GB in safetensors.

Weights1 file · 1.6 GB
Configuration2 files · 6.3 KB
Tokenizer2 files · 3.6 MB
Documentation1 file · 9.9 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights1.6 GB f56738ff6d17
config.jsonConfiguration5.6 KB
special_tokens_map.jsonConfiguration694 B
README.mdDocumentation9.9 KB
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer3.6 MB
tokenizer_config.jsonTokenizer20.9 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.6 GB
Download from Tasksource

Released by Tasksource through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.6 GB
16-bit0.8 GB
8-bit0.4 GB
4-bit0.2 GB

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

Questions About ModernBERT-large-nli

How much GPU memory does ModernBERT-large-nli need?

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

What is the cheapest GPU to run ModernBERT-large-nli 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 ModernBERT-large-nli commercially?

Yes. ModernBERT-large-nli 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 ModernBERT-large-nli's context length?

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

Similar Models

Model · Zero-shot classification

finecat-nli-l

Lee Miller

This model is a fine-tune of the excellent tasksource/ModernBERT-large-nli, trained on the dleemiller/FineCat-NLI dataset—a compilation of several high-quality NLI data sources with quality screening and reduction of easy samples in the training split. The training also incorporates logit distillation from MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli, a top-performing NLI model, particularly on ANLI benchmarks. \begin{equation} \mathcal{L} = \alpha \cdot \mathcal{L}{\text{CE}}(z^{(s)}, y) + \beta \cdot \mathcal{L}{\text{MSE}}(z^{(s)}, z^{(t)}) \end{equation} where \\(z^{(s)}\\) and \\(z^{(t)}\\) are the student and teacher logits, \\(y\\) are the ground truth labels, and…

Open weights 396M parameters 2,048 tokens sentence-transformers

Model · Zero-shot classification

bart-large-mnli-yahoo-answers

Joe Davison

This model takes facebook/bart-large-mnli and fine-tunes it on Yahoo Answers topic classification. It can be used to predict whether a topic label can be assigned to a given sequence, whether or not the label has been seen before. You can play with an interactive demo of this zero-shot technique with this model, as well as the non-finetuned facebook/bart-large-mnli, here. This model was fine-tuned on topic classification and will perform best at zero-shot topic classification. Use hypothesistemplate="This text is about {}." as this is the template used during fine-tuning. For settings other than topic classification, you can use any model pre-trained on MNLI such as facebook/bart-large-mnli…

Open weights apache-2.0 407M parameters 1,024 tokens transformers

Model · Zero-shot classification

bart-large-mnli

AI at Meta

This is the checkpoint for bart-large after being trained on the MultiNLI (MNLI) dataset. - The bart-large model page - BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension Yin et al. proposed a method for using pre-trained NLI models as a ready-made zero-shot sequence classifiers. The method works by posing the sequence to be classified as the NLI premise and to construct a hypothesis from each candidate label. For example, if we want to evaluate whether a sequence belongs to the class "politics", we could construct a hypothesis of This text is about politics.. The probabilities for entailment and contradiction are then converted…

Open weights mit 407M parameters 1,024 tokens transformers

Models in this series are designed for efficient zeroshot classification with the Hugging Face pipeline. These models can do classification without training data and run on both GPUs and CPUs. An overview of the latest zeroshot classifiers is available in my Zeroshot Classifier Collection. The main update of this zeroshot-v2.0 series of models is that several models are trained on fully commercially-friendly data for users with strict license requirements. These models can do one universal classification task: determine whether a hypothesis is "true" or "not true" given a text (entailment vs. notentailment). This task format is based on the Natural Language Inference task (NLI). The task is…

Open weights mit 435M parameters 512 tokens transformers

The model is designed for zero-shot classification with the Hugging Face pipeline. The model should be substantially better at zero-shot classification than my other zero-shot models on the The model can do one universal task: determine whether a hypothesis is true or nottrue given a text (also called entailment vs. notentailment). This task format is based on the Natural Language Inference task (NLI). The task is so universal that any classification task can be reformulated into the task. The model was trained on a mixture of 27 tasks and 310 classes that have been reformatted into this universal format. 1. 26 classification tasks with ~400k texts: 'amazonpolarity', 'imdb', 'appreviews'…

Open weights mit 435M parameters 512 tokens transformers

The model is designed for zero-shot classification with the Hugging Face pipeline. The model can do one universal classification task: determine whether a hypothesis is "true" or "not true" given a text (entailment vs. notentailment). This task format is based on the Natural Language Inference task (NLI). The task is so universal that any classification task can be reformulated into this task. A detailed description of how the model was trained and how it can be used is available in this paper. The model was trained on a mixture of 33 datasets and 387 classes that have been reformatted into this universal format. 1. Five NLI datasets with ~885k texts: "mnli", "anli", "fever", "wanli"…

Open weights mit 435M parameters 512 tokens transformers