Papers › SimCSE: Simple Contrastive Learning of Sentence Embeddings

SimCSE: Simple Contrastive Learning of Sentence Embeddings

18 Apr 2021EMNLP 2021 11arXiv:2104.08821archive 2025-07-28

Tianyu Gao, Xingcheng Yao, Danqi Chen

This paper presents SimCSE, a simple contrastive learning framework that greatly advances state-of-the-art sentence embeddings. We first describe an unsupervised approach, which takes an input sentence and predicts itself in a contrastive objective, with only standard dropout used as noise. This simple method works surprisingly well, performing on par with previous supervised counterparts. We find that dropout acts as minimal data augmentation, and removing it leads to a representation collapse. Then, we propose a supervised approach, which incorporates annotated pairs from natural language inference datasets into our contrastive learning framework by using "entailment" pairs as positives and "contradiction" pairs as hard negatives. We evaluate SimCSE on standard semantic textual similarity (STS) tasks, and our unsupervised and supervised models using BERT base achieve an average of 76.3% and 81.6% Spearman's correlation respectively, a 4.2% and 2.2% improvement compared to the previous best results. We also show -- both theoretically and empirically -- that the contrastive learning objective regularizes pre-trained embeddings' anisotropic space to be more uniform, and it better aligns positive pairs when supervised signals are available.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2104.08821")

Code

Syntology Ran 17 of 30 code samples harvested from 9 repositories linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · honoured contract; 4 ran · our draft was wrong; 1 ran · fixture could not drive it; 11 ran with no contract checked.

By repository: community (archive-listed): 30 samples from 9 repositories, 17 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

23 repositories listed; official and paper-mentioned ones first.

princeton-nlp/SimCSE officialmentioned in papermentioned on GitHubpytorchMIT report
BM-K/KoSimCSE mentioned on GitHubpytorch report
BM-K/KoSimCSE_SKT mentioned on GitHubpytorch report
bhuvanakundumani/SimCSE_unsupervised mentioned on GitHubpytorch report
bm-k/kosimcse-skt mentioned on GitHubpytorch report
cluebenchmark/simclue mentioned on GitHubpytorch report
dll-wu/is-cse mentioned on GitHubpytorch report
dltmddbs100/SimCSE mentioned on GitHubpytorch report
exploration-lab/iitk-semeval-2024-task-1 mentioned on GitHubpytorchMIT report
hooman650/supcl-seq mentioned on GitHubpytorchMIT report
jeongukjae/KR-BERT-SimCSE mentioned on GitHubtf report
liangyuxin42/SimCSE-reproduce mentioned on GitHubpytorch report
mcgill-nlp/llm2vec mentioned on GitHubpytorch report
nlpods/layerattpooler mentioned on GitHubpytorch report
oneflow-inc/libai mentioned on GitHubApache-2.0 report
shuhewang1998/sim-gpt mentioned on GitHubpytorch report
shuxinyin/SimCSE-Pytorch mentioned on GitHubpytorch report
sulcantonin/text_icalepcs23 mentioned on GitHubpytorch report
vdogmcgee/SimCSE-Chinese-Pytorch mentioned on GitHubpytorch report
voidism/diffcse mentioned on GitHubjaxMIT report
wakafengfan/simcse-pytorch mentioned on GitHubpytorch report
yaushian/msimcse mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

30 samples harvested; 17 ran; 1 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
4ran · our draft was wrong
1ran · fixture could not drive it
11ran
13unverified

