Text Classification
sentence-transformers
Safetensors
English
modernbert
cross-encoder
reranker
Generated from Trainer
dataset_size:942069
loss:PrecomputedDistillationLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use dleemiller/EttinX-nli-xxs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use dleemiller/EttinX-nli-xxs with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("dleemiller/EttinX-nli-xxs") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -54,446 +54,110 @@ model-index:
|
|
| 54 |
name: F1 Weighted
|
| 55 |
---
|
| 56 |
|
| 57 |
-
#
|
| 58 |
|
| 59 |
-
This
|
|
|
|
| 60 |
|
| 61 |
-
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
-
- **Model Type:** Cross Encoder
|
| 65 |
-
- **Base model:** [jhu-clsp/ettin-encoder-17m](https://huggingface.co/jhu-clsp/ettin-encoder-17m) <!-- at revision 987607455c61e7a5bbc85f7758e0512ea6d0ae4c -->
|
| 66 |
-
- **Maximum Sequence Length:** 7999 tokens
|
| 67 |
-
- **Number of Output Labels:** 3 labels
|
| 68 |
-
- **Training Dataset:**
|
| 69 |
-
- [all-nli-distill](https://huggingface.co/datasets/dleemiller/all-nli-distill)
|
| 70 |
-
- **Language:** en
|
| 71 |
-
<!-- - **License:** Unknown -->
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 76 |
-
- **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
|
| 77 |
-
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 78 |
-
- **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder)
|
| 79 |
-
|
| 80 |
-
## Usage
|
| 81 |
|
| 82 |
-
##
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
-
pip install -U sentence-transformers
|
| 88 |
-
```
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
-
# Download from the 🤗 Hub
|
| 95 |
-
model = CrossEncoder("cross_encoder_model_id")
|
| 96 |
-
# Get scores for pairs of texts
|
| 97 |
-
pairs = [
|
| 98 |
-
['Two women are embracing while holding to go packages.', 'The sisters are hugging goodbye while holding to go packages after just eating lunch.'],
|
| 99 |
-
['Two women are embracing while holding to go packages.', 'Two woman are holding packages.'],
|
| 100 |
-
['Two women are embracing while holding to go packages.', 'The men are fighting outside a deli.'],
|
| 101 |
-
['Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.', 'Two kids in numbered jerseys wash their hands.'],
|
| 102 |
-
['Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.', 'Two kids at a ballgame wash their hands.'],
|
| 103 |
-
]
|
| 104 |
-
scores = model.predict(pairs)
|
| 105 |
-
print(scores.shape)
|
| 106 |
-
# (5, 3)
|
| 107 |
-
```
|
| 108 |
|
| 109 |
-
|
| 110 |
-
### Direct Usage (Transformers)
|
| 111 |
|
| 112 |
-
|
| 113 |
|
| 114 |
-
|
| 115 |
-
-->
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
|
| 120 |
-
|
|
|
|
| 121 |
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
-
|
| 128 |
-
### Out-of-Scope Use
|
| 129 |
|
| 130 |
-
|
| 131 |
-
-->
|
| 132 |
|
| 133 |
-
##
|
|
|
|
| 134 |
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
-
###
|
|
|
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|:-------------|:-----------|:------------|
|
| 144 |
-
| **f1_macro** | **0.8355** | **0.8411** |
|
| 145 |
-
| f1_micro | 0.8359 | 0.8415 |
|
| 146 |
-
| f1_weighted | 0.8362 | 0.8418 |
|
| 147 |
|
| 148 |
-
|
| 149 |
-
## Bias, Risks and Limitations
|
| 150 |
|
| 151 |
-
|
| 152 |
-
--
|
| 153 |
|
| 154 |
-
|
| 155 |
-
### Recommendations
|
| 156 |
|
| 157 |
-
|
| 158 |
-
-->
|
| 159 |
|
| 160 |
-
|
| 161 |
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
#### all-nli-distill
|
| 165 |
-
|
| 166 |
-
* Dataset: [all-nli-distill](https://huggingface.co/datasets/dleemiller/all-nli-distill) at [6907d07](https://huggingface.co/datasets/dleemiller/all-nli-distill/tree/6907d071937601df154a4641e824cbce44e8fd41)
|
| 167 |
-
* Size: 942,069 training samples
|
| 168 |
-
* Columns: <code>premise</code>, <code>hypothesis</code>, <code>label</code>, and <code>hash</code>
|
| 169 |
-
* Approximate statistics based on the first 1000 samples:
|
| 170 |
-
| | premise | hypothesis | label | hash |
|
| 171 |
-
|:--------|:-----------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------|:-------------------------------------------------------------------|:----------------------------------------------------------------------------------------------|
|
| 172 |
-
| type | string | string | int | string |
|
| 173 |
-
| details | <ul><li>min: 7 characters</li><li>mean: 87.47 characters</li><li>max: 485 characters</li></ul> | <ul><li>min: 3 characters</li><li>mean: 45.98 characters</li><li>max: 157 characters</li></ul> | <ul><li>0: ~32.70%</li><li>1: ~34.20%</li><li>2: ~33.10%</li></ul> | <ul><li>min: 32 characters</li><li>mean: 32.0 characters</li><li>max: 32 characters</li></ul> |
|
| 174 |
-
* Samples:
|
| 175 |
-
| premise | hypothesis | label | hash |
|
| 176 |
-
|:--------------------------------------------------------------------------------------|:---------------------------------------|:---------------|:----------------------------------------------|
|
| 177 |
-
| <code>somehow, somewhere.</code> | <code>Someplace, in some way.</code> | <code>1</code> | <code>9a14d41bdf965ed999446ea11dbf5b67</code> |
|
| 178 |
-
| <code>A boy is sitting on a boat with two flags.</code> | <code>A blonde person sitting.</code> | <code>2</code> | <code>758664a444dd4c02d89220da2ab499ac</code> |
|
| 179 |
-
| <code>A asian male suit clad, uses a umbrella to shield himself from the rain.</code> | <code>He is late for a meeting.</code> | <code>2</code> | <code>7e1155728f9cf33655076ec6b36cdb10</code> |
|
| 180 |
-
* Loss: <code>__main__.PrecomputedDistillationLoss</code>
|
| 181 |
-
|
| 182 |
-
### Evaluation Dataset
|
| 183 |
-
|
| 184 |
-
#### all-nli-distill
|
| 185 |
-
|
| 186 |
-
* Dataset: [all-nli-distill](https://huggingface.co/datasets/dleemiller/all-nli-distill) at [6907d07](https://huggingface.co/datasets/dleemiller/all-nli-distill/tree/6907d071937601df154a4641e824cbce44e8fd41)
|
| 187 |
-
* Size: 19,657 evaluation samples
|
| 188 |
-
* Columns: <code>premise</code>, <code>hypothesis</code>, <code>label</code>, and <code>hash</code>
|
| 189 |
-
* Approximate statistics based on the first 1000 samples:
|
| 190 |
-
| | premise | hypothesis | label | hash |
|
| 191 |
-
|:--------|:------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------|:----------------------------------------------------------------------------------------------|
|
| 192 |
-
| type | string | string | int | string |
|
| 193 |
-
| details | <ul><li>min: 16 characters</li><li>mean: 75.01 characters</li><li>max: 229 characters</li></ul> | <ul><li>min: 11 characters</li><li>mean: 37.66 characters</li><li>max: 116 characters</li></ul> | <ul><li>0: ~33.60%</li><li>1: ~33.10%</li><li>2: ~33.30%</li></ul> | <ul><li>min: 32 characters</li><li>mean: 32.0 characters</li><li>max: 32 characters</li></ul> |
|
| 194 |
-
* Samples:
|
| 195 |
-
| premise | hypothesis | label | hash |
|
| 196 |
-
|:-------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------|:---------------|:----------------------------------------------|
|
| 197 |
-
| <code>Two women are embracing while holding to go packages.</code> | <code>The sisters are hugging goodbye while holding to go packages after just eating lunch.</code> | <code>2</code> | <code>ee3806dad2b757a8e131aa50f2b73ec9</code> |
|
| 198 |
-
| <code>Two women are embracing while holding to go packages.</code> | <code>Two woman are holding packages.</code> | <code>1</code> | <code>563afee877ed42f33dafe7c76fe9604b</code> |
|
| 199 |
-
| <code>Two women are embracing while holding to go packages.</code> | <code>The men are fighting outside a deli.</code> | <code>0</code> | <code>fd7c1382a8321094d60105ff37c038da</code> |
|
| 200 |
-
* Loss: <code>__main__.PrecomputedDistillationLoss</code>
|
| 201 |
-
|
| 202 |
-
### Training Hyperparameters
|
| 203 |
-
#### Non-Default Hyperparameters
|
| 204 |
-
|
| 205 |
-
- `eval_strategy`: steps
|
| 206 |
-
- `per_device_train_batch_size`: 512
|
| 207 |
-
- `per_device_eval_batch_size`: 512
|
| 208 |
-
- `learning_rate`: 0.0001
|
| 209 |
-
- `num_train_epochs`: 6
|
| 210 |
-
- `warmup_ratio`: 0.1
|
| 211 |
-
- `bf16`: True
|
| 212 |
-
|
| 213 |
-
#### All Hyperparameters
|
| 214 |
-
<details><summary>Click to expand</summary>
|
| 215 |
-
|
| 216 |
-
- `overwrite_output_dir`: False
|
| 217 |
-
- `do_predict`: False
|
| 218 |
-
- `eval_strategy`: steps
|
| 219 |
-
- `prediction_loss_only`: True
|
| 220 |
-
- `per_device_train_batch_size`: 512
|
| 221 |
-
- `per_device_eval_batch_size`: 512
|
| 222 |
-
- `per_gpu_train_batch_size`: None
|
| 223 |
-
- `per_gpu_eval_batch_size`: None
|
| 224 |
-
- `gradient_accumulation_steps`: 1
|
| 225 |
-
- `eval_accumulation_steps`: None
|
| 226 |
-
- `torch_empty_cache_steps`: None
|
| 227 |
-
- `learning_rate`: 0.0001
|
| 228 |
-
- `weight_decay`: 0.0
|
| 229 |
-
- `adam_beta1`: 0.9
|
| 230 |
-
- `adam_beta2`: 0.999
|
| 231 |
-
- `adam_epsilon`: 1e-08
|
| 232 |
-
- `max_grad_norm`: 1.0
|
| 233 |
-
- `num_train_epochs`: 6
|
| 234 |
-
- `max_steps`: -1
|
| 235 |
-
- `lr_scheduler_type`: linear
|
| 236 |
-
- `lr_scheduler_kwargs`: {}
|
| 237 |
-
- `warmup_ratio`: 0.1
|
| 238 |
-
- `warmup_steps`: 0
|
| 239 |
-
- `log_level`: passive
|
| 240 |
-
- `log_level_replica`: warning
|
| 241 |
-
- `log_on_each_node`: True
|
| 242 |
-
- `logging_nan_inf_filter`: True
|
| 243 |
-
- `save_safetensors`: True
|
| 244 |
-
- `save_on_each_node`: False
|
| 245 |
-
- `save_only_model`: False
|
| 246 |
-
- `restore_callback_states_from_checkpoint`: False
|
| 247 |
-
- `no_cuda`: False
|
| 248 |
-
- `use_cpu`: False
|
| 249 |
-
- `use_mps_device`: False
|
| 250 |
-
- `seed`: 42
|
| 251 |
-
- `data_seed`: None
|
| 252 |
-
- `jit_mode_eval`: False
|
| 253 |
-
- `use_ipex`: False
|
| 254 |
-
- `bf16`: True
|
| 255 |
-
- `fp16`: False
|
| 256 |
-
- `fp16_opt_level`: O1
|
| 257 |
-
- `half_precision_backend`: auto
|
| 258 |
-
- `bf16_full_eval`: False
|
| 259 |
-
- `fp16_full_eval`: False
|
| 260 |
-
- `tf32`: None
|
| 261 |
-
- `local_rank`: 0
|
| 262 |
-
- `ddp_backend`: None
|
| 263 |
-
- `tpu_num_cores`: None
|
| 264 |
-
- `tpu_metrics_debug`: False
|
| 265 |
-
- `debug`: []
|
| 266 |
-
- `dataloader_drop_last`: False
|
| 267 |
-
- `dataloader_num_workers`: 0
|
| 268 |
-
- `dataloader_prefetch_factor`: None
|
| 269 |
-
- `past_index`: -1
|
| 270 |
-
- `disable_tqdm`: False
|
| 271 |
-
- `remove_unused_columns`: True
|
| 272 |
-
- `label_names`: None
|
| 273 |
-
- `load_best_model_at_end`: False
|
| 274 |
-
- `ignore_data_skip`: False
|
| 275 |
-
- `fsdp`: []
|
| 276 |
-
- `fsdp_min_num_params`: 0
|
| 277 |
-
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 278 |
-
- `fsdp_transformer_layer_cls_to_wrap`: None
|
| 279 |
-
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 280 |
-
- `parallelism_config`: None
|
| 281 |
-
- `deepspeed`: None
|
| 282 |
-
- `label_smoothing_factor`: 0.0
|
| 283 |
-
- `optim`: adamw_torch_fused
|
| 284 |
-
- `optim_args`: None
|
| 285 |
-
- `adafactor`: False
|
| 286 |
-
- `group_by_length`: False
|
| 287 |
-
- `length_column_name`: length
|
| 288 |
-
- `ddp_find_unused_parameters`: None
|
| 289 |
-
- `ddp_bucket_cap_mb`: None
|
| 290 |
-
- `ddp_broadcast_buffers`: False
|
| 291 |
-
- `dataloader_pin_memory`: True
|
| 292 |
-
- `dataloader_persistent_workers`: False
|
| 293 |
-
- `skip_memory_metrics`: True
|
| 294 |
-
- `use_legacy_prediction_loop`: False
|
| 295 |
-
- `push_to_hub`: False
|
| 296 |
-
- `resume_from_checkpoint`: None
|
| 297 |
-
- `hub_model_id`: None
|
| 298 |
-
- `hub_strategy`: every_save
|
| 299 |
-
- `hub_private_repo`: None
|
| 300 |
-
- `hub_always_push`: False
|
| 301 |
-
- `hub_revision`: None
|
| 302 |
-
- `gradient_checkpointing`: False
|
| 303 |
-
- `gradient_checkpointing_kwargs`: None
|
| 304 |
-
- `include_inputs_for_metrics`: False
|
| 305 |
-
- `include_for_metrics`: []
|
| 306 |
-
- `eval_do_concat_batches`: True
|
| 307 |
-
- `fp16_backend`: auto
|
| 308 |
-
- `push_to_hub_model_id`: None
|
| 309 |
-
- `push_to_hub_organization`: None
|
| 310 |
-
- `mp_parameters`:
|
| 311 |
-
- `auto_find_batch_size`: False
|
| 312 |
-
- `full_determinism`: False
|
| 313 |
-
- `torchdynamo`: None
|
| 314 |
-
- `ray_scope`: last
|
| 315 |
-
- `ddp_timeout`: 1800
|
| 316 |
-
- `torch_compile`: False
|
| 317 |
-
- `torch_compile_backend`: None
|
| 318 |
-
- `torch_compile_mode`: None
|
| 319 |
-
- `include_tokens_per_second`: False
|
| 320 |
-
- `include_num_input_tokens_seen`: False
|
| 321 |
-
- `neftune_noise_alpha`: None
|
| 322 |
-
- `optim_target_modules`: None
|
| 323 |
-
- `batch_eval_metrics`: False
|
| 324 |
-
- `eval_on_start`: False
|
| 325 |
-
- `use_liger_kernel`: False
|
| 326 |
-
- `liger_kernel_config`: None
|
| 327 |
-
- `eval_use_gather_object`: False
|
| 328 |
-
- `average_tokens_across_devices`: False
|
| 329 |
-
- `prompts`: None
|
| 330 |
-
- `batch_sampler`: batch_sampler
|
| 331 |
-
- `multi_dataset_batch_sampler`: proportional
|
| 332 |
-
- `router_mapping`: {}
|
| 333 |
-
- `learning_rate_mapping`: {}
|
| 334 |
-
|
| 335 |
-
</details>
|
| 336 |
-
|
| 337 |
-
### Training Logs
|
| 338 |
-
<details><summary>Click to expand</summary>
|
| 339 |
-
|
| 340 |
-
| Epoch | Step | Training Loss | Validation Loss | AllNLI-dev_f1_macro | AllNLI-test_f1_macro |
|
| 341 |
-
|:------:|:-----:|:-------------:|:---------------:|:-------------------:|:--------------------:|
|
| 342 |
-
| -1 | -1 | - | - | 0.2782 | - |
|
| 343 |
-
| 0.0543 | 100 | 6.7398 | - | - | - |
|
| 344 |
-
| 0.1087 | 200 | 4.797 | - | - | - |
|
| 345 |
-
| 0.1630 | 300 | 3.277 | - | - | - |
|
| 346 |
-
| 0.2174 | 400 | 2.8003 | - | - | - |
|
| 347 |
-
| 0.2717 | 500 | 2.5854 | 2.5302 | 0.7257 | - |
|
| 348 |
-
| 0.3261 | 600 | 2.3873 | - | - | - |
|
| 349 |
-
| 0.3804 | 700 | 2.238 | - | - | - |
|
| 350 |
-
| 0.4348 | 800 | 2.1506 | - | - | - |
|
| 351 |
-
| 0.4891 | 900 | 2.0302 | - | - | - |
|
| 352 |
-
| 0.5435 | 1000 | 1.9461 | 1.9746 | 0.7766 | - |
|
| 353 |
-
| 0.5978 | 1100 | 1.8948 | - | - | - |
|
| 354 |
-
| 0.6522 | 1200 | 1.8219 | - | - | - |
|
| 355 |
-
| 0.7065 | 1300 | 1.7425 | - | - | - |
|
| 356 |
-
| 0.7609 | 1400 | 1.6744 | - | - | - |
|
| 357 |
-
| 0.8152 | 1500 | 1.6372 | 1.6647 | 0.8001 | - |
|
| 358 |
-
| 0.8696 | 1600 | 1.605 | - | - | - |
|
| 359 |
-
| 0.9239 | 1700 | 1.5654 | - | - | - |
|
| 360 |
-
| 0.9783 | 1800 | 1.5148 | - | - | - |
|
| 361 |
-
| 1.0326 | 1900 | 1.4017 | - | - | - |
|
| 362 |
-
| 1.0870 | 2000 | 1.3142 | 1.5475 | 0.8060 | - |
|
| 363 |
-
| 1.1413 | 2100 | 1.2858 | - | - | - |
|
| 364 |
-
| 1.1957 | 2200 | 1.2796 | - | - | - |
|
| 365 |
-
| 1.25 | 2300 | 1.2624 | - | - | - |
|
| 366 |
-
| 1.3043 | 2400 | 1.2757 | - | - | - |
|
| 367 |
-
| 1.3587 | 2500 | 1.2399 | 1.4343 | 0.8170 | - |
|
| 368 |
-
| 1.4130 | 2600 | 1.25 | - | - | - |
|
| 369 |
-
| 1.4674 | 2700 | 1.2519 | - | - | - |
|
| 370 |
-
| 1.5217 | 2800 | 1.2179 | - | - | - |
|
| 371 |
-
| 1.5761 | 2900 | 1.2035 | - | - | - |
|
| 372 |
-
| 1.6304 | 3000 | 1.2185 | 1.3897 | 0.8223 | - |
|
| 373 |
-
| 1.6848 | 3100 | 1.1846 | - | - | - |
|
| 374 |
-
| 1.7391 | 3200 | 1.1885 | - | - | - |
|
| 375 |
-
| 1.7935 | 3300 | 1.1544 | - | - | - |
|
| 376 |
-
| 1.8478 | 3400 | 1.1699 | - | - | - |
|
| 377 |
-
| 1.9022 | 3500 | 1.1654 | 1.3178 | 0.8279 | - |
|
| 378 |
-
| 1.9565 | 3600 | 1.1577 | - | - | - |
|
| 379 |
-
| 2.0109 | 3700 | 1.1 | - | - | - |
|
| 380 |
-
| 2.0652 | 3800 | 0.8862 | - | - | - |
|
| 381 |
-
| 2.1196 | 3900 | 0.8853 | - | - | - |
|
| 382 |
-
| 2.1739 | 4000 | 0.8899 | 1.3069 | 0.8282 | - |
|
| 383 |
-
| 2.2283 | 4100 | 0.8951 | - | - | - |
|
| 384 |
-
| 2.2826 | 4200 | 0.8869 | - | - | - |
|
| 385 |
-
| 2.3370 | 4300 | 0.8773 | - | - | - |
|
| 386 |
-
| 2.3913 | 4400 | 0.8986 | - | - | - |
|
| 387 |
-
| 2.4457 | 4500 | 0.8936 | 1.3049 | 0.8314 | - |
|
| 388 |
-
| 2.5 | 4600 | 0.8827 | - | - | - |
|
| 389 |
-
| 2.5543 | 4700 | 0.9018 | - | - | - |
|
| 390 |
-
| 2.6087 | 4800 | 0.8841 | - | - | - |
|
| 391 |
-
| 2.6630 | 4900 | 0.8909 | - | - | - |
|
| 392 |
-
| 2.7174 | 5000 | 0.8971 | 1.2616 | 0.8318 | - |
|
| 393 |
-
| 2.7717 | 5100 | 0.8851 | - | - | - |
|
| 394 |
-
| 2.8261 | 5200 | 0.8795 | - | - | - |
|
| 395 |
-
| 2.8804 | 5300 | 0.8793 | - | - | - |
|
| 396 |
-
| 2.9348 | 5400 | 0.8827 | - | - | - |
|
| 397 |
-
| 2.9891 | 5500 | 0.867 | 1.2425 | 0.8338 | - |
|
| 398 |
-
| 3.0435 | 5600 | 0.7091 | - | - | - |
|
| 399 |
-
| 3.0978 | 5700 | 0.664 | - | - | - |
|
| 400 |
-
| 3.1522 | 5800 | 0.6576 | - | - | - |
|
| 401 |
-
| 3.2065 | 5900 | 0.6732 | - | - | - |
|
| 402 |
-
| 3.2609 | 6000 | 0.6755 | 1.2826 | 0.8342 | - |
|
| 403 |
-
| 3.3152 | 6100 | 0.6762 | - | - | - |
|
| 404 |
-
| 3.3696 | 6200 | 0.6677 | - | - | - |
|
| 405 |
-
| 3.4239 | 6300 | 0.6869 | - | - | - |
|
| 406 |
-
| 3.4783 | 6400 | 0.6807 | - | - | - |
|
| 407 |
-
| 3.5326 | 6500 | 0.6759 | 1.2734 | 0.8336 | - |
|
| 408 |
-
| 3.5870 | 6600 | 0.6781 | - | - | - |
|
| 409 |
-
| 3.6413 | 6700 | 0.678 | - | - | - |
|
| 410 |
-
| 3.6957 | 6800 | 0.678 | - | - | - |
|
| 411 |
-
| 3.75 | 6900 | 0.6766 | - | - | - |
|
| 412 |
-
| 3.8043 | 7000 | 0.6765 | 1.2607 | 0.8362 | - |
|
| 413 |
-
| 3.8587 | 7100 | 0.6706 | - | - | - |
|
| 414 |
-
| 3.9130 | 7200 | 0.6811 | - | - | - |
|
| 415 |
-
| 3.9674 | 7300 | 0.6714 | - | - | - |
|
| 416 |
-
| 4.0217 | 7400 | 0.6232 | - | - | - |
|
| 417 |
-
| 4.0761 | 7500 | 0.5231 | 1.2781 | 0.8358 | - |
|
| 418 |
-
| 4.1304 | 7600 | 0.529 | - | - | - |
|
| 419 |
-
| 4.1848 | 7700 | 0.526 | - | - | - |
|
| 420 |
-
| 4.2391 | 7800 | 0.5348 | - | - | - |
|
| 421 |
-
| 4.2935 | 7900 | 0.5381 | - | - | - |
|
| 422 |
-
| 4.3478 | 8000 | 0.5309 | 1.2760 | 0.8363 | - |
|
| 423 |
-
| 4.4022 | 8100 | 0.5401 | - | - | - |
|
| 424 |
-
| 4.4565 | 8200 | 0.5323 | - | - | - |
|
| 425 |
-
| 4.5109 | 8300 | 0.5391 | - | - | - |
|
| 426 |
-
| 4.5652 | 8400 | 0.5409 | - | - | - |
|
| 427 |
-
| 4.6196 | 8500 | 0.5389 | 1.2844 | 0.8377 | - |
|
| 428 |
-
| 4.6739 | 8600 | 0.542 | - | - | - |
|
| 429 |
-
| 4.7283 | 8700 | 0.5388 | - | - | - |
|
| 430 |
-
| 4.7826 | 8800 | 0.5289 | - | - | - |
|
| 431 |
-
| 4.8370 | 8900 | 0.5327 | - | - | - |
|
| 432 |
-
| 4.8913 | 9000 | 0.5323 | 1.2743 | 0.8350 | - |
|
| 433 |
-
| 4.9457 | 9100 | 0.5326 | - | - | - |
|
| 434 |
-
| 5.0 | 9200 | 0.5358 | - | - | - |
|
| 435 |
-
| 5.0543 | 9300 | 0.4469 | - | - | - |
|
| 436 |
-
| 5.1087 | 9400 | 0.4526 | - | - | - |
|
| 437 |
-
| 5.1630 | 9500 | 0.4461 | 1.2887 | 0.8360 | - |
|
| 438 |
-
| 5.2174 | 9600 | 0.4476 | - | - | - |
|
| 439 |
-
| 5.2717 | 9700 | 0.4442 | - | - | - |
|
| 440 |
-
| 5.3261 | 9800 | 0.4508 | - | - | - |
|
| 441 |
-
| 5.3804 | 9900 | 0.4456 | - | - | - |
|
| 442 |
-
| 5.4348 | 10000 | 0.4452 | 1.2967 | 0.8353 | - |
|
| 443 |
-
| 5.4891 | 10100 | 0.4447 | - | - | - |
|
| 444 |
-
| 5.5435 | 10200 | 0.4433 | - | - | - |
|
| 445 |
-
| 5.5978 | 10300 | 0.438 | - | - | - |
|
| 446 |
-
| 5.6522 | 10400 | 0.4437 | - | - | - |
|
| 447 |
-
| 5.7065 | 10500 | 0.4428 | 1.2847 | 0.8365 | - |
|
| 448 |
-
| 5.7609 | 10600 | 0.4379 | - | - | - |
|
| 449 |
-
| 5.8152 | 10700 | 0.4451 | - | - | - |
|
| 450 |
-
| 5.8696 | 10800 | 0.4444 | - | - | - |
|
| 451 |
-
| 5.9239 | 10900 | 0.4474 | - | - | - |
|
| 452 |
-
| 5.9783 | 11000 | 0.4461 | 1.2833 | 0.8355 | - |
|
| 453 |
-
| -1 | -1 | - | - | - | 0.8411 |
|
| 454 |
-
|
| 455 |
-
</details>
|
| 456 |
-
|
| 457 |
-
### Framework Versions
|
| 458 |
-
- Python: 3.12.2
|
| 459 |
-
- Sentence Transformers: 5.1.0
|
| 460 |
-
- Transformers: 4.57.0.dev0
|
| 461 |
-
- PyTorch: 2.8.0+cu128
|
| 462 |
-
- Accelerate: 1.10.1
|
| 463 |
-
- Datasets: 4.0.0
|
| 464 |
-
- Tokenizers: 0.22.0
|
| 465 |
|
| 466 |
## Citation
|
| 467 |
|
| 468 |
-
|
| 469 |
|
| 470 |
-
#### Sentence Transformers
|
| 471 |
```bibtex
|
| 472 |
-
@
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
publisher = "Association for Computational Linguistics",
|
| 479 |
-
url = "https://arxiv.org/abs/1908.10084",
|
| 480 |
}
|
| 481 |
```
|
| 482 |
|
| 483 |
-
|
| 484 |
-
## Glossary
|
| 485 |
-
|
| 486 |
-
*Clearly define terms in order to be accessible across audiences.*
|
| 487 |
-
-->
|
| 488 |
-
|
| 489 |
-
<!--
|
| 490 |
-
## Model Card Authors
|
| 491 |
-
|
| 492 |
-
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 493 |
-
-->
|
| 494 |
|
| 495 |
-
|
| 496 |
-
## Model Card Contact
|
| 497 |
|
| 498 |
-
|
| 499 |
-
-->
|
|
|
|
| 54 |
name: F1 Weighted
|
| 55 |
---
|
| 56 |
|
| 57 |
+
# EttinX Cross-Encoder: Natural Language Inference (NLI)
|
| 58 |
|
| 59 |
+
This cross encoder performs sequence classification for contradiction/neutral/entailment labels. This has
|
| 60 |
+
drop-in compatibility with comparable sentence transformers cross encoders.
|
| 61 |
|
| 62 |
+
To train this model, I added teacher logits to the all-nli dataset `dleemiller/all-nli-distill` from the
|
| 63 |
+
`dleemiller/ModernCE-large-nli` model. This significantly improves performance above standard training.
|
| 64 |
|
| 65 |
+
This 17m architecture is based on ModernBERT and is an excellent candidate for lightweight CPU inference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
## Features
|
| 70 |
+
- **High performing:** Achieves **80.19%** and 86.50% on MNLI mismatched and SNLI test.
|
| 71 |
+
- **Efficient architecture:** Based on the Ettin-17m encoder design (17M parameters), offering faster inference speeds.
|
| 72 |
+
- **Extended context length:** Processes sequences up to 8192 tokens, great for LLM output evals.
|
| 73 |
|
| 74 |
+
---
|
| 75 |
|
| 76 |
+
## Performance
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
| Model | MNLI Mismatched | SNLI Test | Context Length |
|
| 79 |
+
|---------------------------|-------------------|--------------|----------------|
|
| 80 |
+
| `dleemiller/ModernCE-large-nli` | **0.9202** | 0.9110 | 8192 |
|
| 81 |
+
| `dleemiller/ModernCE-base-nli` | 0.9034 | 0.9025 | 8192 |
|
| 82 |
+
| `cross-encoders/deberta-v3-large` | 0.9049 | 0.9220 | 512 |
|
| 83 |
+
| `cross-encoders/deberta-v3-base` | 0.9004 | 0.9234 | 512 |
|
| 84 |
+
| `dleemillerEttinX-nli-sts` | 0.8019 | 0.8650 | 8192 |
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
---
|
|
|
|
| 88 |
|
| 89 |
+
## Usage
|
| 90 |
|
| 91 |
+
To use EttinX for NLI tasks, you can load the model with the Hugging Face `sentence-transformers` library:
|
|
|
|
| 92 |
|
| 93 |
+
```python
|
| 94 |
+
from sentence_transformers import CrossEncoder
|
| 95 |
|
| 96 |
+
# Load EttinX model
|
| 97 |
+
model = CrossEncoder("dleemiller/EttinX-nli-xxs")
|
| 98 |
|
| 99 |
+
scores = model.predict([
|
| 100 |
+
('A man is eating pizza', 'A man eats something'),
|
| 101 |
+
('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')
|
| 102 |
+
])
|
| 103 |
|
| 104 |
+
# Convert scores to labels
|
| 105 |
+
label_mapping = ['contradiction', 'entailment', 'neutral']
|
| 106 |
+
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
|
| 107 |
+
# ['entailment', 'contradiction']
|
| 108 |
+
```
|
| 109 |
|
| 110 |
+
---
|
|
|
|
| 111 |
|
| 112 |
+
## Training Details
|
|
|
|
| 113 |
|
| 114 |
+
### Pretraining
|
| 115 |
+
We initialize the `` weights.
|
| 116 |
|
| 117 |
+
Details:
|
| 118 |
+
- Batch size: 512
|
| 119 |
+
- Learning rate: 1e-4
|
| 120 |
+
- **Attention Dropout:** attention dropout 0.1
|
| 121 |
|
| 122 |
+
### Fine-Tuning
|
| 123 |
+
Fine-tuning was performed on the `dleemiller/all-nli-distill` dataset.
|
| 124 |
|
| 125 |
+
### Validation Results
|
| 126 |
+
The model achieved the following test set performance after fine-tuning:
|
| 127 |
+
- **MNLI Unmatched:** 0.8019
|
| 128 |
+
- **SNLI:** 0.8650
|
| 129 |
|
| 130 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
+
## Model Card
|
|
|
|
| 133 |
|
| 134 |
+
- **Architecture:** Ettin-encoder-17m
|
| 135 |
+
- **Fine-Tuning Data:** `dleemiller/all-nli-distill`
|
| 136 |
|
| 137 |
+
---
|
|
|
|
| 138 |
|
| 139 |
+
## Thank You
|
|
|
|
| 140 |
|
| 141 |
+
Thanks to the Johns Hopkins team for providing the ModernBERT models, and the Sentence Transformers team for their leadership in transformer encoder models.
|
| 142 |
|
| 143 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
## Citation
|
| 146 |
|
| 147 |
+
If you use this model in your research, please cite:
|
| 148 |
|
|
|
|
| 149 |
```bibtex
|
| 150 |
+
@misc{moderncenli2025,
|
| 151 |
+
author = {Miller, D. Lee},
|
| 152 |
+
title = {EttinX NLI: An NLI cross encoder model},
|
| 153 |
+
year = {2025},
|
| 154 |
+
publisher = {Hugging Face Hub},
|
| 155 |
+
url = {https://huggingface.co/dleemiller/EttinX-nli-xxs},
|
|
|
|
|
|
|
| 156 |
}
|
| 157 |
```
|
| 158 |
|
| 159 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
+
## License
|
|
|
|
| 162 |
|
| 163 |
+
This model is licensed under the [MIT License](LICENSE).
|
|
|