/ Модель

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

Контекст
8 192 токена
Параметры
149 млн
Архитектура
modernbert · dense
Библиотека
sentence-transformers
Опубликована
27 окт 2026

mve-ModernBERT-base-matryoshka

ЭмбеддингиТекст → embedding8 профессий
38скачиваний за 30 дней0лайковвеса обновлены27 окт 2026

Описание модели

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

Много-векторный энкодер ModernBERT для семантического поиска и ранжирования текста с поздним взаимодействием MaxSim.

Это много-векторный текстовый энкодер на архитектуре ModernBERT, опубликованный tomaarsen и обученный с помощью библиотеки Sentence Transformers на наборе msmarco-bm25 из 30 тысяч примеров. Модель преобразует текст в последовательности векторов размерности 128 для каждого токена; сходство между запросом и документом оценивается поздним взаимодействием MaxSim. Максимальная длина последовательности — 8192 токена.

Модель предназначена для семантического поиска и ранжирования документов по запросу, в том числе в системах поиска с поздним взаимодействием. Она принимает текст и выдаёт векторные представления. В метаданных указаны 149 млн параметров и формат safetensors. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Обучена на англоязычном наборе msmarco-bm25; качество для других языков не подтверждено. Для позднего взаимодействия требуется сравнивать токенные векторы с помощью MaxSim.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Бенчмарки пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

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

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

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

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

Открыть на Hugging Face

Multi-Vector Encoder

This is a Multi-Vector Encoder model trained on the msmarco-bm25 dataset 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
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 128 dimensions
  • Similarity Function: MaxSim
  • Supported Modality: Text
  • Training Dataset:
    • msmarco-bm25

Model Sources

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_expansion': {'strategy': 'min', 'attend': False, 'token': None, 'length': 32}, 'architecture': 'ModernBertModel'})
  (1): Dense({'in_features': 768, '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/mve-ModernBERT-base-matryoshka")
# Run inference: each input becomes a sequence of per-token vectors (variable length).
queries = [
    'what county is onarga, il in',
]
documents = [
    'Onarga is a village in Onarga Township, Iroquois County, Illinois, United States. The population was 1,438 at the 2000 census, and 1,350 in 2009.',
    'Onarga is a village in Onarga Township, Iroquois County, Illinois, United States. The population was 1,438 at the 2000 census, and 1,350 in 2009.',
    'Archangel Haniel is also called the â\x80\x9cglory of the grace of God.â\x80\x9d She is an angel of principalities and in that role she is the caregiver of all nations on earth.',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings[0].shape, document_embeddings[0].shape)
# (32, 128) (43, 128)

# Get the MaxSim similarity scores
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[24.8532, 24.8532, 14.9332]])

Training Details

Training Dataset