Licence: 19 of the 30 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 9 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AttentionLayer nlpods/layerattpooler/cl/models.py community (archive-listed) ran no licence file found · pointer only · b949b4980657d9b2 · report
BERT BM-K/KoSimCSE/model/simcse/bert.py community (archive-listed) ran no licence file found · pointer only · 448b46ec4054641f · report
BertConfig jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) ran MIT (permissive) · d286e6c33947de1a · report
BertEmbedding jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) ran MIT (permissive) · 6dd2aadc3b6d84c6 · report
BertForCL bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 5a73e8e6db46e11d · report
MLPLayer nlpods/layerattpooler/cl/models.py community (archive-listed) ran no licence file found · pointer only · 8e0d3e09d28f3b02 · report
MultiheadAttention jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) ran MIT (permissive) · 0903880703193f2a · report
Pooler bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · cf28308ecfc2c9fd · report
Pooler nlpods/layerattpooler/cl/models.py community (archive-listed) ran no licence file found · pointer only · ccd86b57fd87c336 · report
SimcseModel shuxinyin/SimCSE-Pytorch/SimCSE/model.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · d3e6dac55359895d · report
TransformerEncoder jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) ran MIT (permissive) · 9686cc4f31888062 · report
cl_forward bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 565954449b2193d5 · report
find_neighbors_and_aggregation dll-wu/is-cse/simcse/models.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 428008c6d9efb161 · report
get_activation_fn jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) ran · our draft was wrong MIT (permissive) · f16e63fb25fd4d54 · report
sentemb_forward bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 2f2997d4395b9e2d · report
sentemb_forward nlpods/layerattpooler/cl/models.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 74c64a7d40a58644 · report
simcse_loss wakafengfan/simcse-pytorch/train_and_eval.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 4702324b53d391dc · report
Arguments bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) unverified no licence file found · pointer only · b1116f6967379d83 · report
BertForCL dll-wu/is-cse/simcse/models.py community (archive-listed) unverified no licence file found · pointer only · 3233884fc81ed5ae · report
BertForCL nlpods/layerattpooler/cl/models.py community (archive-listed) unverified no licence file found · pointer only · 2ffa456107908807 · report
BertModel jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) unverified MIT (permissive) · 1d4fef90a4837857 · report
BertModelForSimCSE jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) unverified MIT (permissive) · dfc8437383229830 · report
CosineSimilarity jeongukjae/KR-BERT-SimCSE/model.py community (archive-listed) unverified MIT (permissive) · d96e7952e9412323 · report
SimCSE dltmddbs100/SimCSE/model/model.py community (archive-listed) unverified no licence file found · pointer only · 2617146828164292 · report
SimcseModel vdogmcgee/SimCSE-Chinese-Pytorch/simcse_unsup.py community (archive-listed) unverified MIT (permissive) · e8a2dd458c8798db · report
cl_forward dll-wu/is-cse/simcse/models.py community (archive-listed) unverified no licence file found · pointer only · 77b8fc1348dbafc4 · report
cl_forward nlpods/layerattpooler/cl/models.py community (archive-listed) unverified no licence file found · pointer only · 279795ea7a63bfcd · report
cl_init dll-wu/is-cse/simcse/models.py community (archive-listed) unverified no licence file found · pointer only · b697b04f307205e1 · report
cl_init bhuvanakundumani/SimCSE_unsupervised/model.py community (archive-listed) unverified no licence file found · pointer only · 161f85267e41c87c · report
cl_init nlpods/layerattpooler/cl/models.py community (archive-listed) unverified no licence file found · pointer only · d12475050e3e007b · report

Tasks

Contrastive LearningData AugmentationLinear-Probe ClassificationNatural Language InferenceSTSSemantic Textual SimilaritySentenceSentence Embeddings

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Semantic Textual Similarity SICK SimCSE-RoBERTalarge Spearman Correlation 0.8195 #4 of 22 Archive leaderboard report
Semantic Textual Similarity STS Benchmark SimCSE-RoBERTalarge Spearman Correlation 0.867 #40 of 66 Archive leaderboard report
Semantic Textual Similarity STS12 SimCSE-RoBERTa-large Spearman Correlation 0.7746 #9 of 20 Archive leaderboard report
Semantic Textual Similarity STS12 SimCSE-RoBERTa-base Spearman Correlation 0.7016 #15 of 20 Archive leaderboard report
Semantic Textual Similarity STS13 SimCSE-RoBERTa-large Spearman Correlation 0.8727 #10 of 22 Archive leaderboard report
Semantic Textual Similarity STS13 SimCSE-BERT-base Spearman Correlation 0.8241 #15 of 22 Archive leaderboard report
Semantic Textual Similarity STS13 SimCSE-RoBERTa-base Spearman Correlation 0.8136 #17 of 22 Archive leaderboard report
Semantic Textual Similarity STS14 SimCSE-RoBERTalarge Spearman Correlation 0.8236 #8 of 21 Archive leaderboard report
Semantic Textual Similarity STS15 SimCSE-RoBERTalarge Spearman Correlation 0.8666 #9 of 20 Archive leaderboard report
Semantic Textual Similarity STS16 SimCSE-RoBERTalarge Spearman Correlation 0.8393 #10 of 20 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: SimCSE

AdamAttentionAttention DropoutBERTContrastive LearningDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSimCSESoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections