alt.freeweights.vision / multilingual-MiniLMv2-L6-mnli-xnli
From: MoritzLaurer <huggingface.co/MoritzLaurer>Newsgroups: alt.freeweights.visionSubject:

multilingual-MiniLMv2-L6-mnli-xnli

Date: 2026-11-15Commit: 0a71e92Signed: 2DC28CC7B26A283B ✓

Zero shot classification model with 107M parameters. Onnx and safetensors weights, 1.33 GB in all. Published by MoritzLaurer under MIT.

107M params1.33GBmultilingual-MiniLMv2-L6-mnli-xnlionnx safetensorspermissive
FactsParams107MSize1.33 GBFormatsonnx, safetensorsTaskzero shot classificationLicenseMITFrom sourcepermissive
$ fw get MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
# manifest sha256 ae9133a768ff… · 1.33 GB · 15 files
$ fw verify ./multilingual-MiniLMv2-L6-mnli-xnli MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
From sourceHosted (signed)MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnliLast check: 2026-11-15 02:41 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
1.33 GB
Weights
428 MB (safetensors)
Parameters
107M
Formats
onnx, safetensors
Task
zero shot classification
License
MIT (permissive)
Files
15, each with a sha256
Publisher
MoritzLaurer
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:41 UTCpassed

Model card

From the publisher at commit 0a71e92. Shown as plain text with links; images open at the publisher.

language:

  • multilingual
  • en
  • ar
  • bg
  • de
  • el
  • es
  • fr
  • hi
  • ru
  • sw
  • th
  • tr
  • ur
  • vi
  • zh

license: mit tags:

  • zero-shot-classification
  • text-classification
  • nli
  • pytorch

metrics:

  • accuracy

datasets:

  • multi_nli
  • xnli

pipeline_tag: zero-shot-classification widget:

  • text: "Angela Merkel ist eine Politikerin in Deutschland und Vorsitzende der CDU" candidate_labels: "politics, economy, entertainment, environment"


Multilingual MiniLMv2-L6-mnli-xnli#

Model description#

This multilingual model can perform natural language inference (NLI) on 100+ languages and is therefore also suitable for multilingual zero-shot classification. The underlying multilingual-MiniLM-L6 model was created by Microsoft and was distilled from XLM-RoBERTa-large (see details in the original paper and newer information in this repo). The model was then fine-tuned on the XNLI dataset, which contains hypothesis-premise pairs from 15 languages, as well as the English MNLI dataset.

The main advantage of distilled models is that they are smaller (faster inference, lower memory requirements) than their teachers (XLM-RoBERTa-large). The disadvantage is that they lose some of the performance of their larger teachers.

For highest inference speed, I recommend using this 6-layer model. For higher performance I recommend mDeBERTa-v3-base-mnli-xnli (as of 14.02.2023).

How to use the model#
Simple zero-shot classification pipeline#
from transformers import pipeline
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli")

sequence_to_classify = "Angela Merkel ist eine Politikerin in Deutschland und Vorsitzende der CDU"
candidate_labels = ["politics", "economy", "entertainment", "environment"]
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
print(output)
NLI use-case#
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")

model_name = "MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

premise = "Angela Merkel ist eine Politikerin in Deutschland und Vorsitzende der CDU"
hypothesis = "Emmanuel Macron is the President of France"

input = tokenizer(premise, hypothesis, truncation=True, return_tensors="pt")
output = model(input["input_ids"].to(device))  # device = "cuda:0" or "cpu"
prediction = torch.softmax(output["logits"][0], -1).tolist()
label_names = ["entailment", "neutral", "contradiction"]
prediction = {name: round(float(pred) * 100, 1) for pred, name in zip(prediction, label_names)}
print(prediction)
Training data#

This model was trained on the XNLI development dataset and the MNLI train dataset. The XNLI development set consists of 2490 professionally translated texts from English to 14 other languages (37350 texts in total) (see this paper). Note that the XNLI contains a training set of 15 machine translated versions of the MNLI dataset for 15 languages, but due to quality issues with these machine translations, this model was only trained on the professional translations from the XNLI development set and the original English MNLI training set (392 702 texts). Not using machine translated texts can avoid overfitting the model to the 15 languages; avoids catastrophic forgetting of the other languages it was pre-trained on; and significantly reduces training costs.

Training procedure#

The model was trained using the Hugging Face trainer with the following hyperparameters. The exact underlying model is mMiniLMv2-L6-H384-distilled-from-XLMR-Large.

training_args = TrainingArguments(
    num_train_epochs=3,              # total number of training epochs
    learning_rate=4e-05,
    per_device_train_batch_size=64,   # batch size per device during training
    per_device_eval_batch_size=120,    # batch size for evaluation
    warmup_ratio=0.06,                # number of warmup steps for learning rate scheduler
    weight_decay=0.01,               # strength of weight decay
)
Eval results#

The model was evaluated on the XNLI test set on 15 languages (5010 texts per language, 75150 in total). Note that multilingual NLI models are capable of classifying NLI texts without receiving NLI training data in the specific language (cross-lingual transfer). This means that the model is also able of doing NLI on the other languages it was training on, but performance is most likely lower than for those languages available in XNLI.

