Instructions to use tomaarsen/ettin-encoder-400m-multivector-msmarco32k-3e-4-20261014 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use tomaarsen/ettin-encoder-400m-multivector-msmarco32k-3e-4-20261014 with sentence-transformers:
from sentence_transformers import MultiVectorEncoder model = MultiVectorEncoder("tomaarsen/ettin-encoder-400m-multivector-msmarco32k-3e-4-20261014") queries = ["Which planet is known as the Red Planet?"] documents = [ "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.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
ettin-encoder-400m multivector MS MARCO pilot
This is a Multi-Vector Encoder model finetuned from jhu-clsp/ettin-encoder-400m using the sentence-transformers library. It maps inputs to sequences of 128-dimensional token-level vectors and scores them with late interaction (MaxSim), useful for semantic search with late interaction.
Model Details
Model Description
- Model Type: Multi-Vector Encoder
- Base model: jhu-clsp/ettin-encoder-400m
- Maximum Sequence Length: 256 tokens
- Maximum Query Length: 32 tokens
- Maximum Document Length: 256 tokens
- Output Dimensionality: 128 dimensions
- Similarity Function: MaxSim
- Supported Modality: Text
- Language: en
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Multi-Vector Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Multi-Vector Encoders on Hugging Face
Full Model Architecture
MultiVectorEncoder(
(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): Dense({'in_features': 1024, 'out_features': 128, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'module_input_name': 'token_embeddings', 'module_output_name': 'token_embeddings'})
(2): MultiVectorMask({'skiplist_words': [], 'skiplist_tasks': ['document'], 'keep_only_token_ids': None})
(3): Normalize({'module_input_name': 'token_embeddings', 'module_output_name': 'token_embeddings'})
)
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 MultiVectorEncoder
# Download from the 🤗 Hub
model = MultiVectorEncoder("tomaarsen/ettin-encoder-400m-multivector-msmarco32k-3e-4-20261014")
# Run inference: each input becomes a sequence of per-token vectors (variable length).
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[0].shape, document_embeddings[0].shape)
# (9, 128) (27, 128)
# Get the MaxSim similarity scores
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[8.4492, 6.6717, 1.8883]])
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:
CachedMultiVectorMultipleNegativesRankingLosswith these parameters:{ "scale": 1.0, "similarity_fct": "colbert_scores", "mini_batch_size": 8, "mini_batch_num_tokens": null, "score_mini_batch_size": 4, "gather_across_devices": false }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 64num_train_epochs: 1learning_rate: 0.0003warmup_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-400m-multivector-msmarco32k-3e-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 expand
per_device_train_batch_size: 64num_train_epochs: 1max_steps: -1learning_rate: 0.0003lr_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-400m-multivector-msmarco32k-3e-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: Nonemax_length: None
Training Logs
| Epoch | Step | Training Loss |
|---|---|---|
| 0.0020 | 1 | 4.6866 |
| 0.0195 | 10 | 4.3253 |
| 0.0391 | 20 | 2.0995 |
| 0.0586 | 30 | 1.2149 |
| 0.0781 | 40 | 1.0717 |
| 0.0977 | 50 | 1.0634 |
| 0.1172 | 60 | 1.0578 |
| 0.1367 | 70 | 1.0022 |
| 0.1562 | 80 | 1.0158 |
| 0.1758 | 90 | 0.9971 |
| 0.1953 | 100 | 0.9735 |
| 0.2148 | 110 | 0.9376 |
| 0.2344 | 120 | 0.9525 |
| 0.25 | 128 | - |
| 0.2539 | 130 | 0.9436 |
| 0.2734 | 140 | 0.9264 |
| 0.2930 | 150 | 0.9266 |
| 0.3125 | 160 | 0.9070 |
| 0.3320 | 170 | 0.8628 |
| 0.3516 | 180 | 0.9366 |
| 0.3711 | 190 | 0.8510 |
| 0.3906 | 200 | 0.8494 |
| 0.4102 | 210 | 0.8328 |
| 0.4297 | 220 | 0.9037 |
| 0.4492 | 230 | 0.8478 |
| 0.4688 | 240 | 0.8179 |
| 0.4883 | 250 | 0.8407 |
| 0.5 | 256 | - |
| 0.5078 | 260 | 0.8271 |
| 0.5273 | 270 | 0.8230 |
| 0.5469 | 280 | 0.8292 |
| 0.5664 | 290 | 0.8015 |
| 0.5859 | 300 | 0.8105 |
| 0.6055 | 310 | 0.8419 |
| 0.625 | 320 | 0.7743 |
| 0.6445 | 330 | 0.8197 |
| 0.6641 | 340 | 0.8089 |
| 0.6836 | 350 | 0.7460 |
| 0.7031 | 360 | 0.7727 |
| 0.7227 | 370 | 0.7826 |
| 0.7422 | 380 | 0.7800 |
| 0.75 | 384 | - |
| 0.7617 | 390 | 0.7705 |
| 0.7812 | 400 | 0.7520 |
| 0.8008 | 410 | 0.7280 |
| 0.8203 | 420 | 0.7531 |
| 0.8398 | 430 | 0.7278 |
| 0.8594 | 440 | 0.7595 |
| 0.8789 | 450 | 0.7341 |
| 0.8984 | 460 | 0.6958 |
| 0.9180 | 470 | 0.7781 |
| 0.9375 | 480 | 0.7496 |
| 0.9570 | 490 | 0.7166 |
| 0.9766 | 500 | 0.7243 |
| 0.9961 | 510 | 0.7336 |
| 1.0 | 512 | - |
Training Time
- Training: 19.6 minutes
- Evaluation: 19.0 seconds
- Total: 20.0 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
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",
}
CachedMultiVectorMultipleNegativesRankingLoss
@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}
}
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.
- Downloads last month
- 71
Model tree for tomaarsen/ettin-encoder-400m-multivector-msmarco32k-3e-4-20261014
Base model
jhu-clsp/ettin-encoder-400m