WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach

Junjie Huang, Duyu Tang, Wanjun Zhong, Shuai Lu, Linjun Shou +3 more
4/5/2021
cs.CL

Official code: Jun-jie-Huang/WhiteningBERT (58 stars, Python, MIT, last commit 2021-04-06).

Abstract

Producing the embedding of a sentence in an unsupervised way is valuable to natural language matching and retrieval problems in practice. In this work, we conduct a thorough examination of pretrained model based unsupervised sentence embeddings.

Show full abstract

We study on four pretrained models and conduct massive experiments on seven datasets regarding sentence semantics. We have there main findings. First, averaging all tokens is better than only using [CLS] vector. Second, combining both top andbottom layers is better than only using top layers. Lastly, an easy whitening-based vector normalization strategy with less than 10 lines of code consistently boosts the performance.

View on arXivView PDF

Code Implementations(1)

MIT

source code for paper: WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach.

588PythonApr 4, 20215 years agoMIT

Similar Papers

Cite this paper

@article{huang2021whiteningbert,
  title  = {WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach},
  author = {Junjie Huang and Duyu Tang and Wanjun Zhong and Shuai Lu and Linjun Shou and Ming Gong and Daxin Jiang and Nan Duan},
  year   = {2021},
  eprint = {2104.01767},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.01767}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.01767.svg)](https://codeofpaper.com/paper/2104.01767)

Discussion