/ Модель

Характеристики

Контекст
8 192 токена
Параметры
395 млн
Архитектура
modernbert · dense
Базовая модель
ModernBERT-large
Библиотека
sentence-transformers
Опубликована
23 дек 2024

ModernBERT-large-msmarco

ЭмбеддингиТекст → embedding10 профессий

Англоязычная Sentence Transformers модель создаёт 1024-мерные эмбеддинги для семантического поиска и сравнения текстов.

501скачиваний за 30 дней4лайкавеса обновлены26 янв 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

joe32140/ModernBERT-large-msmarco — англоязычная модель Sentence Transformers на основе ModernBERT-large от Answer.AI, дообученная на датасете MS MARCO. Она преобразует предложения и абзацы в плотные векторы размерностью 1024 и использует косинусное сходство для сравнения. Модель подходит для семантического поиска, ранжирования похожих текстов, поиска перефразирований, кластеризации и классификации текста.

Модель содержит около 394,7 млн параметров, использует mean pooling и принимает последовательности длиной до 8192 токенов. В README приведены результаты на задачах поиска и сравнения текстов; автор сообщает об улучшении относительно опубликованных результатов для ряда наборов данных. Доступны веса safetensors и формат ONNX. Лицензия в предоставленных данных не указана.

Сценарии применения

  • семантический поиск по коллекции англоязычных документов
  • сравнение сходства предложений и абзацев
  • поиск перефразирований
  • кластеризация текстов по смыслу
  • классификация текста на основе эмбеддингов

Ограничения

Модель обучена на англоязычных данных и предназначена для текстового поиска и сравнения; пригодность для других языков и задач требует отдельной проверки. Лицензия не указана в предоставленных материалах.

Для каких профессий подходит10

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

SentenceTransformer based on answerdotai/ModernBERT-large

This is a sentence-transformers model finetuned from answerdotai/ModernBERT-large on the msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1 dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

I finetune ModernBERT-base using script from offical repo train_st.py on a RTX 4090 GPU with the only change of setting mini-batch size of CachedMultipleNegativesRankingLoss to 64. Training for 1 epoch takes less than 2 hours.

The mini-batch size of GradCache should not change model performnace, but the finetuned model performs better than that recorded in the paper.

Training logs can be found here: https://api.wandb.ai/links/joe32140/ekuauaao.

Model Details

