zero-shot-classification · text · WASM int8 · 538.8 MB · MIT

DeBERTa-v3-Large Zero-Shot v2.0

Classify any support ticket, policy clause, security alert, or research passage against custom English labels locally in your browser — powered by a 24-layer, 435M-parameter DeBERTa-v3 NLI cross-encoder (0.673 mean macro-F1 across 28 zero-shot tasks).

At a glance

Upstream & ONNX HF repos MoritzLaurer/deberta-v3-large-zeroshot-v2.0 → onnx-community/deberta-v3-large-zeroshot-v2.0-ONNX (base: microsoft/deberta-v3-large)
Task / pipeline zero-shot-classification (2-class NLI cross-encoder)
Backbone & NLI head deberta-v2 (DebertaV2ForSequenceClassification) · 24 layers · 1024 hidden · 16 heads · 4096 FFN · 304M backbone + 131M vocab (435M total) · id2label: {0: "entailment", 1: "not_entailment"}
Tokenizer & context DebertaV2Tokenizer (SentencePiece vocab_type: "spm", 128,100 vocab, [CLS]/[SEP], model_max_length: 512)
Quantization & size int8 (onnx/model_int8.onnx 538,833,918 B / 538.8 MB; identical oid to model_quantized.onnx + tokenizer.json 8.65 MB + configs 3.35 KB = 547.5 MB total)
Runtime & backend Shared @huggingface/transformers@3.7.5 on WebAssembly (wasm) in a dedicated module Web Worker
License MIT (base model MIT; non--c mix includes MNLI, FEVER, ANLI, WANLI, LingNLI & Mixtral v4)
Web APIs WebAssembly, Web Workers, Cache Storage, File & Clipboard APIs

Run it — 2-Class Zero-Shot Classifier

Initialise DeBERTa-v3-Large Zero-Shot v2.0 above to classify text locally on your device.

Backend / dtype–
Latency–
Premise tokens–
Entropy–
NaN count–
Parity max |Δ|–

See inside — SentencePiece tokens & 2-class entailment logits

onnx-community/deberta-v3-large-zeroshot-v2.0-ONNX encodes each [CLS] premise [SEP] hypothesis [SEP] pair with a 128,100-token SentencePiece vocabulary (▁ marks word boundaries) and emits raw 2-class logits for id2label = {0: "entailment", 1: "not_entailment"}.

DeBERTa SentencePiece token sequence (first hypothesis pair)

Run classification above to inspect raw DeBERTa SentencePiece tokens.

2-Class entailment vs not_entailment logit margin bar

Per-label entailment and not_entailment probabilities, raw logits, and logit margins
Candidate label Entailment (prob / logit) Not-entailment (prob / logit) Logit Δ 2-class margin bar Pair tokens
Run classification above to inspect raw 2-class NLI logits.

Why it matters

Compared against BART-large-MNLI (0.497 mean macro-F1 across 28 classification datasets), deberta-v3-large-zeroshot-v2.0 reaches 0.673 zero-shot (and 0.846 few-shot) using disentangled relative attention and a 24-layer backbone trained on 500+ Mixtral-generated tasks plus MNLI, FEVER, ANLI, WANLI, and LingNLI.

Use-case ladder

How the API works & source inspection

import { pipeline } from "@huggingface/transformers";

const classifier = await pipeline(
  "zero-shot-classification",
  "onnx-community/deberta-v3-large-zeroshot-v2.0-ONNX",
  { device: "wasm", dtype: "int8" },
);

const out = await classifier(
  "Last week I upgraded my iOS version and my phone has been overheating.",
  ["mobile", "website", "billing", "account access"],
  { hypothesis_template: "This customer support message is about {}.", multi_label: false },
);
Show the code · worker.js — runClassification() (dynamic 2-class id2label pass)
Show the code · worker.js — extractTokenPieces() (SentencePiece token inspection)
Show the code · deberta-v3-large-zs-core.mjs — scoreFromBinaryNliLogits() (exact single- & multi-label math)

References