DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations

John Giorgi, Osvald Nitski, Bo Wang, Gary Bader
6/5/2020
552 citations
cs.CLcs.LG
contrastive-ssl

Official code: JohnGiorgi/DeCLUTR (377 stars, Python, Apache-2.0, PyTorch, last commit 2023-04-21).

Abstract

Sentence embeddings are an important component of many natural language processing (NLP) systems. Like word embeddings, sentence embeddings are typically learned on large text corpora and then transferred to various downstream tasks, such as clustering and retrieval.

Show full abstract

Unlike word embeddings, the highest performing solutions for learning sentence embeddings require labelled data, limiting their usefulness to languages and domains where labelled data is abundant. In this paper, we present DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations. Inspired by recent advances in deep metric learning (DML), we carefully design a self-supervised objective for learning universal sentence embeddings that does not require labelled training data. When used to extend the pretraining of transformer-based language models, our approach closes the performance gap between unsupervised and supervised pretraining for universal sentence encoders. Importantly, our experiments suggest that the quality of the learned embeddings scale with both the number of trainable parameters and the amount of unlabelled training data. Our code and pretrained models are publicly available and can be easily adapted to new domains or used to embed unseen text.

View on arXivView PDF

Code Implementations(1)

JohnGiorgi/DeCLUTROfficial100%
PyTorchApache-2.0

The corresponding code from our paper "DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations". Do not hesitate to open an issue if you run into any trouble!

37733Python, Jupyter NotebookNov 26, 20193 years agoApache-2.0
allennlpcontrastive-learningmetric-learningnatural-language-processingpytorch+7 more

Similar Papers

Cite this paper

@article{giorgi2020declutr,
  title  = {DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations},
  author = {John Giorgi and Osvald Nitski and Bo Wang and Gary Bader},
  year   = {2020},
  eprint = {2006.03659},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.03659}
}

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/2006.03659.svg)](https://codeofpaper.com/paper/2006.03659)

Discussion