/ Модель

Характеристики

Контекст
7 999 токенов
Параметры
68,1 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
finecat-nli-v2-s
Библиотека
sentence-transformers
Опубликована
14 ноя 2026

finecat-nli-v2-s-wsp

Классификация текстаТекст → label9 профессий
93скачиваний за 30 дней0лайковвеса обновлены16 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Англоязычный энкодер ModernBERT для zero-shot классификации и проверки, следует ли утверждение из текста, противоречит ему или нейтрально.

FineCat-NLI v2 Small — WSP edit — это англоязычный энкодер ModernBERT для вывода отношений между парой текстов: следует ли утверждение из исходного текста, противоречит ли ему или остаётся нейтральным. Модель разработана автором репозитория как градиентно-свободное редактирование весов FineCat-NLI v2 Small методом weight-space programming: изменена только классификационная голова, а температурная калибровка встроена в неё. Модель содержит 68,1 млн параметров и принимает пары текстов; заявленная длина контекста — 7 999 токенов.

Модель подходит для zero-shot тематической классификации, маршрутизации запросов и проверки обоснованности ответов по найденным документам. В оценках автора улучшились калибровка и отдельные результаты для grounding и обнаружения галлюцинаций, но общая точность немного снизилась относительно исходной версии. README отмечает слабые результаты на некоторых задачах биомедицинского и adversarial reasoning, а также ограничения для финансовой и общей юридической проверки. Модель распространяется по лицензии Apache-2.0; автор характеризует эту редакцию как экспериментальную.

Сценарии применения

  • zero-shot классификация текста по заданным темам
  • маршрутизация запросов пользователей по намерениям
  • проверка обоснованности ответа по найденным документам
  • обнаружение неподтверждённых утверждений в ответах LLM
  • сопоставление текста с утверждениями для модерации и триажа

Ограничения

Общая точность немного ниже, чем у исходной FineCat-NLI v2 Small; качество заметно зависит от типа задачи. Автор указывает на ограничения в финансовой и общей юридической проверке, клинической оценке соответствия и состязательном рассуждении.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит9

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

FineCat-NLI v2 Small — WSP edit

Experimental. This is finecat-nli-v2-s with a small gradient-free weight edit found by weight-space programming (WSP): only the classification head changed (2 of its 3 rows, plus the calibrated temperature folded in); every other weight is identical. OpenNLI Skill Index 47.1 → 47.5, calibration error 8.8 → 7.8. See WSP findings.

Natural Language Inference (NLI): the Swiss Army knife of encoders

Provide a text (premise) and statement (hypothesis), and it returns calibrated probabilities that the text entails, contradicts, or is neutral to the statement. A multiple-choice question is one statement per option.

Examples

UseText → statementResult
Routing / triagerequest → "The user wants to set an alarm."96.0% (MASSIVE intents)
RAG groundingretrieved passages → generated answer0.77 F1 (RAGTruth)
Guardrails / Moderationmessage → policy statement90.8% (CrossingGuard), 92.7% (Wikipedia insults)
Zero-shot classification / taggingreview → "This review is positive."87.8% (18 tasks)
Clinical extractionclinical note → "The patient is unemployed."97.9% (SDOH-NLI)

68M parameters · documents up to 8k tokens · ~5,600 pairs/s · Apache-2.0

from sentence_transformers import CrossEncoder

model = CrossEncoder("dleemiller/finecat-nli-v2-s-wsp")
text = "My credit card was billed twice for one purchase."
labels = ["billing", "shipping", "account access"]
probs = model.predict([(text, f"This text is about {l}.") for l in labels], apply_softmax=True)
print({l: round(float(p[0]), 3) for l, p in zip(labels, probs)})  # p[0] = P(entailment)
# {'billing': 0.87, 'shipping': 0.03, 'account access': 0.12}

More in Recommended Applications and the 45-dataset evaluation.


Table of Contents


WSP findings

