AI SeedbankHelp preserve open and free AI for humanity's future

← All models

MoritzLaurer_multilingual-MiniLMv2-L12-mnli-xnli

MoritzLaurer · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: 1 · Leechers: 0

Observed 2026-09-02T13:56:39Z via announce.aitorrent.org:7070.

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


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-L12-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-L12 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 the 6-layer model (the model on this page has 12 layers and is slower). 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-L12-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-L12-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-L12-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-L12 reported in the paper is 0.711 (see table 11). This reimplementation has an average performance of 0.75. 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-L12-v2).

Datasets avg_xnli ar bg de el en es fr hi ru sw th tr ur vi zh
Accuracy 0.75 0.73 0.78 0.762 0.754 0.821 0.779 0.775 0.724 0.76 0.689 0.738 0.732 0.7 0.762 0.751
Speed text/sec (A100 GPU, eval_batch=120) 4535.0 4629.0 4417.0 4500.0 3938.0 4959.0 4634.0 4152.0 4190.0 4368.0 4630.0 4698.0 4929.0 4291.0 4420.0 5275.0
Datasets mnli_m mnli_mm
Accuracy 0.818 0.831
Speed text/sec (A100 GPU, eval_batch=120) 2912.0 2902.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

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:2fb09c33268d4b25f1de704b56795dfb7121e8ec&dn=MoritzLaurer_multilingual-MiniLMv2-L12-mnli-xnli

Open magnet in torrent client · infohash 2fb09c33268d4b25f1de704b56795dfb7121e8ec

Files & hashes

PathSizesha1sha256
README.md6.7 KB (6,877 B)e94c198b70dbb2ff4d899b4c17b37777fc5d87d9f8fc90ca7fc4ff8a2ed4e6699f8d810c0784fcd76713555a91be7708b44fb75a
config.json1.0 KB (1,035 B)6c7f47ce47b30396e0ef02295b87d29d681d7b3e15030844050f2df9cd2a8ab1e622cccfa0e42f15c87399aa1f8e8516a225783b
model.safetensors448.8 MB (470,595,778 B)cd3a164d5fe7d1dbfe2837ed5e3596a5f60d5ccb47b82b3b1f18a0e4cc5cc80d470d75b3e2278603328b3dd67454b19148d7f85b
pytorch_model.bin448.8 MB (470,636,269 B)e3a67d4de57f142187d1b1bdb2cce0b3c6b4b17c4335e80f9707ff80063546ade0b99f4f9d65f40b4abd55ac2a14a9e516c47f1c
sentencepiece.bpe.model4.8 MB (5,069,051 B)7e88c49faff6c6c136fdf4a3402d0cb534c6ab10cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
special_tokens_map.json280 B (280 B)d5698132694f4f1bcff08fa7d937b1701812598e06e405a36dfe4b9604f484f6a1e619af1a7f7d09e34a8555eb0b77b66318067f
tokenizer.json16.3 MB (17,082,758 B)a53efda8dadb686d4a0655cc46197d60c3061150098c131bb4423163db239755e309facaa6850059f850f9f3d88a78344a4b631c
tokenizer_config.json567 B (567 B)18c09f60df41dc223451521571bb5c976333ee761e05e843ecf991ec0c148e0697f409f63032090d5f9729d052a8658c00786aff

Cite this release

Canonical URL
https://aiseedbank.org/models/MoritzLaurer_multilingual-MiniLMv2-L12-mnli-xnli/
Slug
MoritzLaurer_multilingual-MiniLMv2-L12-mnli-xnli
Infohash
2fb09c33268d4b25f1de704b56795dfb7121e8ec
License
mit
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: MoritzLaurer_multilingual-MiniLMv2-L12-mnli-xnli.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryMoritzLaurer/multilingual-MiniLMv2-L12-mnli-xnli
Revision (pinned)0d55db361c5f291640208c51ff8c181146aa8eff
Fetched at2026-09-02T04:28:16Z
License at fetchmit
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-02T04:28:26Z

mit918.8 MB (963,392,615 bytes)transformerspytorchsafetensorsxlm-robertatext-classificationzero-shot-classificationnlimultilingualendpoints_compatible15 languages (en, ar, bg …)paper: 2002.10957paper: 1809.05053