SAVRN
Search Contact SAVRN

Open-weight model · Zero-shot classification

deberta-v3-large-zeroshot-v1

by Moritz Borrett-Laurer (formerly Laurer) MoritzLaurer/deberta-v3-large-zeroshot-v1

The model is designed for zero-shot classification with the Hugging Face pipeline.

Parameters435M
Context512
Weights1.7 GB
Licensemit
AccessOpen weights
Monthly Downloads48.8k

Runs On

What it takes to serve deberta-v3-large-zeroshot-v1 (435M 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.9 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.3 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 Moritz Borrett-Laurer (formerly Laurer), published under mit, revision 3e887081f452.

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'…

Read Moritz Borrett-Laurer (formerly Laurer)'s full model card

Model description

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 Hugging Face hub: https://huggingface.co/MoritzLaurer.

The model can do one universal task: determine whether a hypothesis is true or not_true given a text (also called entailment vs. not_entailment).
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.

Training data

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', 'yelpreviews', 'rottentomatoes', 'emotiondair', 'emocontext', 'empathetic', 'financialphrasebank', 'banking77', 'massive', 'wikitoxic_toxicaggregated', 'wikitoxic_obscene', 'wikitoxic_threat', 'wikitoxic_insult', 'wikitoxic_identityhate', 'hateoffensive', 'hatexplain', 'biasframes_offensive', 'biasframes_sex', 'biasframes_intent', 'agnews', 'yahootopics', 'trueteacher', 'spam', 'wellformedquery'. See details on each dataset here: https://docs.google.com/spreadsheets/d/1Z18tMh02IiWgh6o8pfoMiI_LH4IXpr78wd_nmNd5FaE/edit?usp=sharing 3. Five NLI datasets with ~885k texts: "mnli", "anli", "fever", "wanli", "ling"

Note that compared to other NLI models, this model predicts two classes (entailment vs. not_entailment) as opposed to three classes (entailment/neutral/contradiction)

How to use the model

Simple zero-shot classification pipeline
from transformers import pipeline
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/deberta-v3-large-zeroshot-v1")
sequence_to_classify = "Angela Merkel is a politician in Germany and leader of the CDU"
candidate_labels = ["politics", "economy", "entertainment", "environment"]
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
print(output)

Details on data and training

The code for preparing the data and training & evaluating the model is fully open-source here: https://github.com/MoritzLaurer/zeroshot-classifier/tree/main

Limitations and bias

The model can only do text classification tasks.

Please consult the original DeBERTa paper and the papers for the different datasets for potential biases.

License

The base model (DeBERTa-v3) is published under the MIT license. The datasets the model was fine-tuned on are published under a diverse set of licenses. The following spreadsheet provides an overview of the non-NLI datasets used for fine-tuning. The spreadsheets contains information on licenses, the underlying papers etc.: https://docs.google.com/spreadsheets/d/1Z18tMh02IiWgh6o8pfoMiI_LH4IXpr78wd_nmNd5FaE/edit?usp=sharing

In addition, the model was also trained on the following NLI datasets: MNLI, ANLI, WANLI, LING-NLI, FEVER-NLI.

Citation

If you use this model, please cite:

@article{laurer_less_2023,
    title = {Less {Annotating}, {More} {Classifying}: {Addressing} the {Data} {Scarcity} {Issue} of {Supervised} {Machine} {Learning} with {Deep} {Transfer} {Learning} and {BERT}-{NLI}},
    issn = {1047-1987, 1476-4989},
    shorttitle = {Less {Annotating}, {More} {Classifying}},
    url = {https://www.cambridge.org/core/product/identifier/S1047198723000207/type/journal_article},
    doi = {10.1017/pan.2023.20},
    language = {en},
    urldate = {2023-06-20},
    journal = {Political Analysis},
    author = {Laurer, Moritz and Van Atteveldt, Wouter and Casas, Andreu and Welbers, Kasper},
    month = jun,
    year = {2023},
    pages = {1--33},
}

Ideas for cooperation or questions?

If you have questions or ideas for cooperation, contact me at m{dot}laurer{at}vu{dot}nl or LinkedIn

Debugging and issues

Note that DeBERTa-v3 was released on 06.12.21 and older versions of HF Transformers seem to have issues running the model (e.g. resulting in an issue with the tokenizer). Using Transformers>=4.13 might solve some issues.

Configuration

Architecture
DebertaV2ForSequenceClassification
Context length (tokens)
512
Layers
24
Hidden size
1,024
Feed-forward size
4,096
Attention heads
16
Vocabulary size
128,100
Stored precision
float16
Model type
deberta-v2

Identity and Version

Repository
MoritzLaurer/deberta-v3-large-zeroshot-v1
Publisher
Moritz Borrett-Laurer (formerly Laurer)
Task
Zero-shot classification
Modality
Text
Library
transformers
Parameters
435M parameters
Languages
en
Revision
3e887081f452e35b19c2105be4e9c5d1cd010679
First published
2023-10-03
Last updated
2023-11-29

Files and Weights

10 files, 1.8 GB in total. The weights are 2 files totalling 1.7 GB in bin, safetensors.

Weights2 files · 1.7 GB
Configuration3 files · 1.3 KB
Tokenizer2 files · 8.6 MB
Documentation1 file · 4.3 KB
Other1 file · 2.5 MB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights870.2 MB 533542b37dcd
pytorch_model.binWeights870.3 MB ef69043e6eff
added_tokens.jsonConfiguration23 B
config.jsonConfiguration1.1 KB
special_tokens_map.jsonConfiguration173 B
README.mdDocumentation4.3 KB
spm.modelOther2.5 MB c679fbf93643
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer8.6 MB
tokenizer_config.jsonTokenizer492 B

License and Download

License
mit
Access
Open weights, no gate
Download size
1.7 GB
Download from Moritz Borrett-Laurer (formerly Laurer)

Released by Moritz Borrett-Laurer (formerly Laurer) through its official repository on Hugging Face. Read the license.

Memory Requirements

PrecisionWeights in memory
As published1.7 GB
16-bit0.9 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 deberta-v3-large-zeroshot-v1

How much GPU memory does deberta-v3-large-zeroshot-v1 need?

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

What is the cheapest GPU to run deberta-v3-large-zeroshot-v1 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 deberta-v3-large-zeroshot-v1 commercially?

Yes. deberta-v3-large-zeroshot-v1 is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is deberta-v3-large-zeroshot-v1's context length?

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

Similar Models

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

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

This model was fine-tuned on the MultiNLI, Fever-NLI, Adversarial-NLI (ANLI), LingNLI and WANLI datasets, which comprise 885 242 NLI hypothesis-premise pairs. This model is the best performing NLI model on the Hugging Face Hub as of 06.06.22 and can be used for zero-shot classification. It significantly outperforms all other large models on the ANLI benchmark. The foundation model is DeBERTa-v3-large from Microsoft. DeBERTa-v3 combines several recent innovations compared to classical Masked Language Models like BERT, RoBERTa etc., see the paper DeBERTa-v3-large-mnli-fever-anli-ling-wanli was trained on the MultiNLI, Fever-NLI, Adversarial-NLI (ANLI), LingNLI and WANLI datasets, which…

Open weights mit 435M parameters 512 tokens transformers

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

Model · Zero-shot classification

deberta-v3-large-tasksource-nli

Damien Sileo

DeBERTa-v3-large fine-tuned with multi-task learning on 600 tasks of the tasksource collection You can further fine-tune this model to use it for any classification or multiple-choice task. This checkpoint has strong zero-shot validation performance on many tasks (e.g. 77% on WNLI). The untuned model CLS embedding also has strong linear probing performance (90% on MNLI), due to the multitask training. This is the shared model with the MNLI classifier on top. Its encoder was trained on many datasets including bigbench, Anthropic rlhf, anli... alongside many NLI and classification tasks with a SequenceClassification heads while using only one shared encoder. Each task had a specific CLS…

Open weights apache-2.0 435M parameters 512 tokens transformers