[Paper Review] On the Sentence Embeddings from Pre-trained Language Models
This paper proposes BERT-flow, a flow-based method that transforms BERT’s anisotropic sentence embeddings into a smooth, isotropic Gaussian distribution using unsupervised normalizing flows, significantly improving semantic textual similarity performance by reducing spurious lexical similarity correlations. The approach achieves state-of-the-art results on multiple STS benchmarks without downstream fine-tuning.
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.
Motivation & Objective
- To investigate why BERT sentence embeddings underperform on semantic textual similarity despite strong pre-training.
- To identify the root cause of poor performance, particularly the anisotropic and non-smooth nature of the sentence embedding space.
- To develop an unsupervised method that enhances BERT sentence embeddings without requiring labeled data or fine-tuning.
- To reduce the excessive correlation between BERT-induced similarity and lexical similarity (e.g., edit distance), which harms semantic generalization.
Proposed method
- Apply normalizing flows—a class of invertible generative models with learnable, neural network-based transformations—to map BERT sentence embeddings to a standard Gaussian latent space.
- Train the flow network in an unsupervised manner by maximizing the likelihood of generating observed BERT embeddings from a standard Gaussian prior.
- Keep BERT parameters frozen during training, optimizing only the flow network to preserve the original contextual representations.
- Use the learned invertible mapping to transform BERT sentence embeddings into a smoother, more isotropic latent space that better reflects semantic similarity.
- The transformation is applied during inference, enabling improved similarity computation via cosine similarity in the latent space.
- The method is evaluated end-to-end on semantic textual similarity tasks without any downstream fine-tuning.
Experimental results
Research questions
- RQ1Why do BERT sentence embeddings perform poorly on semantic textual similarity tasks despite strong pre-training?
- RQ2To what extent does the anisotropic and non-smooth structure of the BERT sentence embedding space harm semantic similarity estimation?
- RQ3Can an unsupervised, invertible transformation improve BERT’s sentence embeddings without requiring labeled data or fine-tuning?
- RQ4Does the proposed method reduce the spurious correlation between embedding similarity and lexical similarity (e.g., edit distance)?
- RQ5Can the flow-based transformation lead to state-of-the-art performance on semantic textual similarity benchmarks?
Key findings
- BERT-flow achieves an average Spearman correlation gain of 8.16 points over BERT on 7 semantic textual similarity benchmarks, with a maximum improvement of 12.70 points.
- The method reduces the correlation between BERT-induced similarity and edit distance from ρ = -50.49 to ρ = -28.01, indicating less reliance on lexical similarity.
- BERT-flow outperforms both standard normalization and top-k singular vector nulling (NATSV), which are prior baselines for mitigating anisotropy.
- The flow-based transformation improves performance even when combined with external supervision from natural language inference tasks, surpassing sentence-BERT.
- The method effectively suppresses the influence of lexical similarity, especially for sentence pairs with small edit distances (≤4), where BERT’s similarity is overly correlated with lexical changes.
- The learned flow transformation preserves all semantic information while making the embedding space smoother and more isotropic, leading to better alignment with human-annotated semantic similarity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.