An LLM agent edited the weights directly from forward-pass reads and probe sets (no training), looking for unexpected behaviour: confident errors a model of this size should not make. This edit rolls up the recipe first found on finecat-nli-v2-xxs-wsp.

  • Denied structural entailments. Entailments that keep part of the premise are read as neutral: relative-clause deletion, object relative clauses, modus ponens, conditionals. The encoder already separates them from look-alike traps (linear probe AUC ≈ 0.95 at the classifier input); the readout did not use it.
  • The edit: one classifier-input direction, fitted to repair those denials while held invisible on a pool of the model's own unsure not-entailed families, added to the entailment row and subtracted (half as much) from the neutral row.
  • What did not work: an installed, gated MLP unit (an Oskin-style detector neuron) beat a same-slot random control on the targets but cost monotonicity and negation reasoning on the real benchmarks (NMoNLI, MED), so it was removed; steering and head edits never beat their controls.
  • Result: Skill Index 47.1 → 47.5 (as shipped 45.6 → 47.5, the temperature is folded in), ECE 8.8 → 7.8, overall accuracy 0.7693 → 0.7679. Largest Skill gains: seahorse +0.274, frank_sent +0.082, hans +0.062, legal_domain +0.024; largest losses: bionli -0.057, conjnli -0.041, vast -0.027, fol -0.024. The gain is concentrated in grounding and hallucination detection and in HANS; accuracy is slightly lower (macro −0.15 pt; 45-set 0.7703 vs 0.7718).

NLI Evaluation Results

Comparison on the OpenNLI leaderboard (v0.2.9). finecat-nli-v2-m is shown for reference (not ranked). WSP models share their base model's architecture, so they use its measured throughput.

ModelParamsSkill IndexAccuracymnlimnli_mismatchedsnlianli_r1anli_r2anli_r3wanlilingnliCALThroughput (pairs/s)
dleemiller/finecat-nli-v2-m150M52.70.79420.89530.89460.92210.70500.51900.49830.74480.84997.52,836
dleemiller/finecat-nli-v2-s-wsp68M47.50.76790.86280.86250.90580.66600.51200.47170.72300.79987.85,591
dleemiller/finecat-nli-v2-s68M47.10.76930.86710.86630.90840.65900.49900.47000.72280.79928.85,591
dleemiller/finecat-nli-v2-xs32M39.10.72330.81520.81790.88470.58900.46400.45500.68100.73609.614,505
sileod/deberta-v3-xsmall-tasksource-nli*71M21.10.61430.84110.85260.87180.54900.38800.41580.69340.770814.87,492
dleemiller/EttinX-nli-s68M9.90.54680.87650.87950.91240.33400.28100.30830.62340.801227.45,570
cross-encoder/nli-deberta-v3-xsmall71M6.10.53010.87810.87800.91670.36000.30200.31920.61080.811737.27,466
cross-encoder/nli-MiniLM2-L6-H76882M3.80.51260.86580.86880.91310.30800.28200.28920.58240.789834.514,016
cross-encoder/nli-distilroberta-base82M1.80.48990.83670.83940.89970.26700.28100.29500.55220.752334.514,066

* trained on one or more OpenNLI test sets; those scores are replaced by estimates, as on the leaderboard.


Usage

Label Map:

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

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load the model and run inference.

from sentence_transformers import CrossEncoder
import numpy as np

model = CrossEncoder("dleemiller/finecat-nli-v2-s-wsp")
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}")


Recommended Applications

Frame each check as a premise (text) and hypothesis (statement), and use the entailment probability.

ApplicationExample hypothesisSupporting results
Zero-shot tagging / topic classification"This text is about billing."zs_meta, fin_topics
Routing and decisions in agent pipelines"The user wants to cancel an order."zs_meta, mnli, snli
RAG grounding / hallucination checksEach answer sentence vs. retrieved passagesragtruth, wice, vitaminc
Contract and policy review"The agreement permits sharing data with third parties."contractnli_a/b, docnli
Biomedical and health claim checkingClaim vs. abstract or clinical notesdoh_nli, biosift, bionli, scifact, pubhealth
Dialogue fact-checkingAssistant reply vs. knowledge sourcedialfact, vitaminc
Guardrails / policy matchingPolicy statement vs. user or model textcrossingguard
Stance detection"The author supports the proposal."vast

Less suited: financial and general legal verification (findver, legal_domain), clinical-trial eligibility (nli4ct), multi-document legal reasoning (control), and adversarial reasoning (anli_r3, nope_adv).


Extended Evaluation (45 datasets)

