ettin-encoder-150m dense MS MARCO pilot
This is a sentence-transformers model finetuned from jhu-clsp/ettin-encoder-150m. It maps inputs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: jhu-clsp/ettin-encoder-150m
- Maximum Sequence Length: 256 tokens
- Maximum Query Length: 32 tokens
- Maximum Document Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Language: en
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'query_length': 32, 'document_length': 256, 'architecture': 'ModernBertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)
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 SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("tomaarsen/ettin-encoder-150m-dense-msmarco32k-1e-4-20261014")
# Run inference
queries = [
'goldman sachs contact number',
]
documents = [
'The customer support phone number of Goldman Sachs Contact is 1-212-902-0300 (Click phone number to call).',
'Goldman Sachs Bank USA is an FDIC insured institution located in New York, NY. It was founded in 1990 and has approximately $122.68 billion in assets. Customers can open an account via one of its 5 branches.',
'The Director of Supply Chain will be responsible for ensuring supply and availability of finished goods and services to optimize customer services at the lowest... 5 days ago - save job - more... -',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.6813, 0.4921, 0.0596]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 32,768 training samples
- Columns:
query,positive, andnegative - Approximate statistics based on the first 100 samples:
query positive negative type string string string modality text text text details - min: 5 tokens
- mean: 9.82 tokens
- max: 23 tokens
- min: 29 tokens
- mean: 82.93 tokens
- max: 189 tokens
- min: 35 tokens
- mean: 80.9 tokens
- max: 171 tokens
- Samples:
query positive negative what clothing do people wear in denmark guysWhile 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.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.average salary healthcare administrationHealthcare 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.what unique characteristics does bacillus megaterium haveRare 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 âº. 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.Bacillus. Bacillus is a specific genus of rod-shaped bacteria that are capable of forming spores. They are sporulating, aerobic and ubiquitous in nature. Bacillus is a fairly large group with many members, including Bacillus cereus, Bacillus clausii and Bacillus halodenitrificans.Bacillus spores, also called endospores, are resistant to harsh chemical and physical conditions. This makes the bacteria able to withstand disinfectants, radiation, desiccation and heat.acillus is a fairly large group with many members, including Bacillus cereus, Bacillus clausii and Bacillus halodenitrificans. Bacillus spores, also called endospores, are resistant to harsh chemical and physical conditions. This makes the bacteria able to withstand disinfectants, radiation, desiccation and heat. - Loss:
CachedMultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "mini_batch_size": 16, "mini_batch_num_tokens": null, "gather_across_devices": false, "directions": [ "query_to_doc" ], "partition_mode": "joint", "hardness_mode": null, "hardness_strength": 0.0 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 128num_train_epochs: 1learning_rate: 0.0001warmup_steps: 0.05optim: adamw_torchweight_decay: 0.01bf16: Truetf32: Truelogging_nan_inf_filter: Falsedisable_tqdm: Trueper_device_eval_batch_size: 32push_to_hub: Truehub_private_repo: Falsehub_model_id: tomaarsen/ettin-encoder-150m-dense-msmarco32k-1e-4-20261014load_best_model_at_end: Trueseed: 12data_seed: 12dataloader_num_workers: 2batch_sampler: no_duplicatesrouter_mapping: {'query': 'query', 'positive': 'document', 'negative': 'document'}
All Hyperparameters
Click to expandper_device_train_batch_size: 128num_train_epochs: 1max_steps: -1learning_rate: 0.0001lr_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: 1average_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-150m-dense-msmarco32k-1e-4-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: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {'query': 'query', 'positive': 'document', 'negative': 'document'}learning_rate_mapping: {}warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss |
|---|---|---|
| 0.0039 | 1 | 5.2139 |
| 0.0391 | 10 | 4.5609 |
| 0.0781 | 20 | 1.9865 |
| 0.1172 | 30 | 1.0028 |
| 0.1562 | 40 | 0.6744 |
| 0.1953 | 50 | 0.5692 |
| 0.2344 | 60 | 0.5308 |
| 0.25 | 64 | - |
| 0.2734 | 70 | 0.4890 |
| 0.3125 | 80 | 0.4778 |
| 0.3516 | 90 | 0.4614 |
| 0.3906 | 100 | 0.4611 |
| 0.4297 | 110 | 0.4828 |
| 0.4688 | 120 | 0.4348 |
| 0.5 | 128 | - |
| 0.5078 | 130 | 0.4078 |
| 0.5469 | 140 | 0.4662 |
| 0.5859 | 150 | 0.4327 |
| 0.625 | 160 | 0.4022 |
| 0.6641 | 170 | 0.3841 |
| 0.7031 | 180 | 0.3911 |
| 0.7422 | 190 | 0.3923 |
| 0.75 | 192 | - |
| 0.7812 | 200 | 0.3867 |
| 0.8203 | 210 | 0.4096 |
| 0.8594 | 220 | 0.3592 |
| 0.8984 | 230 | 0.3734 |
| 0.9375 | 240 | 0.3812 |
| 0.9766 | 250 | 0.3608 |
| 1.0 | 256 | - |
Training Time
- Training: 7.4 minutes
- Evaluation: 7.1 seconds
- Total: 7.5 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 Embedding Models with Sentence Transformers: the end-to-end guide for training or finetuning Sentence Transformer models.
- Introduction to Matryoshka Embedding Models: variable-size embeddings that can be truncated with minimal quality loss.
- Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval: post-training compression of embedding vectors.
- Multimodal Embedding & Reranker Models with Sentence Transformers: use text, image, audio, and video models through the same API.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers: train multimodal embedding models, with a Visual Document Retrieval walkthrough.
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",
}
CachedMultipleNegativesRankingLoss
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
MultipleNegativesRankingLoss
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
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.