msmarco-bm25

  • Dataset: msmarco-bm25
  • Size: 30,000 training samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 100 samples:
    querypositivenegative
    typestringstringstring
    modalitytexttexttext
    detailsmin: 4 tokensmean: 9.79 tokensmax: 19 tokensmin: 25 tokensmean: 82.18 tokensmax: 237 tokensmin: 20 tokensmean: 81.71 tokensmax: 237 tokens
  • Samples:
    querypositivenegative
    how long should a marinade sit1 Removing the skin from the chicken will help it absorb marinade. 2 In general, two hours of marinating is long enough for the meat to soak up the flavor, but poultry can marinate for up to two days in the refrigerator, according to the USDA Food Safety and Inspection Service. Fish and shellfish should marinate for only 30 minutes to an hour; any longer and the flesh might start to “cook” and go mushy. 2 DO think ahead: If possible, start marinating meat the night before, or in the morning before you leave for work.I am making a simple marinade of oil, garlic, and some herbs. How long should I marinade the lamb chops for? [To be cooked later tonight].
    what organization drugsDrug trafficking organizations. Drug trafficking organizations are defined by the United States Department of Justice as, complex organizations with highly defined command-and-control structures that produce, transport, and/or distribute large quantities of one or more illicit drugs..So what is FDA approved? The FDA has not had a great reputation when it comes to approving prescription drugs and otc drugs. The organization has caught some slight about its interest in the pharmaceutical industry rather than considering patients health regarding the drugs.
    average weight gain during menstrual cycleOther symptoms of PMS include bloating, abdominal cramps, and irritability. Weight gain during a period is usually due to water retention in the tissues. Although it is not a serious condition, women may be alarmed that they can gain a few pounds, ranging from one to six pounds.Others can gain as much as ten pounds, even if they feel that they have not done anything to increase their weight.reatment for Weight Gain during Period. Weight gain during a woman's period is often transient, but it may be a cause of concern especially for those who are trying to reduce their weight. Here are some ways to control weight gain during periods. Regulate Hormones.Women can gain from 2-10 pounds of excess weight during their menstrual cycle. It is a fallacy to assume that all that weight gain comes only from fluid and water retention. Many women who experience weight gain during their menstrual cycle also experience food cravings and most give in to them.
  • Loss: MultiVectorMatryoshkaLoss with these parameters:
    {
        "loss": "CachedMultiVectorMultipleNegativesRankingLoss",
        "matryoshka_dims": [
            128,
            64,
            32
        ],
        "matryoshka_weights": [
            0.3333333333333333,
            0.3333333333333333,
            0.3333333333333333
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 256
  • num_train_epochs: 1
  • learning_rate: 3e-05
  • warmup_steps: 0.05
  • bf16: True
  • data_seed: 42
  • dataloader_pin_memory: False
  • batch_sampler: no_duplicates
  • max_length: 300

All Hyperparameters

  • per_device_train_batch_size: 256
  • num_train_epochs: 1
  • max_steps: -1
  • learning_rate: 3e-05
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0.05
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • optim_target_modules: None
  • gradient_accumulation_steps: 1
  • average_tokens_across_devices: True
  • max_grad_norm: 1.0
  • label_smoothing_factor: 0.0
  • bf16: True
  • fp16: False
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • use_liger_kernel: False
  • liger_kernel_config: None
  • use_cache: False
  • neftune_noise_alpha: None
  • torch_empty_cache_steps: None
  • auto_find_batch_size: False
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • include_num_input_tokens_seen: no
  • log_level: passive
  • log_level_replica: warning
  • disable_tqdm: False
  • project: huggingface
  • trackio_space_id: trackio
  • per_device_eval_batch_size: 8
  • prediction_loss_only: True
  • eval_on_start: False
  • eval_do_concat_batches: True
  • eval_use_gather_object: False
  • eval_accumulation_steps: None
  • include_for_metrics: []
  • batch_eval_metrics: False
  • save_only_model: False
  • save_on_each_node: False
  • enable_jit_checkpoint: False
  • push_to_hub: False
  • hub_private_repo: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • restore_callback_states_from_checkpoint: False
  • full_determinism: False
  • seed: 42
  • data_seed: 42
  • use_cpu: False
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_pin_memory: False
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • ddp_backend: None
  • ddp_timeout: 1800
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • deepspeed: None
  • debug: []
  • skip_memory_metrics: True
  • do_predict: False
  • resume_from_checkpoint: None
  • warmup_ratio: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}
  • max_length: 300

Training Logs

EpochStepTraining Loss
0.0847105.4216
0.1695202.6158
0.2542301.7516
0.3390401.3482
0.4237501.1398
0.5085601.0223
0.5932700.9058
0.6780800.8352
0.7627900.7789
0.84751000.7712
0.93221100.7556

Training Time

  • Training: 13.9 minutes

Framework Versions

  • Python: 3.12.3
  • Sentence Transformers: 6.3.0.dev0
  • Transformers: 5.4.0
  • PyTorch: 2.11.0+cu128
  • Accelerate: 1.13.0
  • Datasets: 4.8.5
  • Tokenizers: 0.22.2

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

MultiVectorMatryoshkaLoss

@misc{kusupati2024matryoshka,
    title={Matryoshka Representation Learning},
    author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
    year={2024},
    eprint={2205.13147},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

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

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей