ettin-encoder-400m reranker MS MARCO pilot
This is a Cross Encoder model finetuned from jhu-clsp/ettin-encoder-400m using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
Model Details
Model Description
- Model Type: Cross Encoder
- Base model: jhu-clsp/ettin-encoder-400m
- Maximum Sequence Length: 291 tokens
- Number of Output Labels: 1 label
- Supported Modality: Text
- Language: en
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
Full Model Architecture
CrossEncoder(
(0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'ModernBertForSequenceClassification'})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("tomaarsen/ettin-encoder-400m-reranker-msmarco32k-3e-5-20261014")
# Get scores for pairs of inputs
pairs = [
['what clothing do people wear in denmark guys', 'While suits and other forms of Western fashion are ubiquitous in Japan, most people also wear some of the more traditional styles of Japanese clothing. For example, you often â\x80¦ will see people wearing traditional Japanese clothing at weddings or funerals, graduations and even for the summer fireworks festivals--hanabi. You can learn about some of the different styles of Japanese clothing and--if you dare--try some of them yourself.'],
['what clothing do people wear in denmark guys', 'Yet even the Democratic presidential candidates, who say they love or want to learn from those countries, donâ\x80\x99t seem know how they actually work. Why Weâ\x80\x99re Not Denmark Proof that they do work is delivered every year in data-rich evaluations by the United Nations and other international bodies.'],
['average salary healthcare administration', 'Healthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.ealthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.'],
['average salary healthcare administration', 'The five states with the highest average annual salaries for health care administrators, according to May 2011 data from the BLS, are: Massachusetts, $112,690; Rhode Island, $112,260; New York, $111,270; New Jersey, $110,100; and Washington, $108,620.'],
['what unique characteristics does bacillus megaterium have', 'Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture.Bacterium is arranged into the streptobacillus form.. Get help from a doctor now â\x80º. Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture. Bacterium is arranged into the streptobacillus form.'],
]
scores = model.predict(pairs)
print(scores)
# [-4.0938 -4.4688 4.0312 -0.6758 1.0859]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'what clothing do people wear in denmark guys',
[
'While suits and other forms of Western fashion are ubiquitous in Japan, most people also wear some of the more traditional styles of Japanese clothing. For example, you often â\x80¦ will see people wearing traditional Japanese clothing at weddings or funerals, graduations and even for the summer fireworks festivals--hanabi. You can learn about some of the different styles of Japanese clothing and--if you dare--try some of them yourself.',
'Yet even the Democratic presidential candidates, who say they love or want to learn from those countries, donâ\x80\x99t seem know how they actually work. Why Weâ\x80\x99re Not Denmark Proof that they do work is delivered every year in data-rich evaluations by the United Nations and other international bodies.',
'Healthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.ealthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.',
'The five states with the highest average annual salaries for health care administrators, according to May 2011 data from the BLS, are: Massachusetts, $112,690; Rhode Island, $112,260; New York, $111,270; New Jersey, $110,100; and Washington, $108,620.',
'Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture.Bacterium is arranged into the streptobacillus form.. Get help from a doctor now â\x80º. Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture. Bacterium is arranged into the streptobacillus form.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
Training Details
Training Dataset
Unnamed Dataset
- Size: 65,536 training samples
- Columns: query, passage, and label
- Approximate statistics based on the first 100 samples:
query passage label type string string float modality text text details min: 6 tokensmean: 9.33 tokensmax: 17 tokens min: 32 tokensmean: 82.09 tokensmax: 189 tokens min: 0.0mean: 0.5max: 1.0 - Samples:
query passage label what clothing do people wear in denmark guys While suits and other forms of Western fashion are ubiquitous in Japan, most people also wear some of the more traditional styles of Japanese clothing. For example, you often ⦠will see people wearing traditional Japanese clothing at weddings or funerals, graduations and even for the summer fireworks festivals--hanabi. You can learn about some of the different styles of Japanese clothing and--if you dare--try some of them yourself. 1.0 what clothing do people wear in denmark guys Yet even the Democratic presidential candidates, who say they love or want to learn from those countries, donât seem know how they actually work. Why Weâre Not Denmark Proof that they do work is delivered every year in data-rich evaluations by the United Nations and other international bodies. 0.0 average salary healthcare administration Healthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.ealthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job. 1.0 - Loss: BinaryCrossEntropyLoss with these parameters:
{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": 1.0 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 32num_train_epochs: 1learning_rate: 3e-05warmup_steps: 0.05optim: adamw_torchweight_decay: 0.01gradient_accumulation_steps: 4bf16: Truetf32: Truelogging_nan_inf_filter: Falsedisable_tqdm: Trueper_device_eval_batch_size: 32push_to_hub: Truehub_private_repo: Falsehub_model_id: tomaarsen/ettin-encoder-400m-reranker-msmarco32k-3e-5-20261014load_best_model_at_end: Trueseed: 12data_seed: 12dataloader_num_workers: 2
All Hyperparameters
per_device_train_batch_size: 32num_train_epochs: 1max_steps: -1learning_rate: 3e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.05optim: adamw_torchoptim_args: Noneweight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 4average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Truegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Falseinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Trueproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 32prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Truehub_private_repo: Falsehub_model_id: tomaarsen/ettin-encoder-400m-reranker-msmarco32k-3e-5-20261014hub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 12data_seed: 12use_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 2dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss |
|---|---|---|
| 0.0020 | 1 | 0.9154 |
| 0.0195 | 10 | 0.8077 |
| 0.0391 | 20 | 0.7115 |
| 0.0586 | 30 | 0.6801 |
| 0.0781 | 40 | 0.6535 |
| 0.0977 | 50 | 0.6520 |
| 0.1172 | 60 | 0.5374 |
| 0.1367 | 70 | 0.5385 |
| 0.1562 | 80 | 0.4768 |
| 0.1758 | 90 | 0.4611 |
| 0.1953 | 100 | 0.4503 |
| 0.2148 | 110 | 0.3835 |
| 0.2344 | 120 | 0.4087 |
| 0.25 | 128 | - |
| 0.2539 | 130 | 0.3979 |
| 0.2734 | 140 | 0.3721 |
| 0.2930 | 150 | 0.4135 |
| 0.3125 | 160 | 0.3794 |
| 0.3320 | 170 | 0.3623 |
| 0.3516 | 180 | 0.3915 |
| 0.3711 | 190 | 0.3511 |
| 0.3906 | 200 | 0.3620 |
| 0.4102 | 210 | 0.3351 |
| 0.4297 | 220 | 0.3740 |
| 0.4492 | 230 | 0.3676 |
| 0.4688 | 240 | 0.3462 |
| 0.4883 | 250 | 0.3504 |
| 0.5 | 256 | - |
| 0.5078 | 260 | 0.3513 |
| 0.5273 | 270 | 0.3512 |
| 0.5469 | 280 | 0.3826 |
| 0.5664 | 290 | 0.3512 |
| 0.5859 | 300 | 0.3631 |
| 0.6055 | 310 | 0.3657 |
| 0.625 | 320 | 0.3467 |
| 0.6445 | 330 | 0.3582 |
| 0.6641 | 340 | 0.3270 |
| 0.6836 | 350 | 0.3226 |
| 0.7031 | 360 | 0.3820 |
| 0.7227 | 370 | 0.3565 |
| 0.7422 | 380 | 0.3327 |
| 0.75 | 384 | - |
| 0.7617 | 390 | 0.3221 |
| 0.7812 | 400 | 0.3451 |
| 0.8008 | 410 | 0.3287 |
| 0.8203 | 420 | 0.3185 |
| 0.8398 | 430 | 0.3413 |
| 0.8594 | 440 | 0.3247 |
| 0.8789 | 450 | 0.3414 |
| 0.8984 | 460 | 0.3291 |
| 0.9180 | 470 | 0.3251 |
| 0.9375 | 480 | 0.3036 |
| 0.9570 | 490 | 0.3160 |
| 0.9766 | 500 | 0.3251 |
| 0.9961 | 510 | 0.3362 |
| 1.0 | 512 | - |
Training Time
- Training: 5.2 minutes
- Evaluation: 1.4 minutes
- Total: 6.6 minutes
Framework Versions
- Python: 3.12.12
- Sentence Transformers: 6.2.0.dev0
- Transformers: 5.16.1
- PyTorch: 2.10.0+cu128
- Accelerate: 1.15.0
- Datasets: 5.1.0
- Tokenizers: 0.23.3
Additional Resources
- Training and Finetuning Reranker Models with Sentence Transformers: the end-to-end guide for training or finetuning Cross Encoder (reranker) models.
- Multimodal Embedding & Reranker Models with Sentence Transformers: use text, image, audio, and video reranker models through the same API.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers: training multimodal Cross Encoders.
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
Controlled backbone comparison
Part of the encoder comparison. One epoch maximum on 32,768 MS MARCO triplets, seed 12. The best validation checkpoint was recovered from the repository history after a publication error. No training was repeated. See experiment.json for its original revision and validation score. Learning-rate selection uses validation only. Test data does not select checkpoints.
Dense and multi-vector use query length 32 and passage length 256 including special tokens. Rerankers use 32 query content tokens, 256 passage content tokens and a combined cap of 291. See the comparison scripts for matching input clipping. These are small-data research models.