At a glance
| Model (HF & ONNX) | MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33 (base: microsoft/deberta-v3-xsmall) |
|---|---|
| Task / pipeline | zero-shot-classification (2-class NLI cross-encoder) |
| Backbone & NLI head |
deberta-v2 (DebertaV2ForSequenceClassification) · 12
layers · 384 hidden · 6 heads · 22M backbone + 128M vocab params ·
id2label: {0: "entailment", 1: "not_entailment"}
|
| Tokenizer & context |
DebertaV2Tokenizer (SentencePiece vocab_type: "spm",
128,100 vocab, [CLS]/[SEP],
model_max_length: 512)
|
| Quantization & size |
q8 (onnx/model_quantized.onnx 87,246,195 B +
tokenizer.json 8,656,646 B + configs 1,597 B =
95,904,438 B / 95.9 MB)
|
| Runtime & backend |
Shared @huggingface/transformers@3.7.5 on WebAssembly
(wasm) in a dedicated module Web Worker
|
| License | MIT |
| Web APIs | WebAssembly, Web Workers, Cache Storage, File & Clipboard APIs |
Run it — 2-Class Zero-Shot Classifier
Initialise DeBERTa-v3-XSmall Zero-Shot above to classify text locally on your device.
See inside — raw 2-class entailment vs not_entailment logits
Unlike 3-class MNLI models (entailment / neutral / contradiction),
MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33 collapses neutral and
contradiction into a single binary id2label = {0: "entailment", 1: "not_entailment"}
head. Transformers.js ZeroShotClassificationPipeline maps
entailment_id = 0 and contradiction_id = 1 via
label2id['not_entailment'] automatically.
| Candidate label | Entailment (prob / logit) | Not-entailment (prob / logit) | Logit Δ | 2-class split | Pair tokens |
|---|---|---|---|---|---|
| Run classification above to inspect raw 2-class NLI logits. | |||||
Why it matters
Full-size NLI cross-encoders often exceed 170–350 MB. By pairing DeBERTa-v3-xsmall's 22M-parameter disentangled-attention backbone with 33 diverse zero-shot training datasets and a binary entailment head, this 95.9 MB q8 package delivers fast edge classification with zero retraining.
- Purpose-built browser footprint — 87.25 MB quantized weights (95.9 MB with SentencePiece tokenizer) fit comfortably in browser Cache Storage.
- 33-dataset generalization — trained across NLI, sentiment, emotion, topic, intent, toxicity, and financial datasets (Laurer et al., 2023).
-
Calibrated binary probabilities — every hypothesis yields a direct
P(entailment) + P(not_entailment) = 1.0score in multi-label mode.
Use-case ladder
Basics · Template Crafting & Calibration
Compare four hypothesis templates side-by-side and contrast single-label softmax against independent 2-class P(entailment) calibration.
Practical · Batch CSV & JSONL Zero-Shot Router
Upload CSV, JSONL, JSON, MD, or TXT ticket queues, stream cancellable FIFO triage, and export OWASP formula-safe CSV + provenance JSON.
Wild · Adversarial Framing & Dilution Stress Lab
Probe double negation, if/unless rules, adversarial hypothesis polarity flips, and 3 → 8 → 12 distractor label dilution.
Multi-model · Arctic Embed → DeBERTa-XSmall NLI
118.9 MB 2-stage pipeline: Stage 1 Arctic Embed XS (22.97 MB) shortlists Top-K from 24 categories before Stage 2 DeBERTa NLI verifies.
How the API works & source inspection
import { pipeline } from "@huggingface/transformers";
const classifier = await pipeline(
"zero-shot-classification",
"MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33",
{ device: "wasm", dtype: "q8" },
);
const out = await classifier(
"My annual invoice charged twice after downgrading on Tuesday.",
["billing dispute", "shipping delay", "bug report"],
{ hypothesis_template: "This customer support message is about {}.", multi_label: false },
);