This is an ONNX version of dleemiller/EttinX-nli-xs. It was automatically converted and uploaded using this Hugging Face Space.
See the pipeline documentation for text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline
This cross encoder performs sequence classification for contradiction/neutral/entailment labels. This has drop-in compatibility with comparable sentence transformers cross encoders.
To train this model, I added teacher logits to the all-nli dataset dleemiller/all-nli-distill from the
dleemiller/ModernCE-large-nli model. This significantly improves performance above standard training.
This 32m architecture is based on ModernBERT and is an excellent candidate for lightweight CPU inference.
| Model | MNLI Mismatched | SNLI Test | Context Length | # Parameters |
|---|---|---|---|---|
| dleemiller/ModernCE-large-nli | 0.9202 | 0.9110 | 8192 | 395M |
| dleemiller/ModernCE-base-nli | 0.9034 | 0.9025 | 8192 | 149M |
| cross-encoder/nli-deberta-v3-large | 0.9049 | 0.9220 | 512 | 435M |
| cross-encoder/nli-deberta-v3-base | 0.9004 | 0.9234 | 512 | 184M |
| cross-encoder/nli-distilroberta-base | 0.8398 | 0.8838 | 512 | 82M |
| dleemiller/EttinX-nli-xs | 0.8380 | 0.8820 | 8192 | 32M |
| dleemiller/EttinX-nli-xxs | 0.8047 | 0.8695 | 8192 | 17M |
To use EttinX for NLI tasks, you can load the model with the Hugging Face sentence-transformers library:
from sentence_transformers import CrossEncoder
# Load EttinX model
model = CrossEncoder("dleemiller/EttinX-nli-xs")
scores = model.predict([
('A man is eating pizza', 'A man eats something'),
('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')
])
# Convert scores to labels
label_mapping = ['contradiction', 'entailment', 'neutral']
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
# ['entailment', 'contradiction']
We initialize the `` weights.
Details:
Fine-tuning was performed on the dleemiller/all-nli-distill dataset.
The model achieved the following test set micro f1 performance after fine-tuning:
dleemiller/all-nli-distillThanks to the Johns Hopkins team for providing the ModernBERT models, and the Sentence Transformers team for their leadership in transformer encoder models.
If you use this model in your research, please cite:
@misc{moderncenli2025,
author = {Miller, D. Lee},
title = {EttinX NLI: An NLI cross encoder model},
year = {2025},
publisher = {Hugging Face Hub},
url = {https://huggingface.co/dleemiller/EttinX-nli-xxs},
}
This model is licensed under the MIT License.
onnx/model.onnx 128 MBonnx/model_bnb4.onnx 86 MBonnx/model_q4.onnx 86 MBonnx/model_fp16.onnx 64 MBonnx/model_q4f16.onnx 46 MBonnx/model_uint8.onnx 32 MBonnx/model_int8.onnx 32 MBonnx/model_quantized.onnx 32 MBdleemiller/EttinX-nli-xs