SAVRN
Search Contact SAVRN

Open-weight model · Zero-shot classification

deberta-small-long-nli

by Tasksource tasksource/deberta-small-long-nli

DeBERTa-v3-small with context length of 1680 tokens fine-tuned on tasksource for 250k steps. I oversampled long NLI tasks (ConTRoL, doc-nli).

Parameters142M
Context1,680
Weights1.1 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads10.2k

Runs On

What it takes to serve deberta-small-long-nli (142M 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.3 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 9a77395d4d37.

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…

Read Tasksource's full model card

Model Card for DeBERTa-v3-small-tasksource-nli

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 tasksource task (classification, token classification or multiple-choice) [FT].

test_name accuracy
anli/a1 57.2
anli/a2 46.1
anli/a3 47.2
nli_fever 71.7
FOLIO 47.1
ConTRoL-nli 52.2
cladder 52.8
zero-shot-label-nli 70.0
chatbot_arena_conversations 67.8
oasst2_pairwise_rlhf_reward 75.6
doc-nli 75.0

Zero-shot GPT-4 scores 61% on FOLIO (logical reasoning), 62% on cladder (probabilistic reasoning) and 56.4% on ConTRoL (long context NLI).

[ZS] Zero-shot classification pipeline

from transformers import pipeline
classifier = pipeline("zero-shot-classification",model="tasksource/deberta-small-long-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/deberta-small-long-nli")
pipe([dict(text='there is a cat',
  text_pair='there is a black cat')]) #list of (premise,hypothesis)
# [{'label': 'neutral', 'score': 0.9952911138534546}]

[FT] Tasknet: 3 lines fine-tuning

# !pip install tasknet
import tasknet as tn
hparams=dict(model_name='tasksource/deberta-small-long-nli', learning_rate=2e-5)
model, trainer = tn.Model_Trainer([tn.AutoTask("glue/rte")], hparams)
trainer.train()

Software and training details

The model was trained on 600 tasks for 250k steps with a batch size of 384 and a peak learning rate of 2e-5. Training took 14 days on Nvidia A30 24GB gpu. This is the shared model with the MNLI classifier on top. Each task had a specific CLS embedding, which is dropped 10% of the time to facilitate model use without it. All multiple-choice model used the same classification layers. For classification tasks, models shared weights if their labels matched.

https://github.com/sileod/tasksource/ \ https://github.com/sileod/tasknet/ \ Training code: https://colab.research.google.com/drive/1iB4Oxl9_B5W3ZDzXoWJN-olUbqLBxgQS?usp=sharing

Citation

More details on this article:

@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",
}

Model Card Contact

[email protected]

Configuration

Architecture
DebertaV2ForSequenceClassification
Context length (tokens)
1,680
Layers
6
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
128,100
Stored precision
float32
Model type
deberta-v2

Identity and Version

Repository
tasksource/deberta-small-long-nli
Publisher
Tasksource
Task
Zero-shot classification
Modality
Text
Library
transformers
Parameters
142M parameters
Languages
en
Revision
9a77395d4d3751be9e2a69c4ae318491d9b3fffb
First published
2024-01-31
Last updated
2024-08-28

Files and Weights

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

Weights2 files · 1.1 GB
Configuration3 files · 19.4 KB
Tokenizer2 files · 8.7 MB
Documentation1 file · 10.9 KB
Other1 file · 2.5 MB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights567.6 MB 9af30c7ad723
pytorch_model.binWeights567.6 MB 75b538ddb05c
added_tokens.jsonConfiguration23 B
config.jsonConfiguration19.1 KB
special_tokens_map.jsonConfiguration286 B
README.mdDocumentation10.9 KB
spm.modelOther2.5 MB c679fbf93643
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer8.7 MB
tokenizer_config.jsonTokenizer1.3 KB

License and Download

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

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

