/ Модель

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

Контекст
8 192 токена
Параметры
149 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
ModernBERT-base
Библиотека
sentence-transformers
Опубликована
28 мая 2025

ModernBERT-base-finetuned-hard_negatives

ЭмбеддингиТекст → embedding

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

106скачиваний за 30 дней0лайковвеса обновлены28 мая 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Модель Master-thesis-NAP/ModernBERT-base-finetuned-hard_negatives разработана на основе answerdotai/ModernBERT-base и дообучена как Sentence Transformer для сопоставления предложений и абзацев. Она кодирует текст в плотные векторы размерности 768; для сравнения используется косинусное сходство. Архитектура включает ModernBertModel, усредняющий пулинг токенов и нормализацию векторов.

Модель предназначена для семантического поиска, оценки сходства текстов, поиска перефразировок, классификации и кластеризации. Она поддерживает английский язык и последовательности длиной до 8192 токенов. В карточке указана оценка cosine_accuracy@1 0,8599 на информационном поиске; результат относится к приведённому в карточке набору оценки и не гарантирует такое же качество на других данных. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

Открыть на Hugging Face

ModernBERT base

This is a sentence-transformers model finetuned from answerdotai/ModernBERT-base. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: answerdotai/ModernBERT-base
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Language: en
  • License: apache-2.0

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': 768, '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})
  (2): Normalize()
)

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("Master-thesis-NAP/ModernBERT-base-finetuned-hard_negatives")
# Run inference
sentences = [
    'What is the error estimate for the eigenfunction approximation in terms of the weak eigenvalue and the norm of the difference between the exact and approximate eigenfunctions?',
    '(\\cite{DangWangXieZhou})\\label{Theorem_Error_Estimate_k}\nLet us define the spectral projection $F_{k,h}^{(\\ell)}: V\\mapsto {\\rm span}\\{u_{1,h}^{(\\ell)}, \\cdots, u_{k,h}^{(\\ell)}\\}$ for any integer $\\ell \\geq 1$ as follows:\n\\begin{eqnarray*}\na(F_{k,h}^{(\\ell)}w, u_{i,h}^{(\\ell)}) = a(w, u_{i,h}^{(\\ell)}), \\ \\ \\ i=1, \\cdots, k\\ \\ {\\rm for}\\ w\\in V.\n\\end{eqnarray*}\nThen the exact eigenfunctions $\\bar u_{1,h},\\cdots, \\bar u_{k,h}$ of (\\ref{Weak_Eigenvalue_Discrete}) and the eigenfunction approximations $u_{1,h}^{(\\ell+1)}$, $\\cdots$,  $u_{k,h}^{(\\ell+1)}$ from Algorithm \\ref{Algorithm_k} with the integer $\\ell > 1$ have the following error estimate:\n\\begin{eqnarray*}\\label{Error_Estimate_Inverse}\n \\left\\|\\bar u_{i,h} - F_{k,h}^{(\\ell+1)}\\bar u_{i,h} \\right\\|_a \\leq\n \\bar\\lambda_{i,h} \\sqrt{1+\\frac{\\eta_a^2(V_H)}{\\bar\\lambda_{1,h}\\big(\\delta_{k,i,h}^{(\\ell+1)}\\big)^2}}\n\\left(1+\\frac{\\bar\\mu_{1,h}}{\\delta_{k,i,h}^{(\\ell)}}\\right)\\eta_a^2(V_H)\\left\\|\\bar u_{i,h} - F_{k,h}^{(\\ell)}\\bar u_{i,h} \\right\\|_a,\n\\end{eqnarray*}\nwhere $\\delta_{k,i,h}^{(\\ell)} $ is defined as follows:\n\\begin{eqnarray*}\n\\delta_{k,i,h}^{(\\ell)} = \\min_{j\\not\\in \\{1, \\cdots, k\\}}\\left|\\frac{1}{\\lambda_{j,h}^{(\\ell)}}-\\frac{1}{\\bar\\lambda_{i,h}}\\right|,\\ \\ \\ i=1, \\cdots, k.\n\\end{eqnarray*}\nFurthermore, the following $\\left\\|\\cdot\\right\\|_b$-norm error estimate holds:\n\\begin{eqnarray*}\n\\left\\|\\bar u_{i,h} -F_{k,h}^{(\\ell+1)}\\bar u_{i,h} \\right\\|_b\\leq \n\\left(1+\\frac{\\bar\\mu_{1,h}}{\\delta_{k,i,h}^{(\\ell+1)}}\\right)\\eta_a(V_H) \\left\\|\\bar u_{i,h} -F_{k,h}^{(\\ell+1)}\\bar u_{i,h}\\right\\|_a.\n\\end{eqnarray*}',
    '\\big[{\\bf Condition $SD1(h)$}\\big]\\label{DefnSD1(h)}\n\nIn \\cite{MDL} an approximation order $O(h^s)$, as $h\\to 0$, is proved, where $h$ is the sampling distance. The achievable order $s$ is of course limited by the smoothness order of the boundaries of $Graph(F)$. Then, the order $s$ depends upon the degree of the polynomials used to approximate the boundary near the neighborhood of points of topology change and upon the degree of splines used at regular regions. \n\nFor example, let us view Step C of the approximation algorithm described in Section 5.2 of \\cite{MDL}. \nIt is assumed that the boundary curves are $C^{2k}$ smooth, and it is implicitly assumed that $h$ is small enough so that there are $2k$ sample points close to the point of topology change, for computing the polynomial $p_{2k-1}$ therein.\nThis condition is related to the more general condition $SD(h)$ and it can serve as a practical way of checking it for the case $d=1$. That is, near a point of topology change, we check whether there are enough sample points for applying the approximation algorithm in \\cite{MDL}. We denote this condition as the $SD1(h)$ condition.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

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

Evaluation

Metrics

Information Retrieval

MetricValue
cosine_accuracy@10.8599
cosine_accuracy@30.9113
cosine_accuracy@50.9272
cosine_accuracy@100.9432
cosine_precision@10.8599
cosine_precision@30.6012
cosine_precision@50.4809
cosine_precision@100.3352
cosine_recall@10.0415
cosine_recall@30.0813
cosine_recall@50.1041
cosine_recall@100.1366
cosine_ndcg@100.4373
cosine_mrr@100.8887
cosine_map@1000.1552

Training Details

Training Dataset

Unnamed Dataset

  • Size: 79,876 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    anchorpositivenegative
    typestringstringstring
    detailsmin: 9 tokensmean: 38.48 tokensmax: 142 tokensmin: 5 tokensmean: 210.43 tokensmax: 924 tokensmin: 14 tokensmean: 88.74 tokensmax: 516 tokens
  • Samples:
    anchorpositivenegative
    What is the limit of the proportion of 1's in the sequence $a_n$ as $n$ approaches infinity, given that $0 \leq 3g_n -2n \leq 4$?Let $g_n$ be the number of $1$'s in the sequence $a_1 a_2 \cdots a_n$.Then \begin{equation}0 \leq 3g_n -2n \leq 4\label{star}\end{equation}for all $n$, and hence$\lim_{n \rightarrow \infty} g_n/n = 2/3$.\label{thm1}[] The tree $ \mathcal{T}_{ \infty}$ is the limit in Benjamini--Schramm quenched sense of $ \mathbb{T}_n$ as $n$ goes to infinity.
    Does the statement of \textbf{ThmConjAreTrue} imply that the maximum genus of a locally Cohen-Macaulay curve in $\mathbb{P}^3_{\mathbb{C}}$ of degree $d$ that does not lie on a surface of degree $s-1$ is always equal to $g(d,s)$?\label{ThmConjAreTrue}Conjectures \ref{Conj1} and \ref{Conj2} are true.As a consequence, if either $d=s \geq 1$ or $d \geq 2s+1 \geq 3$, the maximum genus of a locally Cohen-Macaulay curve in $\mathbb{P}^3_{\mathbb{C}}$ of degree $d$ that does not lie on a surface of degree $s-1$ is equal to $g(d,s)$.[{\cite[Corollary 2.2.2 with $p=3$]{BSY}}] Let $S$ be a non-trivial Severi-Brauer surface over a perfect field $\textbf{k}$. Then $S$ does not contain points of degree $d$, where $d$ is not divisible by $3$. On the other hand $S$ contains a point of degree $3$.
    \emph{Is the statement \emph{If $X$ is a compact Hausdorff space, then $X$ is normal}, proven in the first isomorphism theorem for topological groups, or is it a well-known result in topology?}}\newcommand{\ep}{\label{prop:coherence} If $X$ is a qcqs scheme, then $RX$ is coherent in the sense that the set of quasi-compact open subsets of $RX$ is closed under finite intersections and forms a basis for the topology of $RX$.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • gradient_accumulation_steps: 8
  • learning_rate: 2e-05
  • num_train_epochs: 4
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • bf16: True
  • tf32: True
  • load_best_model_at_end: True
  • optim: adamw_torch_fused
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 8
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 4
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • 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: True
  • 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: True
  • 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_fused
  • 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
  • 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 LossTESTING_cosine_ndcg@10
0.01601028.2978-
0.03202027.3071-
0.04813026.0992-
0.06414024.4038-
0.08015021.5478-
0.09616016.4121-
0.11227011.5764-
0.1282807.7549-
0.1442905.8755-
0.16021003.9385-
0.17621102.7828-
0.19231202.1444-
0.20831301.7805-
0.22431401.5387-
0.24031501.4621-
0.25641601.3322-
0.27241701.333-
0.28841801.1738-
0.30441900.9632-
0.32042000.9102-
0.33652101.0278-
0.35252200.883-
0.36852300.9874-
0.38452400.8836-
0.40062500.8743-
0.41662600.6613-
0.43262700.774-
0.44862800.6984-
0.46472900.6666-
0.48073000.6525-
0.49673100.6591-
0.51273200.6595-
0.52873300.5803-
0.54483400.6166-
0.56083500.6912-
0.57683600.6861-
0.59283700.7161-
0.60893800.6541-
0.62493900.6161-
0.64094000.4908-
0.65694100.4949-
0.67294200.5433-
0.68904300.5089-
0.70504400.5373-
0.72104500.5043-
0.73704600.4508-
0.75314700.6151-
0.76914800.4508-
0.78514900.4458-
0.80115000.3999-
0.81715100.4081-
0.83325200.3537-
0.84925300.5236-
0.86525400.5618-
0.88125500.4466-
0.89735600.4007-
0.91335700.4155-
0.92935800.3989-
0.94535900.7077-
0.96136000.423-
0.97746100.5218-
0.99346200.4137-
1.0625-0.4165
1.00806300.4212-
1.02406400.3114-
1.04016500.2661-
1.05616600.215-
1.07216700.1974-
1.08816800.224-
1.10416900.2187-
1.12027000.2888-
1.13627100.2571-
1.15227200.2582-
1.16827300.2777-
1.18437400.2297-
1.20037500.2173-
1.21637600.2797-
1.23237700.2019-
1.24837800.2301-
1.26447900.2282-
1.28048000.2131-
1.29648100.2593-
1.31248200.287-
1.32858300.1675-
1.34458400.1342-
1.36058500.2494-
1.37658600.2151-
1.39258700.2111-
1.40868800.2471-
1.42468900.1846-
1.44069000.1864-
1.45669100.1998-
1.47279200.2894-
1.48879300.2177-
1.50479400.2325-
1.52079500.2442-
1.53689600.2016-
1.55289700.2012-
1.56889800.2357-
1.58489900.2224-
1.600810000.3016-
1.616910100.2209-
1.632910200.1773-
1.648910300.2279-
1.664910400.2297-
1.681010500.1896-
1.697010600.2662-
1.713010700.254-
1.729010800.2416-
1.745010900.1875-
1.761111000.2494-
1.777111100.1665-
1.793111200.1605-
1.809111300.2083-
1.825211400.2155-
1.841211500.1671-
1.857211600.1846-
1.873211700.1882-
1.889211800.214-
1.905311900.2179-
1.921312000.242-
1.937312100.2511-
1.953312200.1902-
1.969412300.2275-
1.985412400.1938-
2.012500.17020.4336
2.016012600.0784-
2.032012700.0783-
2.048112800.0959-
2.064112900.1046-
2.080113000.092-
2.096113100.0769-
2.112213200.1121-
2.128213300.1442-
2.144213400.0715-
2.160213500.0907-
2.176213600.0769-
2.192313700.0753-
2.208313800.0792-
2.224313900.0716-
2.240314000.0726-
2.256414100.0909-
2.272414200.0843-
2.288414300.0857-
2.304414400.0736-
2.320414500.0624-
2.336514600.1016-
2.352514700.0729-
2.368514800.0859-
2.384514900.0677-
2.400615000.0696-
2.416615100.0796-
2.432615200.0698-
2.448615300.0773-
2.464715400.0977-
2.480715500.0869-
2.496715600.0792-
2.512715700.1235-
2.528715800.0733-
2.544815900.061-
2.560816000.0859-
2.576816100.082-
2.592816200.0829-
2.608916300.0833-
2.624916400.0831-
2.640916500.1032-
2.656916600.079-
2.672916700.0645-
2.689016800.0798-
2.705016900.0963-
2.721017000.0717-
2.737017100.1132-
2.753117200.0715-
2.769117300.0825-
2.785117400.0826-
2.801117500.0762-
2.817117600.0614-
2.833217700.0944-
2.849217800.0811-
2.865217900.0852-
2.881218000.0989-
2.897318100.078-
2.913318200.0696-
2.929318300.0897-
2.945318400.1004-
2.961318500.1178-
2.977418600.0787-
2.993418700.056-
3.01875-0.4324
3.008018800.0632-
3.024018900.0398-
3.040119000.0352-
3.056119100.0634-
3.072119200.0472-
3.088119300.0744-
3.104119400.0595-
3.120219500.0551-
3.136219600.0451-
3.152219700.0671-
3.168219800.0364-
3.184319900.0459-
3.200320000.0533-
3.216320100.0512-
3.232320200.066-
3.248320300.0667-
3.264420400.0597-
3.280420500.0556-
3.296420600.0453-
3.312420700.0677-
3.328520800.0622-
3.344520900.0587-
3.360521000.0466-
3.376521100.053-
3.392521200.0505-
3.408621300.0523-
3.424621400.061-
3.440621500.043-
3.456621600.0513-
3.472721700.0574-
3.488721800.0506-
3.504721900.0674-
3.520722000.0572-
3.536822100.0565-
3.552822200.0671-
3.568822300.0682-
3.584822400.0537-
3.600822500.0575-
3.616922600.0584-
3.632922700.0584-
3.648922800.041-
3.664922900.0529-
3.681023000.0657-
3.697023100.0416-
3.713023200.0516-
3.729023300.0651-
3.745023400.0767-
3.761123500.0432-
3.777123600.0496-
3.793123700.0543-
3.809123800.053-
3.825223900.0599-
3.841224000.0528-
3.857224100.0449-
3.873224200.0461-
3.889224300.0351-
3.905324400.0385-
3.921324500.048-
3.937324600.0514-
3.953324700.0495-
3.969424800.0597-
3.985424900.0523-
4.025000.0490.4373
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.11.12
  • Sentence Transformers: 4.1.0
  • Transformers: 4.52.2
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.7.0
  • Datasets: 2.14.4
  • Tokenizers: 0.21.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",
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей