CoolFace
Modelpublic

dleemiller/finecat-nli-m

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes30downloads
Model Card

FineCat-NLI Medium

<p align="center"> <img src="https://cdn-uploads.huggingface.co/production/uploads/65ff92ea467d83751a727538/Jzq_CZCyRYGrVgbto3eRr.png" style="width: 400px;"> </p>


Overview

This model is a fine-tune of the excellent tasksource/ModernBERT-base-nli, trained on the dleemiller/FineCat-NLI dataset—a compilation of several high-quality NLI data sources with quality screening and reduction of easy samples in the training split. The training also incorporates logit distillation from dleemiller/finecat-nli-l.

Distillation loss looks like this: $$ \begin{equation} \mathcal{L} = \alpha \cdot \mathcal{L}{\text{CE}}(z^{(s)}, y) + \beta \cdot \mathcal{L}{\text{MSE}}(z^{(s)}, z^{(t)}) \end{equation} $$

where \\(z^{(s)}\\) and \\(z^{(t)}\\) are the student and teacher logits, \\(y\\) are the ground truth labels, and \\(\alpha\\) and \\(\beta\\) are equally weighted at 0.5.

This model and dataset specifically targets improving NLI, through high quality sources. The tasksource models are the best checkpoints to start from, although training from ModernBERT is also competitive.


NLI Evaluation Results

F1-Micro scores (equivalent to accuracy) for each dataset. Performance was measured at bs=32 using a Nvidia Blackwell PRO 6000 Max-Q.

Modelfinecatmnlimnli_mismatchedsnlianli_r1anli_r2anli_r3wanlilingnliThroughput (samples/s)Peak GPU Mem (MB)
dleemiller/finecat-nli-m0.80000.89170.91030.9126<u>0.6760</u><u>0.5000</u><u>0.4717</u>0.7418<u>0.8419</u>1323.13807.46
MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli<u>0.7642</u>0.90330.90280.88660.71200.54700.49500.64180.85231278.181644.80
tasksource/ModernBERT-base-nli0.75950.86850.89790.89150.63000.48200.4192<u>0.6632</u>0.81181338.37805.87
dleemiller/ModernCE-base-nli0.75330.8923<u>0.9035</u><u>0.9187</u>0.52400.39500.33330.64640.82821338.31805.87
cross-encoder/nli-deberta-v3-base0.7467<u>0.9001</u>0.90040.92380.43400.35000.34080.63780.83461263.701644.80
cross-encoder/nli-distilroberta-base0.69360.83650.83980.89960.26600.28100.29750.55160.75162733.10566.64

Usage

Label Map:

  • —entailment: 0
  • —neutral: 1
  • —contradiction: 2

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load the model and run inference.

python
from sentence_transformers import CrossEncoder
import numpy as np

model = CrossEncoder("dleemiller/finecat-nli-l")
id2label = model.model.config.id2label  # {0:'entailment', 1:'neutral', 2:'contradiction'}

pairs = [
    ("The glass fell off the counter and shattered on the tile.",
     "The glass broke when it hit the floor."),          # E
    ("The store opens at 9 a.m. every day.",
     "The store opens at 7 a.m. on weekdays."),          # C
    ("A researcher presented results at the conference.",
     "The presentation won the best paper award."),       # N
    ("It started raining heavily, so the match was postponed.",
     "The game was delayed due to weather."),             # E
    ("Every seat on the flight was taken.",
     "There were several empty seats on the plane."),     # C
]

logits = model.predict(pairs)  # shape: (5, 3)

for (prem, hyp), row in zip(pairs, logits):
    pred_idx = int(np.argmax(row))
    pred = id2label[pred_idx]
    print(f"[{pred}]  Premise: {prem}  |  Hypothesis: {hyp}")

Acknowledgments

We thank the creators and contributors of tasksource and MoritzLaurer for making their work available. This model would not be possible without their efforts and open source contributions.

Citation

bibtex
@misc{nli-compiled-2025,
  title = {FineCat NLI Dataset},
  author = {Lee Miller},
  year = {2025},
  howpublished = {Refined compilation of 6 major NLI datasets}
}