Built From

  • Derived from microsoft/deberta-v3-small
  • Described by arXiv:2301.05948
  • Trained on (disclosed) 12ml/e-CARE
  • Trained on (disclosed) AndyChiang/cloth
  • Trained on (disclosed) AndyChiang/dgen
  • Trained on (disclosed) Anthropic/model-written-evals
  • Trained on (disclosed) Anthropic/persuasion
  • Trained on (disclosed) AshtonIsNotHere/biosift-nli
  • Trained on (disclosed) AshtonIsNotHere/nli4ct_semeval2024
  • Trained on (disclosed) CLUTRR/v1
  • Trained on (disclosed) ColumbiaNLP/FLUTE
  • Trained on (disclosed) Dahoas/synthetic-instruct-gptj-pairwise
  • Trained on (disclosed) Dzeniks/hover
  • Trained on (disclosed) GBaker/MedQA-USMLE-4-options-hf
  • Trained on (disclosed) GGLab/PARADISE
  • Trained on (disclosed) HannahRoseKirk/HatemojiBuild
  • Trained on (disclosed) IlyaGusev/headline_cause
  • Trained on (disclosed) Jiangjie/ekar_english
  • Trained on (disclosed) MoritzLaurer/dataset_train_nli
  • Trained on (disclosed) PiC/phrase_similarity
  • Trained on (disclosed) PolyAI/banking77
  • Trained on (disclosed) RuyuanWan/Dilemmas_Disagreement
  • Trained on (disclosed) RuyuanWan/Dynasent_Disagreement
  • Trained on (disclosed) RuyuanWan/Politeness_Disagreement
  • Trained on (disclosed) RuyuanWan/SBIC_Disagreement
  • Trained on (disclosed) RuyuanWan/SChem_Disagreement
  • Trained on (disclosed) SetFit/insincere-questions
  • Trained on (disclosed) SetFit/toxic_conversations
  • Trained on (disclosed) ade_corpus_v2
  • Trained on (disclosed) ag_news
  • Trained on (disclosed) ai2_arc
  • Trained on (disclosed) alisawuffles/WANLI
  • Trained on (disclosed) allenai/scicite
  • Trained on (disclosed) allenai/scifact_entailment
  • Trained on (disclosed) amazon_polarity
  • Trained on (disclosed) amydeng2000/CREAK
  • Trained on (disclosed) app_reviews
  • Trained on (disclosed) aps/dynahate
  • Trained on (disclosed) aps/super_glue
  • Trained on (disclosed) art
  • Trained on (disclosed) blimp
  • Trained on (disclosed) blog_authorship_corpus
  • Trained on (disclosed) circa
  • Trained on (disclosed) civil_comments
  • Trained on (disclosed) codah
  • Trained on (disclosed) commonsense_qa
  • Trained on (disclosed) copenlu/scientific-exaggeration-detection
  • Trained on (disclosed) corypaik/prost
  • Trained on (disclosed) cos_e
  • Trained on (disclosed) cosmos_qa
  • Trained on (disclosed) dbpedia_14
  • Trained on (disclosed) declare-lab/cicero
  • Trained on (disclosed) definite_pronoun_resolution
  • Trained on (disclosed) demelin/moral_stories
  • Trained on (disclosed) demo-org/auditor_review
  • Trained on (disclosed) discovery
  • Trained on (disclosed) dream
  • Trained on (disclosed) dynabench/dynasent
  • Trained on (disclosed) emo
  • Trained on (disclosed) erbacher/AmbigNQ-clarifying-question

Memory Requirements

PrecisionWeights in memory
As published1.1 GB
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 deberta-small-long-nli

How much GPU memory does deberta-small-long-nli need?

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

What is the cheapest GPU to run deberta-small-long-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 deberta-small-long-nli commercially?

Yes. deberta-small-long-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 deberta-small-long-nli's context length?

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

Similar Models

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

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

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

ModernBERT-base-nli

Tasksource

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…

Open weights apache-2.0 150M parameters 2,048 tokens 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