Fast, Effective, and Self-Supervised: Transforming Masked Language Models into Universal Lexical and Sentence Encoders
Fangyu Liu, Ivan Vulic, Anna Korhonen, Nigel Collier
Abstract
Previous work has indicated that pretrained Masked Language Models (MLMs) are not effective as universal lexical and sentence encoders off-the-shelf, i.e., without further taskspecific fine-tuning on NLI, sentence similarity, or paraphrasing tasks using annotated task data. In this work, we demonstrate that it is possible to turn MLMs into effective lexical and sentence encoders even without any additional data, relying simply on self-supervision. We propose an extremely simple, fast, and effective contrastive learning technique, termed Mirror-BERT, which converts MLMs (e.g., BERT and RoBERTa) into such encoders in 20-30 seconds with no access to additional external knowledge. Mirror-BERT relies on identical and slightly modified string pairs as positive (i.e., synonymous) fine-tuning examples, and aims to maximise their similarity during "identity fine-tuning". We report huge gains over off-the-shelf MLMs with Mirror-BERT both in lexical-level and in sentencelevel tasks, across different domains and different languages. Notably, in sentence similarity (STS) and question-answer entailment (QNLI) tasks, our self-supervised Mirror-BERT model even matches the performance of the Sentence-BERT models from prior work which rely on annotated task data. Finally, we delve deeper into the inner workings of MLMs, and suggest some evidence on why this simple Mirror-BERT fine-tuning approach can yield effective universal lexical and sentence encoders.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
15 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillations cites On the Sentence Embeddings from Pre-trained Language Models
- Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillations cites Poly-encoders: Architectures and Pre-training Strategies for Fast and Accurate Multi-sentence Scoring
- Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillations cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
- miCSE: Mutual Information Contrastive Learning for Low-shot Sentence Embeddings cites Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillations
- miCSE: Mutual Information Contrastive Learning for Low-shot Sentence Embeddings cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
- Ranking-Enhanced Unsupervised Sentence Representation Learning cites Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
- Ranking-Enhanced Unsupervised Sentence Representation Learning cites Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillations
- Ranking-Enhanced Unsupervised Sentence Representation Learning cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
- SimCSE: Simple Contrastive Learning of Sentence Embeddings cites On the Sentence Embeddings from Pre-trained Language Models
- SimCSE: Simple Contrastive Learning of Sentence Embeddings cites Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
Cited by top-tier papers15
- A Contrastive Framework for Neural Text GenerationYixuan Su, Tian Lan, Yan Wang, Dani Yogatama et al.NeurIPS 2022 · 349 citations
- Trans-Encoder: Unsupervised sentence-pair modelling through self- and mutual-distillationsFangyu Liu, Yunlong Jiao, Jordan Massiah, Emine Yilmaz et al.ICLR 2022 · 36 citations
- Ranking-Enhanced Unsupervised Sentence Representation LearningYeon Seonwoo, Guoyin Wang, Changmin Seo, Sajal Choudhary et al.ACL 2023 · 12 citations
- Punctuation-level Attack: Single-shot and Single Punctuation Can Fool Text ModelsWenqiang Wang, Chongyang Du, Tao Wang, Kaihao Zhang et al.NeurIPS 2023 · 11 citations
- miCSE: Mutual Information Contrastive Learning for Low-shot Sentence EmbeddingsTassilo Klein, Moin NabiACL 2023 · 10 citations
Builds on18
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
- Understanding Contrastive Representation Learning through Alignment and Uniformity on the HypersphereTongzhou Wang, Phillip IsolaICML 2020 · 2,360 citations
- AugMix: A Simple Data Processing Method to Improve Robustness and UncertaintyDan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph et al.ICLR 2020 · 1,572 citations
- On the Sentence Embeddings from Pre-trained Language ModelsBohan Li, Hao Zhou, Junxian He, Mingxuan Wang et al.EMNLP 2020 · 538 citations
- Poly-encoders: Architectures and Pre-training Strategies for Fast and Accurate Multi-sentence ScoringSamuel Humeau, Kurt Shuster, Marie-Anne Lachaux, Jason WestonICLR 2020 · 316 citations
Related papers
- Self-Guided Contrastive Learning for BERT Sentence RepresentationsTaeuk Kim, Kang Min Yoo, Sang-goo LeeACL 2021
- Improving Word Translation via Two-Stage Contrastive LearningYaoyiran Li, Fangyu Liu, Nigel Collier, Anna Korhonen et al.ACL 2022 · 32 citations
- ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation TransferYuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang et al.ACL 2021
- QuASE: Question-Answer Driven Sentence EncodingHangfeng He, Qiang Ning, Dan RothACL 2020 · 32 citations
- Mining Knowledge for Natural Language Inference from Wikipedia CategoriesMingda Chen, Zewei Chu, Karl Stratos, Kevin GimpelEMNLP Findings 2020 · 5 citations
