CoolFace
Modelpublic

dleemiller/EttinX-nli-s

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes2.7kdownloads
Model Card

EttinX Cross-Encoder: Natural Language Inference (NLI)

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 68m architecture is based on ModernBERT and is an excellent candidate for lightweight CPU inference.


Features

  • —High performing: Achieves 87.98% and 88.67% (Micro F1) on MNLI mismatched and SNLI test.
  • —Efficient architecture: Based on the Ettin-68m encoder design (68M parameters), offering faster inference speeds.
  • —Extended context length: Processes sequences up to 8192 tokens, great for LLM output evals.

Performance

ModelMNLI MismatchedSNLI TestContext Length# Parameters
dleemiller/ModernCE-large-nli0.92020.91108192395M
dleemiller/ModernCE-base-nli0.90340.90258192149M
cross-encoder/nli-deberta-v3-large0.90490.9220512435M
cross-encoder/nli-deberta-v3-base0.90040.9234512184M
dleemiller/EttinX-nli-s0.87980.8967819268M
cross-encoder/nli-distilroberta-base0.83980.883851282M
dleemiller/EttinX-nli-xs0.83800.8820819232M
dleemiller/EttinX-nli-xxs0.80470.8695819217M

Extended NLI Evaluation Results

F1-Micro scores (equivalent to accuracy) for each dataset.

Modelfinecatmnlimnli_mismatchedsnlianli_r1anli_r2anli_r3wanlilingnli
dleemiller/finecat-nli-l0.81520.9088<u>0.9217</u><u>0.9259</u>0.74000.52300.51500.74240.8689
tasksource/ModernBERT-large-nli0.79590.89830.92290.9188<u>0.7260</u><u>0.5110</u></u>0.4925</u><u>0.6978</u>0.8504
dleemiller/ModernCE-large-nli0.78110.90880.92050.92730.66300.48600.44080.6576<u>0.8566</u>
tasksource/ModernBERT-base-nli0.75950.86850.89790.89150.63000.48200.41920.66320.8118
dleemiller/ModernCE-base-nli0.75330.89230.90350.91870.52400.39500.33330.64640.8282
dleemiller/EttinX-nli-s0.72510.87650.87980.91280.33600.27900.30830.62340.8012
dleemiller/EttinX-nli-xs0.70130.83760.83800.89790.27800.28400.28000.58380.7521
dleemiller/EttinX-nli-xxs0.68420.79880.80470.88510.25900.30600.29920.54260.7018

Usage

To use EttinX for NLI tasks, you can load the model with the Hugging Face sentence-transformers library:

python
from sentence_transformers import CrossEncoder

# Load EttinX model
model = CrossEncoder("dleemiller/EttinX-nli-s")

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']

Training Details

Pretraining

We initialize the `` weights.

Details:

  • —Batch size: 256
  • —Learning rate: 1e-4
  • —Attention Dropout: attention dropout 0.1

Fine-Tuning

Fine-tuning was performed on the dleemiller/all-nli-distill dataset.

Validation Results

The model achieved the following test set micro f1 performance after fine-tuning:

  • —MNLI Unmatched: 0.8798
  • —SNLI: 0.8967

Model Card

  • —Architecture: Ettin-encoder-68m
  • —Fine-Tuning Data: dleemiller/all-nli-distill

Thank You

Thanks to the Johns Hopkins team for providing the ModernBERT models, and the Sentence Transformers team for their leadership in transformer encoder models.


Citation

If you use this model in your research, please cite:

bibtex
@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},
}

License

This model is licensed under the MIT License.