Clustering-Aware Negative Sampling for Unsupervised Sentence Representation

Jinghao Deng, Fanqi Wan, Tao Yang, Xiaojun Quan, Rui Wang
5/17/2023
cs.CLcs.AI

No official code found. Best implementation: djz233/ClusterNS (13 stars, last commit 2023-10-16).

Abstract

Contrastive learning has been widely studied in sentence representation learning. However, earlier works mainly focus on the construction of positive examples, while in-batch samples are often simply treated as negative examples. This approach overlooks the importance of selecting appropriate negative examples, potentially leading to a scarcity of hard negatives and the inclusion of false negatives. To address these issues, we propose ClusterNS (Clustering-aware Negative Sampling), a novel method that incorporates cluster information into contrastive learning for unsupervised sentence representation learning. We apply a modified K-means clustering algorithm to supply hard negatives and recognize in-batch false negatives during training, aiming to solve the two issues in one unified framework. Experiments on semantic textual similarity (STS) tasks demonstrate that our proposed ClusterNS compares favorably with baselines in unsupervised sentence representation learning. Our code has been made publicly available.

View on arXivView PDF

Code Implementations(1)

djz233/ClusterNSCommunity100%

Finding of ACL2023: Clustering-Aware Negative Sampling for Unsupervised Sentence Representation

133Shell, PythonNov 13, 20223 years ago

Similar Papers

Cite this paper

@article{deng2023clusteringaware,
  title  = {Clustering-Aware Negative Sampling for Unsupervised Sentence Representation},
  author = {Jinghao Deng and Fanqi Wan and Tao Yang and Xiaojun Quan and Rui Wang},
  year   = {2023},
  eprint = {2305.09892},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.09892v1}
}

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

Discussion