metadata
language:
- en
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:9960000
- loss:BinaryCrossEntropyLoss
base_model: jhu-clsp/ettin-encoder-1b
datasets:
- sentence-transformers/msmarco
pipeline_tag: text-ranking
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
model-index:
- name: CrossEncoder based on jhu-clsp/ettin-encoder-1b
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoMSMARCO R100
type: NanoMSMARCO_R100
metrics:
- type: map
value: 0.6418
name: Map
- type: mrr@10
value: 0.6372
name: Mrr@10
- type: ndcg@10
value: 0.7051
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoNFCorpus R100
type: NanoNFCorpus_R100
metrics:
- type: map
value: 0.3816
name: Map
- type: mrr@10
value: 0.5641
name: Mrr@10
- type: ndcg@10
value: 0.4148
name: Ndcg@10
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: NanoNQ R100
type: NanoNQ_R100
metrics:
- type: map
value: 0.724
name: Map
- type: mrr@10
value: 0.7315
name: Mrr@10
- type: ndcg@10
value: 0.7717
name: Ndcg@10
- task:
type: cross-encoder-nano-beir
name: Cross Encoder Nano BEIR
dataset:
name: NanoBEIR R100 mean
type: NanoBEIR_R100_mean
metrics:
- type: map
value: 0.5824
name: Map
- type: mrr@10
value: 0.6443
name: Mrr@10
- type: ndcg@10
value: 0.6305
name: Ndcg@10
CrossEncoder based on jhu-clsp/ettin-encoder-1b
This is a Cross Encoder model finetuned from jhu-clsp/ettin-encoder-1b on the msmarco dataset 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-1b
- Maximum Sequence Length: 7999 tokens
- Number of Output Labels: 1 label
- Training Dataset:
- Language: en
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
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("kdhole/reranker-ettin-encoder-1b-msmarco-bce-10m")
# Get scores for pairs of texts
pairs = [
['what is the zip code for hamilton nj', 'Stats and Demographics for the 21227 ZIP Code. ZIP code 21227 is located in Maryland and covers a slightly less than average land area compared to other ZIP codes in the United States. It also has a slightly larger than average population density.n addition to the primary city for a ZIP code, USPS also publishes a list of other acceptable cities that can be used with ZIP code 21227. However, if you are mailing something to ZIP code 21227, you should not use any of the cities listed as unacceptable.'],
['which cooking oil is healthy', "Photo Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease.All oils are pure fat, however, which means they're high in calories.hoto Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease."],
['what canadian cities have the highest crime rates?', 'Saginaw, TX Tarrant County crime report and crime data. Compare the rate to other cities, state average, and national average.'],
['how to delete bcc', 'How to delete the CC/BCC rule. 1 Open Auto BCC dialog box. 2 Select the rule you need in the list and click the Delete button on the top toolbar or the Delete key on your keyboard. 3 Confirm deletion and click Ok to save changes.'],
['what county is waukegan illinois in?', 'Downtown Waukegan is the urban center of Lake County. Many restaurants, bars, shops, the Waukegan Public Library, the College of Lake County, the Lake County Courthouse (including the William D. Block Memorial Law Library), and much more call Downtown Waukegan their home.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'what is the zip code for hamilton nj',
[
'Stats and Demographics for the 21227 ZIP Code. ZIP code 21227 is located in Maryland and covers a slightly less than average land area compared to other ZIP codes in the United States. It also has a slightly larger than average population density.n addition to the primary city for a ZIP code, USPS also publishes a list of other acceptable cities that can be used with ZIP code 21227. However, if you are mailing something to ZIP code 21227, you should not use any of the cities listed as unacceptable.',
"Photo Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease.All oils are pure fat, however, which means they're high in calories.hoto Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease.",
'Saginaw, TX Tarrant County crime report and crime data. Compare the rate to other cities, state average, and national average.',
'How to delete the CC/BCC rule. 1 Open Auto BCC dialog box. 2 Select the rule you need in the list and click the Delete button on the top toolbar or the Delete key on your keyboard. 3 Confirm deletion and click Ok to save changes.',
'Downtown Waukegan is the urban center of Lake County. Many restaurants, bars, shops, the Waukegan Public Library, the College of Lake County, the Lake County Courthouse (including the William D. Block Memorial Law Library), and much more call Downtown Waukegan their home.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
Evaluation
Metrics
Cross Encoder Reranking
- Datasets:
NanoMSMARCO_R100
,NanoNFCorpus_R100
andNanoNQ_R100
- Evaluated with
CrossEncoderRerankingEvaluator
with these parameters:{ "at_k": 10, "always_rerank_positives": true }
Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
---|---|---|---|
map | 0.6418 (+0.1522) | 0.3816 (+0.1206) | 0.7240 (+0.3044) |
mrr@10 | 0.6372 (+0.1597) | 0.5641 (+0.0642) | 0.7315 (+0.3048) |
ndcg@10 | 0.7051 (+0.1647) | 0.4148 (+0.0898) | 0.7717 (+0.2710) |
Cross Encoder Nano BEIR
- Dataset:
NanoBEIR_R100_mean
- Evaluated with
CrossEncoderNanoBEIREvaluator
with these parameters:{ "dataset_names": [ "msmarco", "nfcorpus", "nq" ], "rerank_k": 100, "at_k": 10, "always_rerank_positives": true }
Metric | Value |
---|---|
map | 0.5824 (+0.1924) |
mrr@10 | 0.6443 (+0.1763) |
ndcg@10 | 0.6305 (+0.1752) |
Training Details
Training Dataset
msmarco
- Dataset: msmarco at 9e329ed
- Size: 9,960,000 training samples
- Columns:
query
,passage
, andscore
- Approximate statistics based on the first 1000 samples:
query passage score type string string float details - min: 10 characters
- mean: 33.92 characters
- max: 156 characters
- min: 80 characters
- mean: 344.88 characters
- max: 1061 characters
- min: 0.0
- mean: 0.48
- max: 1.0
- Samples:
query passage score what is liquid resources
Renewable Resources. Renewable resources are resources that are replenished by the environment over relatively short periods of time. This type of resource is much more desirable to use because often a resource renews so fast that it will have regenerated by the time you've used it up.n contrast to renewable resources, non-renewable resources are resources that are not easily replenished by the environment. Let's think about this in terms of that ice cube maker again.
0.0
halo laser treatment
Laser surgery (photocoagulation) With laser surgery, your ophthalmologist uses a laser to make small burns around the retinal tear. The scarring that results seals the retina to the underlying tissue, helping to prevent a retinal detachment. Freezing treatment (cryopexy)
0.0
three motorcycle car
Can-Am Spyder roadster: three wheeled motorcycle. February 20, 2007 BRP has unveiled its first on-road vehicle, the 2008 Can-Am Spyder roadster. This three-wheel vehicle, with two wheels in the front and one in the rear, offers a completely new and stunning look. Powered by a proven 990cc V Twin engine designed and manufactured by BRP-Rotax, Spyder roadster, with its unique Y-architecture, can be described as part motorcycle and part convertible sports car.
1.0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Evaluation Dataset
msmarco
- Dataset: msmarco at 9e329ed
- Size: 40,000 evaluation samples
- Columns:
query
,passage
, andscore
- Approximate statistics based on the first 1000 samples:
query passage score type string string float details - min: 12 characters
- mean: 34.65 characters
- max: 132 characters
- min: 65 characters
- mean: 345.56 characters
- max: 874 characters
- min: 0.0
- mean: 0.49
- max: 1.0
- Samples:
query passage score what is the zip code for hamilton nj
Stats and Demographics for the 21227 ZIP Code. ZIP code 21227 is located in Maryland and covers a slightly less than average land area compared to other ZIP codes in the United States. It also has a slightly larger than average population density.n addition to the primary city for a ZIP code, USPS also publishes a list of other acceptable cities that can be used with ZIP code 21227. However, if you are mailing something to ZIP code 21227, you should not use any of the cities listed as unacceptable.
0.0
which cooking oil is healthy
Photo Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease.All oils are pure fat, however, which means they're high in calories.hoto Credit bgfoto126/iStock/Getty Images. Olive oil may get all the press, but safflower oil is emerging as a health superstar in its own right. Made from the seeds of safflowers, which are similar to sunflowers, this oil contains healthy fats and may even help prevent cardiovascular disease.
0.0
what canadian cities have the highest crime rates?
Saginaw, TX Tarrant County crime report and crime data. Compare the rate to other cities, state average, and national average.
0.0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 64per_device_eval_batch_size
: 64learning_rate
: 2e-05num_train_epochs
: 1warmup_ratio
: 0.1seed
: 12bf16
: Truedataloader_num_workers
: 4load_best_model_at_end
: True
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 64per_device_eval_batch_size
: 64per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 2e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 1max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.1warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 12data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Truefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 4dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Trueignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config
: Nonedeepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torch_fusedoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Nonehub_always_push
: Falsehub_revision
: Nonegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseliger_kernel_config
: Noneeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportionalrouter_mapping
: {}learning_rate_mapping
: {}
Training Logs
Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
---|---|---|---|---|---|---|---|
-1 | -1 | - | - | 0.0000 (-0.5404) | 0.2648 (-0.0602) | 0.0388 (-0.4618) | 0.1012 (-0.3541) |
0.0000 | 1 | 0.8074 | - | - | - | - | - |
0.0643 | 10000 | 0.1734 | 0.1322 | 0.6852 (+0.1448) | 0.3939 (+0.0689) | 0.7987 (+0.2980) | 0.6259 (+0.1706) |
0.1285 | 20000 | 0.1273 | 0.1189 | 0.7051 (+0.1647) | 0.4148 (+0.0898) | 0.7717 (+0.2710) | 0.6305 (+0.1752) |
0.1928 | 30000 | 0.1104 | 0.1027 | 0.7116 (+0.1712) | 0.4199 (+0.0948) | 0.7473 (+0.2467) | 0.6263 (+0.1709) |
0.2570 | 40000 | 0.0958 | 0.0929 | 0.6721 (+0.1317) | 0.4184 (+0.0933) | 0.7930 (+0.2923) | 0.6278 (+0.1724) |
0.3213 | 50000 | 0.0847 | 0.0773 | 0.6695 (+0.1291) | 0.3852 (+0.0602) | 0.7673 (+0.2666) | 0.6074 (+0.1520) |
0.3855 | 60000 | 0.0746 | 0.0696 | 0.7101 (+0.1697) | 0.4118 (+0.0868) | 0.7599 (+0.2592) | 0.6273 (+0.1719) |
0.4498 | 70000 | 0.0672 | 0.0618 | 0.6663 (+0.1259) | 0.3761 (+0.0511) | 0.7701 (+0.2694) | 0.6042 (+0.1488) |
0.5141 | 80000 | 0.0603 | 0.0552 | 0.6773 (+0.1369) | 0.3854 (+0.0603) | 0.7780 (+0.2774) | 0.6136 (+0.1582) |
0.5783 | 90000 | 0.0544 | 0.0527 | 0.7135 (+0.1731) | 0.3787 (+0.0537) | 0.7756 (+0.2749) | 0.6226 (+0.1672) |
0.6426 | 100000 | 0.0487 | 0.0459 | 0.6979 (+0.1575) | 0.3926 (+0.0676) | 0.7583 (+0.2576) | 0.6163 (+0.1609) |
0.7068 | 110000 | 0.045 | 0.0405 | 0.7091 (+0.1687) | 0.3653 (+0.0403) | 0.7517 (+0.2511) | 0.6087 (+0.1533) |
0.7711 | 120000 | 0.0403 | 0.0386 | 0.6964 (+0.1560) | 0.3840 (+0.0590) | 0.7767 (+0.2760) | 0.6191 (+0.1637) |
0.8353 | 130000 | 0.036 | 0.0322 | 0.7017 (+0.1613) | 0.3732 (+0.0482) | 0.7575 (+0.2568) | 0.6108 (+0.1554) |
0.8996 | 140000 | 0.0325 | 0.0283 | 0.7006 (+0.1602) | 0.3814 (+0.0563) | 0.7595 (+0.2588) | 0.6138 (+0.1585) |
0.9639 | 150000 | 0.0298 | 0.0255 | 0.6920 (+0.1516) | 0.3719 (+0.0469) | 0.7797 (+0.2791) | 0.6146 (+0.1592) |
-1 | -1 | - | - | 0.7051 (+0.1647) | 0.4148 (+0.0898) | 0.7717 (+0.2710) | 0.6305 (+0.1752) |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.9.18
- Sentence Transformers: 5.1.1
- Transformers: 4.56.2
- PyTorch: 2.8.0+cu128
- Accelerate: 1.10.1
- Datasets: 4.1.1
- Tokenizers: 0.22.1
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",
}