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

Fast, Effective, and Self-Supervised: Transforming Masked Language Models into Universal Lexical and Sentence Encoders

About

Pretrained Masked Language Models (MLMs) have revolutionised NLP in recent years. However, previous work has indicated that off-the-shelf MLMs are not effective as universal lexical or sentence encoders without further task-specific 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 universal lexical and sentence encoders even without any additional data and without any 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 without any additional external knowledge. Mirror-BERT relies on fully identical or 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 in both lexical-level and sentence-level tasks, across different domains and different languages. Notably, in the standard sentence semantic similarity (STS) tasks, our self-supervised Mirror-BERT model even matches the performance of the task-tuned Sentence-BERT models from prior work. Finally, we delve deeper into the inner workings of MLMs, and suggest some evidence on why this simple approach can yield effective universal lexical and sentence encoders.

Fangyu Liu, Ivan Vuli\'c, Anna Korhonen, Nigel Collier• 2021

Related benchmarks

TaskDatasetResultRank
Semantic Textual SimilaritySTS tasks (STS12, STS13, STS14, STS15, STS16, STS-B, SICK-R) various (test)
STS12 Score69.1
393
Semantic Textual SimilaritySTS tasks (STS12, STS13, STS14, STS15, STS16, STS-B, SICK-R)
STS12 Score68.15
195
Natural Language UnderstandingGLUE (test dev)
MRPC Accuracy77.18
81
Semantic Textual SimilarityEnglish STS
Average Score76.4
68
Transfer LearningSentEval Transfer tasks (test)
MR76.72
23
Biomedical Entity LinkingNCBI
Acc@190.9
20
Biomedical Entity LinkingCOMETA
Acc@160.3
20
Hate Speech DetectionHateWas v1 (test)
Macro F157.09
14
Emotion DetectionEmoMoham v1 (test)
Macro F1 Score78.27
14
Crisis ClassificationCrisisOltea v1 (test)
Macro F195.79
14
Showing 10 of 29 rows

Other info

Code

Follow for update