Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

On the Sentence Embeddings from Pre-trained Language Models

About

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.

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

Related benchmarks

TaskDatasetResultRank
Semantic Textual SimilaritySTS tasks (STS12, STS13, STS14, STS15, STS16, STS-B, SICK-R) various (test)
STS12 Score70.19
393
Semantic Textual SimilaritySTS tasks (STS12, STS13, STS14, STS15, STS16, STS-B, SICK-R)
STS12 Score69.78
195
Semantic Textual SimilaritySTS-B
Spearman's Rho (x100)72.26
70
Semantic Textual SimilaritySTS 2014
Spearman Correlation0.6942
35
Semantic Textual SimilaritySTS-12
Spearman Correlation (rho)0.652
23
Paraphrase IdentificationTwitterPara (test)
TURL76.5
22
Question RetrievalAskUbuntu (dev)
AP58.2
22
Question RetrievalCQADupStack (dev)
Average Precision0.139
22
Scientific Document RetrievalSciDocs (dev)
Cite62.2
22
Semantic Textual SimilaritySTS16 (test)
Spearman Corr75.37
12
Showing 10 of 23 rows

Other info

Code

Follow for update