Accuracy on the test splits of 45 NLI and adjacent datasets, this model vs. the original finecat-nli-v2-s, both scored with the same OpenNLI script (FineCat: the labelled test split). 2-way datasets (entailed vs. not) are scored as entailment vs. any non-entailment prediction. DocNLI and VitaminC are evaluated on fixed random subsets of 1,000 and 10,000 pairs. FRANK (news-summary factuality) is scored per summary sentence: each sentence vs. its source article, labelled by the majority annotator judgment.

Datasetnfinecat-nli-v2-s-wspfinecat-nli-v2-sΔ
finecat180120.79110.7914-0.0003
mnli98150.86280.8671-0.0044
mnli_mismatched98300.86250.8663-0.0039
snli98240.90580.9084-0.0025
anli_r110000.66600.6590+0.0070
anli_r210000.51200.4990+0.0130
anli_r312000.47170.4700+0.0017
wanli50000.72300.7228+0.0002
lingnli73610.79980.7992+0.0005
glue_diagnostic11000.68640.6918-0.0055
med53800.75720.7645-0.0072
nan_nli2580.67050.6938-0.0233
scone_test10000.99800.9990-0.0010
nmonli_test2001.00001.0000+0.0000
conjnli6230.67580.6918-0.0161
nope_adv3450.41160.4145-0.0029
nli4ct1990.62810.6583-0.0302
sdoh_nli9900.97880.9788+0.0000
healthver2300.69570.7087-0.0130
scifact3000.77000.7733-0.0033
biosift10000.90100.9140-0.0130
scientsbank9710.69820.6910+0.0072
beetle8190.57880.5861-0.0073
legal_domain11630.50640.5082-0.0017
findver5000.61400.6260-0.0120
dialfact14990.79920.8005-0.0013
frank_sent31760.71660.6820+0.0346
ragtruth14970.81500.8196-0.0047
vast15000.70130.7267-0.0253
zs_meta54000.87220.8776-0.0054
seahorse8000.88120.8363+0.0450
pubhealth6000.82170.8217+0.0000
bionli6000.79330.8017-0.0083
fin_topics6000.94830.9500-0.0017
vitaminc100000.82400.8144+0.0096
docnli10000.76200.7650-0.0030
contractnli_a17070.91150.9121-0.0006
contractnli_b20740.86890.8698-0.0010
control8000.60880.6025+0.0062
fol102770.76910.7855-0.0164
scitail21260.91960.9318-0.0122
wice9580.83510.8111+0.0240
sick49060.91010.9119-0.0018
crossingguard53970.89790.9081-0.0102
hans150000.84230.8215+0.0208

Macro average over the 45 datasets: 0.7703 (original 0.7718).

Training Details

The base model (before the WSP edit) is a fine-tune of jhu-clsp/ettin-encoder-68m, trained on the dleemiller/FineCat-NLI-Reason dataset, a compilation of several high-quality NLI data sources with quality screening and reduction of easy samples in the training split. Also includes additional NLI, fact verification and long document sources (2.05M pairs in total). The training uses logit distillation from an NLI finetune of Qwen3.8-27B.

Distillation loss looks like this: $$ \begin{equation} \mathcal{L} = \alpha \cdot \mathcal{L}_{\text{CE}}(z^{(s)}, y) + \beta \cdot T^2 \cdot \mathrm{KL}\left(\sigma(z^{(t)}/T) ,|, \sigma(z^{(s)}/T)\right) \end{equation} $$

where \(z^{(s)}\) and \(z^{(t)}\) are the student and teacher logits, \(y\) are the ground truth labels, \(\alpha = 0.2\), \(\beta = 0.8\) and \(T = 1\).

Training inputs keep the full documents the teacher labelled (up to 8k tokens). The model was trained for 3 epochs at a constant learning rate followed by a 1-epoch cooldown. The released weights are the soup greedy_val, selected on the validation/dev objective (never a test set), with the output temperature calibrated on the validation split. The learning rate was 8e-05, chosen from a WSD learning-rate probe (1x and 4x probe horizons, extrapolated to the full run) combined with the size trend of the larger v2 models.


Acknowledgments

We thank the creators and contributors of jhu-clsp (Ettin) and the Qwen team for making their work available. This model would not be possible without their efforts and open source contributions.

Citation

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

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForSequenceClassification
Ревизия весов
95de74c

0 моделей