Papers › On the Sentence Embeddings from Pre-trained Language Models

On the Sentence Embeddings from Pre-trained Language Models

2 Nov 2020EMNLP 2020 11arXiv:2011.05864archive 2025-07-28

Bohan Li, Hao Zhou, Junxian He, Mingxuan Wang, Yiming Yang, Lei LI

Pre-trained contextual representations like BERT have achieved great success in natural language processing. However, the sentence embeddings from the pre-trained language models without fine-tuning have been found to poorly capture semantic meaning of sentences. In this paper, we argue that the semantic information in the BERT embeddings is not fully exploited. We first reveal the theoretical connection between the masked language model pre-training objective and the semantic similarity task theoretically, and then analyze the BERT sentence embeddings empirically. We find that BERT always induces a non-smooth anisotropic semantic space of sentences, which harms its performance of semantic similarity. To address this issue, we propose to transform the anisotropic sentence embedding distribution to a smooth and isotropic Gaussian distribution through normalizing flows that are learned with an unsupervised objective. Experimental results show that our proposed BERT-flow method obtains significant performance gains over the state-of-the-art sentence embeddings on a variety of semantic textual similarity tasks. The code is available at https://github.com/bohanli/BERT-flow.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

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="2011.05864")

Code

Syntology Ran 3 of 3 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 2 ran · honoured contract; 1 ran · violated contract.

By repository: official repository: 3 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

bohanli/BERT-flow officialmentioned in papermentioned on GitHubtf report
InsaneLife/dssm mentioned on GitHubtf 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

3 samples harvested; 3 ran; 2 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

2ran · honoured contract
1ran · violated contract

Licence: 0 of the 3 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 bohanli/BERT-flow. “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.

get_gt bohanli/BERT-flow/scripts/eval_stsb.py official repository ran · honoured contract Apache-2.0 (permissive) · b8d3902cb6058201 · report
get_pred bohanli/BERT-flow/scripts/eval_stsb.py official repository ran · honoured contract Apache-2.0 (permissive) · 3b6418910c030c74 · report
pearson_r bohanli/BERT-flow/scripts/eval_stsb.py official repository ran · violated contract fingerprinted Apache-2.0 (permissive) · c801efb328b1fc65 · report

Tasks

Language ModelingLanguage ModellingSemantic SimilaritySemantic Textual SimilaritySentenceSentence EmbeddingSentence EmbeddingsSentence-Embedding

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Semantic Textual Similarity SICK BERTbase-flow (NLI) Spearman Correlation 0.6544 #21 of 22 Archive leaderboard report
Semantic Textual Similarity STS Benchmark BERTlarge-flow (target) Spearman Correlation 0.7226 #60 of 66 Archive leaderboard report
Semantic Textual Similarity STS12 BERTlarge-flow (target) Spearman Correlation 0.6520 #18 of 20 Archive leaderboard report
Semantic Textual Similarity STS13 BERTlarge-flow (target) Spearman Correlation 0.7339 #21 of 22 Archive leaderboard report
Semantic Textual Similarity STS14 BERTlarge-flow (target) Spearman Correlation 0.6942 #20 of 21 Archive leaderboard report
Semantic Textual Similarity STS15 BERTlarge-flow (target) Spearman Correlation 0.7492 #20 of 20 Archive leaderboard report
Semantic Textual Similarity STS16 BERTlarge-flow (target) Spearman Correlation 0.7763 #16 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

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionNormalizing FlowsResidual ConnectionSoftmaxWeight 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