Model Description

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

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("joe32140/ModernBERT-large-msmarco")
# Run inference
sentences = [
    'what county is hayden in',
    "Hayden is a city in Kootenai County, Idaho, United States. Located in the northern portion of the state, just north of Coeur d'Alene, its population was 13,294 at the 2010 census.",
    "According to the United States Census Bureau, the city has a total area of 9.61 square miles (24.89 km2), of which 9.60 square miles (24.86 km2) is land and 0.01 square miles (0.03 km2) is water. It lies at the southwestern end of Hayden Lake, and the elevation of the city is 2,287 feet (697 m) above sea level. Hayden is located on U.S. Route 95 at the junction of Route 41. It is also four miles (6 km) north of Interstate 90 and Coeur d'Alene. The Coeur d'Alene airport is northwest of Hayden.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Evaluation

Metrics

Triplet

MetricValue
cosine_accuracy0.994

Retrieval tasks compared to original numbers in the paper

ModernBERT-baseModernBERT-base (ours)ModernBERT-largeModernBERT-large (ours)
NFCorpus23.726.6626.228.44
SciFact57.061.6460.463.66
TREC-Covid72.171.4374.177.49
FiQA28.830.7333.134.35
ArguAna35.746.3838.247.79
SciDocs12.513.6713.815.78
FEVER59.965.762.768.2
Climate-FEVER23.622.620.522.9
MLDR - OOD27.430.5834.338.99

Training Details

Training Dataset

msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1

  • Dataset: msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1 at 84ed2d3
  • Size: 11,662,655 training samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    querypositivenegative
    typestringstringstring
    detailsmin: 4 tokensmean: 9.26 tokensmax: 34 tokensmin: 17 tokensmean: 79.14 tokensmax: 222 tokensmin: 24 tokensmean: 80.09 tokensmax: 436 tokens
  • Samples:
    querypositivenegative
    what is the meaning of menu planningMenu planning is the selection of a menu for an event. Such as picking out the dinner for your wedding or even a meal at a Birthday Party. Menu planning is when you are preparing a calendar of meals and you have to sit down and decide what meat and veggies you want to serve on each certain day.Menu Costs. In economics, a menu cost is the cost to a firm resulting from changing its prices. The name stems from the cost of restaurants literally printing new menus, but economists use it to refer to the costs of changing nominal prices in general.
    how old is brett butlerBrett Butler is 59 years old. To be more precise (and nerdy), the current age as of right now is 21564 days or (even more geeky) 517536 hours. That's a lot of hours!Passed in: St. John's, Newfoundland and Labrador, Canada. Passed on: 16/07/2016. Published in the St. John's Telegram. Passed away suddenly at the Health Sciences Centre surrounded by his loving family, on July 16, 2016 Robert (Bobby) Joseph Butler, age 52 years. Predeceased by his special aunt Geri Murrin and uncle Mike Mchugh; grandparents Joe and Margaret Murrin and Jack and Theresa Butler.
    when was the last navajo treaty sign?In Executive Session, Senate of the United States, July 25, 1868. Resolved, (two-thirds of the senators present concurring,) That the Senate advise and consent to the ratification of the treaty between the United States and the Navajo Indians, concluded at Fort Sumner, New Mexico, on the first day of June, 1868.Share Treaty of Greenville. The Treaty of Greenville was signed August 3, 1795, between the United States, represented by Gen. Anthony Wayne, and chiefs of the Indian tribes located in the Northwest Territory, including the Wyandots, Delawares, Shawnees, Ottawas, Miamis, and others.
  • Loss: CachedMultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1

  • Dataset: msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1 at 84ed2d3
  • Size: 11,662,655 evaluation samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    querypositivenegative
    typestringstringstring
    detailsmin: 4 tokensmean: 9.2 tokensmax: 27 tokensmin: 21 tokensmean: 80.44 tokensmax: 241 tokensmin: 23 tokensmean: 80.38 tokensmax: 239 tokens
  • Samples:
    querypositivenegative
    what county is holly springs nc inHolly Springs, North Carolina. Holly Springs is a town in Wake County, North Carolina, United States. As of the 2010 census, the town population was 24,661, over 2½ times its population in 2000. Contents.The Mt. Holly Springs Park & Resort. One of the numerous trolley routes that carried people around the county at the turn of the century was the Carlisle & Mt. Holly Railway Company. The “Holly Trolley” as it came to be known was put into service by Patricio Russo and made its first run on May 14, 1901.
    how long does nyquil stay in your systemIn order to understand exactly how long Nyquil lasts, it is absolutely vital to learn about the various ingredients in the drug. One of the ingredients found in Nyquil is Doxylamine, which is an antihistamine. This specific medication has a biological half-life or 6 to 12 hours. With this in mind, it is possible for the drug to remain in the system for a period of 12 to 24 hours. It should be known that the specifics will depend on a wide variety of different factors, including your age and metabolism.I confirmed that NyQuil is about 10% alcohol, a higher content than most domestic beers. When I asked about the relatively high proof, I was told that the alcohol dilutes the active ingredients. The alcohol free version is there for customers with addiction issues.. also found that in that version there is twice the amount of DXM. When I asked if I could speak to a chemist or scientist, I was told they didn't have anyone who fit that description there. It’s been eight years since I kicked NyQuil. I've been sober from alcohol for four years.
    what are mineral water1 Mineral water – water from a mineral spring that contains various minerals, such as salts and sulfur compounds. 2 It comes from a source tapped at one or more bore holes or spring, and originates from a geologically and physically protected underground water source. Mineral water – water from a mineral spring that contains various minerals, such as salts and sulfur compounds. 2 It comes from a source tapped at one or more bore holes or spring, and originates from a geologically and physically protected underground water source.Minerals for Your Body. Drinking mineral water is beneficial to health and well-being. But it is not only the amount of water you drink that is important-what the water contains is even more essential.inerals for Your Body. Drinking mineral water is beneficial to health and well-being. But it is not only the amount of water you drink that is important-what the water contains is even more essential.
  • Loss: CachedMultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 512
  • per_device_eval_batch_size: 512
  • learning_rate: 0.0001
  • num_train_epochs: 1
  • warmup_ratio: 0.05
  • bf16: True
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 512
  • per_device_eval_batch_size: 512
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 0.0001
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.05
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

EpochStepTraining Lossmsmarco-co-condenser-dev_cosine_accuracy
00-0.599
0.0041106.0983-
0.0082204.4588-
0.0123302.2492-
0.0164400.9969-
0.0205500.5272-
0.0246600.3982-
0.0287700.3335-
0.0328800.3024-
0.0369900.2932-
0.04101000.2695-
0.04501100.2574-
0.04911200.2447-
0.05321300.2491-
0.05731400.2318-
0.06141500.2292-
0.06551600.2213-
0.06961700.218-
0.07371800.2234-
0.07781900.2066-
0.08192000.1987-
0.08602100.1978-
0.09012200.2024-
0.09422300.1959-
0.09832400.1804-
0.10242500.1868-
0.10652600.1983-
0.11062700.1641-
0.11472800.1713-
0.11882900.1726-
0.12293000.17-
0.12693100.1783-
0.13103200.1742-
0.13513300.1654-
0.13923400.1663-
0.14333500.1616-
0.14743600.157-
0.15153700.1574-
0.15563800.1529-
0.15973900.1561-
0.16384000.1435-
0.16794100.1555-
0.17204200.1455-
0.17614300.1416-
0.18024400.1407-
0.18434500.138-
0.18844600.1387-
0.19254700.1499-
0.19664800.1372-
0.20074900.1308-
0.20485000.1367-
0.20885100.1324-
0.21295200.1317-
0.21705300.1263-
0.22115400.1209-
0.22525500.1201-
0.22935600.1213-
0.23345700.1329-
0.23755800.1207-
0.24165900.1211-
0.24576000.1164-
0.24986100.1292-
0.25396200.1223-
0.25806300.1237-
0.26216400.1088-
0.26626500.1196-
0.27036600.1209-
0.27446700.1155-
0.27856800.1101-
0.28266900.1127-
0.28677000.1082-
0.29077100.1083-
0.29487200.1132-
0.29897300.1121-
0.30307400.1146-
0.30717500.1088-
0.31127600.0982-
0.31537700.0952-
0.31947800.1034-
0.32357900.1017-
0.32768000.1016-
0.33178100.1054-
0.33588200.1003-
0.33998300.0932-
0.34408400.0997-
0.34818500.0921-
0.35228600.0958-
0.35638700.0973-
0.36048800.0931-
0.36458900.0964-
0.36869000.0982-
0.37269100.0908-
0.37679200.0917-
0.38089300.0857-
0.38499400.0925-
0.38909500.0915-
0.39319600.089-
0.39729700.0876-
0.40139800.0959-
0.40549900.0879-
0.409510000.0883-
0.413610100.0824-
0.417710200.0897-
0.421810300.0954-
0.425910400.0815-
0.430010500.0806-
0.434110600.0918-
0.438210700.0851-
0.442310800.0888-
0.446410900.0863-
0.450511000.0856-
0.454511100.0809-
0.458611200.085-
0.462711300.0756-
0.466811400.0836-
0.470911500.0815-
0.475011600.084-
0.479111700.0751-
0.483211800.0794-
0.487311900.0844-
0.491412000.0835-
0.495512100.0798-
0.499612200.0825-
0.503712300.0796-
0.507812400.0758-
0.511912500.0765-
0.516012600.0806-
0.520112700.072-
0.524212800.0775-
0.528312900.076-
0.532413000.0767-
0.536413100.0782-
0.540513200.07-
0.544613300.0724-
0.548713400.0703-
0.552813500.072-
0.556913600.0763-
0.561013700.0703-
0.565113800.0688-
0.569213900.0703-
0.573314000.0659-
0.577414100.0688-
0.581514200.0713-
0.585614300.0722-
0.589714400.0682-
0.593814500.07-
0.597914600.0649-
0.602014700.0659-
0.606114800.0675-
0.610214900.0629-
0.614315000.0683-
0.618315100.0687-
0.622415200.0724-
0.626515300.0638-
0.630615400.0709-
0.634715500.064-
0.638815600.0646-
0.642915700.0673-
0.647015800.0607-
0.651115900.0671-
0.655216000.0627-
0.659316100.0644-
0.663416200.0629-
0.667516300.0656-
0.671616400.0633-
0.675716500.062-
0.679816600.0627-
0.683916700.0583-
0.688016800.0612-
0.692116900.066-
0.696217000.0645-
0.700217100.0599-
0.704317200.0552-
0.708417300.065-
0.712517400.0614-
0.716617500.0615-
0.720717600.0567-
0.724817700.0528-
0.728917800.0541-
0.733017900.0548-
0.737118000.0568-
0.741218100.053-
0.745318200.0603-
0.749418300.0594-
0.753518400.0549-
0.757618500.0601-
0.761718600.0604-
0.765818700.0524-
0.769918800.057-
0.774018900.057-
0.778119000.0551-
0.782119100.0574-
0.786219200.0555-
0.790319300.0564-
0.794419400.052-
0.798519500.054-
0.802619600.0573-
0.806719700.056-
0.810819800.0503-
0.814919900.0525-
0.819020000.0505-
0.823120100.0547-
0.827220200.0531-
0.831320300.0534-
0.835420400.0542-
0.839520500.0536-
0.843620600.0512-
0.847720700.0508-
0.851820800.0517-
0.855920900.0516-
0.860021000.0558-
0.864021100.0571-
0.868121200.0536-
0.872221300.0561-
0.876321400.0489-
0.880421500.0513-
0.884521600.0455-
0.888621700.0479-
0.892721800.0498-
0.896821900.0523-
0.900922000.0513-
0.905022100.049-
0.909122200.0504-
0.913222300.0462-
0.917322400.0469-
0.921422500.0501-
0.925522600.046-
0.929622700.0475-
0.933722800.0504-
0.937822900.0483-
0.941923000.0536-
0.945923100.0442-
0.950023200.0499-
0.954123300.0478-
0.958223400.0499-
0.962323500.048-
0.966423600.0451-
0.970523700.0501-
0.974623800.0464-
0.978723900.0451-
0.982824000.0413-
0.986924100.0478-
0.991024200.0466-
0.995124300.0515-
0.999224400.0484-
1.02442-0.994

Framework Versions

  • Python: 3.11.9
  • Sentence Transformers: 3.3.0
  • Transformers: 4.48.0.dev0
  • PyTorch: 2.4.0
  • Accelerate: 1.2.1
  • Datasets: 2.21.0
  • Tokenizers: 0.21.0

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}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertModel
Ревизия весов
a22186d

0 моделей