/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Архитектура
bert · dense
Базовая модель
bert-base-uncased
Библиотека
sentence-transformers
Опубликована
3 окт 2026

simcse-bert-base-snli-sup

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

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

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

Англоязычная модель SimCSE на базе BERT превращает предложения в векторы для поиска и сравнения по смыслу.

pyrawn создала англоязычную модель эмбеддингов предложений на основе BERT-base-uncased, дообученную методом Supervised SimCSE на 33 351 паре entailment из подмножества SNLI. Модель кодирует каждое предложение в L2-нормированный вектор размерностью 768; близость предложений можно оценивать косинусным сходством. Число параметров — 136,7 млн, контекст — до 512 токенов. Модель предназначена для поиска семантически близких предложений, сравнения текстов и извлечения признаков предложений.

В тесте STS-B она получила Spearman ρ 78,75, а Recall@1 для поиска парафразов на STS-B dev составил 0,890. Это учебная репродукция SimCSE с ограниченным бюджетом обучения, а не опубликованный авторами статьи чекпойнт. Обучение проводилось на англоязычных предложениях-описаниях изображений длиной до 32 токенов. Модель может хуже работать с длинными текстами, другими языками и специализированными областями; ошибки отмечены, в частности, на новостных текстах, где совпадающая тема не всегда означает одинаковый смысл. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Обучена на ограниченном подмножестве SNLI с короткими англоязычными описаниями изображений; качество может быть ниже на длинных текстах, других языках и в специализированных областях. В тесте STS-B результат на 5,50 пункта Spearman ниже результата оригинальной статьи; модель также может ошибочно считать тексты о разных событиях близкими по смыслу.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

simcse-bert-base-snli-sup

Supervised SimCSE (Gao, Yao & Chen, EMNLP 2021, Eq. 5: entailment pairs as positives, contradictions as hard negatives) on top of bert-base-uncased, trained on a 100k-record SNLI subset as a course assignment (U2T02, Trends in Data Science). It maps a sentence to a 768-dimensional, L2-normalized vector; compare vectors with cosine similarity.

Team: Julio Cesar De Aquino Castellanos, Gustavo Alexander Fuentes Marin, Valeria Nicol Hernandez Leon, Ricardo Daniel Horta Sanchez, Jose Angel Pech Xool, Lorena Danae Perez Lopez.

This is a reproduction under a reduced budget, not the paper's released checkpoint: it is 5.5 Spearman points below the paper on STS-B test (see Limitations). It is our best model, and it beats SBERT-2019 on STS-B dev and test while training on about 1/30 of its data. The unsupervised companion model is pyrawn/simcse-bert-base-snli-unsup (68.33 test).

Usage

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("pyrawn/simcse-bert-base-snli-sup")
emb = model.encode(["A man is playing a guitar.", "Someone plays an instrument."])
print(model.similarity(emb[0:1], emb[1:2]))  # cosine similarity

Architecture: Transformer (BERT-base, max 512 tokens) → Pooling(cls) (last-layer [CLS] hidden state; this model was trained without an MLP head, and BERT's pretrained pooler is not used) → Normalize.

Training data

Not the paper's data. The paper trains supervised SimCSE on 314k SNLI + MNLI (premise, entailment, contradiction) triplets; this model was trained on 33,351 (premise, entailment) pairs from a fixed 100k-record subset of the SNLI training set (data/snli_train_100k.jsonl, SHA-256 0927a0b1…7f88; records without annotator consensus dropped). Only 9,488 pairs (28.4%) have a hard negative: the first contradiction hypothesis in file order for the exact same premise. The other 71.6% are trained with in-batch negatives only. Counts, the hard-negative rule and checksums are in the project's data/processed/MANIFEST.json. No MNLI data is used.

Training recipe

From runs/sup_seed42_bs128/config.json:

HyperparameterValue
Modesupervised (entailment positives + contradiction hard negatives, in-batch negatives)
Base modelbert-base-uncased
Training pooling[CLS], no MLP (pooling: cls, mlp_only_train: false)
Inference / eval poolingcls
Use hard negativestrue
Batch size128 (paper: 512)
Learning rate5e-5, linear decay, warmup ratio 0.0
OptimizerAdamW, weight decay 0.0, no gradient clipping (max_grad_norm: null)
Epochs3 (780 steps)
Temperature τ0.05
Max sequence length (training)32
Dropout (hidden / attention)0.1 / 0.1
Precisionfp16 (AMP)
Seed42
Dev evaluation / checkpoint selectionevery 50 steps on STS-B dev; best kept (step 350)
Hardware1× Tesla T4 (Kaggle), ~7 min
Librariestorch 2.10.0, transformers 5.18.0, Python 3.12

Evaluation

STS-B (sentence-transformers/stsb), protocol of the SimCSE paper (Appendix B): embed each sentence independently, cosine similarity, Spearman ρ against gold scores, no STS-B fine-tuning. Spearman ×100:

ModelDevTestAlignment ↓Uniformity ↓
This model82.0578.750.220−3.362
Unsupervised companion (simcse-bert-base-snli-unsup)76.9268.330.305−2.963
raw bert-base-uncased (mean pooling)59.3147.290.195−1.650
SBERT-2019 (bert-base-nli-mean-tokens)80.7776.980.193−3.049
SimCSE paper, sup BERT-base (reported)86.2084.25——
  • Dev is the best periodic dev score during training (used for checkpoint selection, so optimistically biased). Test was scored once on the kept checkpoint and reproduced after publishing by reloading this repo from the Hub into an empty cache (same value to floating-point precision).
  • Alignment / uniformity (Wang & Isola, 2020) on STS-B dev, L2-normalized: alignment over the 264 dev pairs with gold ≥ 4; uniformity over the 2,910 unique dev sentences.
  • Paraphrase retrieval over STS-B dev (264 gold ≥ 4 pairs, 2,910-sentence corpus): Recall@1 0.890, Recall@5 0.985, MRR 0.929.
  • Ablation: the same recipe without hard negatives reaches 81.82 dev (+0.23 from hard negatives, vs. +1.3 in the paper; the difference is explained by the 28.4% hard-negative coverage).

Limitations

  • Gap to the paper: −4.15 dev / −5.50 test. About three quarters of it is attributed to the data subset: 9.4× fewer training pairs from a single genre (SNLI only, no MNLI; ~2.1 dev / ~3.1 test) and hard negatives for only 28.4% of anchors (~1.0). The rest is untuned hyperparameters (batch 128 with the LR the paper tuned for 512; ~0.3), dev-selection optimism on test (~0.4) and single-seed noise (~0.7; the noise floor is about ±0.5). One configuration and one seed were run.
  • Same topic, different event. Headlines that share a template but report different events are treated as near-paraphrases: "6.4-magnitude quake strikes off Indonesia" ↔ "6.9-magnitude quake strikes off Russia's Kuril Islands" (cosine 0.84, gold 1/5); "Military plane crashes in south France" → "…southeastern Turkey, 1 dead" (0.78, gold 1/5). SNLI contradictions are about scene content, so nothing teaches the model that changing a place, number or named entity changes the meaning.
  • Domain. Trained only on English image-caption sentences of ≤ 32 tokens; news-style text is where most STS-B errors occur. Expect weaker results on long text, other languages, and specialized domains. Not evaluated on anything other than STS-B.
  • Inherits the biases of BERT's pretraining data and of SNLI.

Citation

@inproceedings{gao2021simcse,
  title={SimCSE: Simple Contrastive Learning of Sentence Embeddings},
  author={Gao, Tianyu and Yao, Xingcheng and Chen, Danqi},
  booktitle={EMNLP},
  year={2021}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей