SAVRN
Search Contact SAVRN

Open-weight model · Zero-shot classification

ModernBERT-base-nli

by Tasksource tasksource/ModernBERT-base-nli

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.

Parameters150M
Context2,048
Weights598.4 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads111.3k

Runs On

What it takes to serve ModernBERT-base-nli (150M 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.3 GB 0.4 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 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 de4ab7e77845.

Model Card for Model ID

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

Read the full model card (542 words)

Configuration

Architecture
ModernBertForSequenceClassification
Context length (tokens)
2,048
Layers
22
Hidden size
768
Feed-forward size
1,152
Attention heads
12
Vocabulary size
50,368
Stored precision
float32
Model type
modernbert

Identity and Version

Repository
tasksource/ModernBERT-base-nli
Publisher
Tasksource
Task
Zero-shot classification
Modality
Text
Library
transformers
Parameters
150M parameters
Languages
en
Revision
de4ab7e77845098b7fab7f6ab9d370ddff27b19c
First published
2024-12-20
Last updated
2025-01-06

Files and Weights

7 files, 602.1 MB in total. The weights are 1 file totalling 598.4 MB in safetensors.

Weights1 file · 598.4 MB
Configuration2 files · 6.2 KB
Tokenizer2 files · 3.6 MB
Documentation1 file · 10.4 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights598.4 MB 86c32c52ce38
config.jsonConfiguration5.5 KB
special_tokens_map.jsonConfiguration694 B
README.mdDocumentation10.4 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
598.4 MB
Download from Tasksource

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

Built From

Memory Requirements

PrecisionWeights in memory
As published598.4 MB
16-bit0.3 GB
8-bit0.1 GB
4-bit0.1 GB

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

Questions About ModernBERT-base-nli

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

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

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

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

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

Similar Models

Model · Zero-shot classification

gliclass-small-v1.0

Knowledgator Engineering

This is an efficient zero-shot classifier inspired by GLiNER work. It demonstrates the same performance as a cross-encoder while being more compute-efficient because classification is done at a single forward path. It can be used for topic classification, sentiment analysis and as a reranker in RAG pipelines. The model was trained on synthetic data and can be used in commercial applications. First of all, you need to install GLiClass library: Than you need to initialize a model and a pipeline: Below, you can see the F1 score on several text classification datasets. All tested models were not fine-tuned on those datasets and were tested in a zero-shot setting. Below you can find a comparison…

Open weights apache-2.0 144M parameters transformers

This model was trained using SentenceTransformers Cross-Encoder class. This model is based on microsoft/deberta-v3-small 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 142M parameters 512 tokens sentence-transformers

Model · Zero-shot classification

deberta-small-long-nli

Tasksource

DeBERTa-v3-small with context length of 1680 tokens fine-tuned on tasksource for 250k steps. I oversampled long NLI tasks (ConTRoL, doc-nli). Training data include HelpSteer v1/v2, logical reasoning tasks (FOLIO, FOL-nli, LogicNLI...), OASST, hh/rlhf, linguistics oriented NLI tasks, tasksource-dpo, fact verification tasks. This model is suitable for long context NLI or as a backbone for reward models or classifiers fine-tuning. This checkpoint has strong zero-shot validation performance on many tasks (e.g. 70% on WNLI), and can be used for: - Zero-shot entailment-based classification for arbitrary labels [ZS]. - Natural language inference [NLI] - Further fine-tuning on a new task or…

Open weights apache-2.0 142M parameters 1,680 tokens transformers

Model · Zero-shot classification

nli-deberta-base

Sentence Transformers - Cross-Encoders

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 139M parameters 512 tokens sentence-transformers

Model · Zero-shot classification

nli-roberta-base

Sentence Transformers - Cross-Encoders

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 125M parameters 514 tokens sentence-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 125M parameters 514 tokens transformers