The average XNLI performance of multilingual-MiniLM-L6 reported in the paper is 0.68 (see table 11). This reimplementation has an average performance of 0.713. This increase in performance is probably thanks to the addition of MNLI in the training data and this model was distilled from XLM-RoBERTa-large instead of -base (multilingual-MiniLM-L6-v2).

Datasetsavg_xnliarbgdeelenesfrhiruswthtrurvizh
Accuracy0.7130.6870.7420.7190.7230.7890.7480.7410.6910.7140.6420.6990.6960.6640.7230.721
Speed text/sec (A100 GPU, eval_batch=120)6093.06210.06003.06053.05409.06531.06205.05615.05734.05970.06219.06289.06533.05851.05970.06798.0
Datasetsmnli_mmnli_mm
Accuracy0.7820.8
Speed text/sec (A100 GPU, eval_batch=120)4430.04395.0

Limitations and bias#

Please consult the original paper and literature on different NLI datasets for potential biases.

Citation#

If you use this model, please cite: Laurer, Moritz, Wouter van Atteveldt, Andreu Salleras Casas, and Kasper Welbers. 2022. ‘Less Annotating, More Classifying – Addressing the Data Scarcity Issue of Supervised Machine Learning with Deep Transfer Learning and BERT - NLI’. Preprint, June. Open Science Framework. https://osf.io/74b8k.

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

Files

15 files · 1.33 GBWeights 428 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 15 files with their sha256
FileSizesha256
.gitattributes1.53 KB312a78ec7da89bec73d75fa3dcc2f19f2c75abc18189812f18f49f9ac525a5f2
README.md6.74 KBf28aebb1babf603b5c5c107670645f2b00e09a2e9a39132293ad0a9a7ab6fa34
config.json1.03 KB79862295be1538a947e0f56d495ef8d658c3eaebcfb42c7ad96229d195ca745d
model.safetensors428 MB91b323ccf247ec1e3b5925d566230bae7c52de8147e6062b42e250089a3fc80b
onnx/config.json921 Be08b628c4d46c8601dda34ddb40a7857e5961870b80482382d420db6dfb6e00e
onnx/model.onnx428 MB79f8cda2b1230585a95ea0514a6f1bd21c5c986ba0529bb3261213a3e195fa6e
onnx/sentencepiece.bpe.model5.07 MBcfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
onnx/special_tokens_map.json964 B8c785abebea9ae3257b61681b4e6fd8365ceafde980c21970d001e834cf10835
onnx/tokenizer.json17.1 MBb2116c05e7305eea30394284760789681c5b3440dd4cd9a8c77539da68f9e8a6
onnx/tokenizer_config.json1.25 KB10dd51e1952b6725b3c65edd16411a4ffe97a6f61636f11a7505bcb0bdb6b360
pytorch_model.bin428 MB46298086b62942b2ad929d36e0ab7c11f98f9c109aa9ec3b65fff78104853a6a
sentencepiece.bpe.model5.07 MBcfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
special_tokens_map.json280 B06e405a36dfe4b9604f484f6a1e619af1a7f7d09e34a8555eb0b77b66318067f
tokenizer.json17.1 MB098c131bb4423163db239755e309facaa6850059f850f9f3d88a78344a4b631c
tokenizer_config.json565 B86139ce1f39e814bcdb99a6fe30c0c4983911508aad07417e616d994fb74eb25
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
0a71e92a98 pinned now2026-11-15 02:41 UTC15 files · 1.33 GB

Use it

$ fw get MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
# manifest sha256 ae9133a768ff… · 1.33 GB · 15 files
$ fw verify ./multilingual-MiniLMv2-L6-mnli-xnli MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli.json --dir ./multilingual-MiniLMv2-L6-mnli-xnli $ python3 fw.py verify ./multilingual-MiniLMv2-L6-mnli-xnli ./MoritzLaurer__multilingual-MiniLMv2-L6-mnli-xnli.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli --revision 0a71e92a985b6e1ad1828cf67ce9c459639c1dca --local-dir ./multilingual-MiniLMv2-L6-mnli-xnli

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
f28aebb1babf603b5c5c107670645f2b00e09a2e9a39132293ad0a9a7ab6fa34
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: MoritzLaurer <huggingface.co/MoritzLaurer>Newsgroups: alt.freeweights.visionSubject: multilingual-MiniLMv2-L6-mnli-xnliDate: 2026-11-15Commit: 0a71e92Signed: 2DC28CC7B26A283B ✓
Upstream
MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
Pinned commit
0a71e92a985b6e1ad1828cf67ce9c459639c1dca
Manifest
multilingual-MiniLMv2-L6-mnli-xnli.json · .minisig
Manifest sha256
ae9133a768ffe459731521e080b3ebad284bfbc91b89d24839d0515ece89ba1b
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:41 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli.json $ curl -O https://freeweights.allternit.com/manifests/MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli.json.minisig $ minisign -Vm multilingual-MiniLMv2-L6-mnli-xnli.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. multilingual-MiniLMv2-L6-mnli-xnli.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of multilingual-MiniLMv2-L6-mnli-xnli. Each has its own license check and page.

From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX