An Unsupervised Sentence Embedding Method by Mutual Information Maximization

Yan Zhang, Ruidan He, Zuozhu Liu, Kwan Hui Lim, Lidong Bing

Introduction

While BERT has significantly advanced natural language processing, its application to sentence-pair tasks—such as semantic search or clustering—remains computationally prohibitive. Standard BERT architectures typically function as "cross-encoders," requiring $O(N^2)$ comparisons to evaluate sentence similarity. To address this, Sentence-BERT (SBERT) was developed to generate fixed-size embeddings suitable for fast cosine similarity calculations. However, SBERT's effectiveness depends heavily on large-scale labeled datasets like Natural Language Inference (NLI). In domains where labeled data is scarce or significantly different from the training set, SBERT's performance degrades. This paper introduces IS-BERT (Info-Sentence BERT), an unsupervised framework designed to produce high-quality sentence embeddings using only raw, unlabeled text.

Methodology

IS-BERT enhances a pretrained BERT model with a lightweight architecture trained via a self-supervised objective.

Feature Extraction and Global Representation

The model processes BERT token outputs through multiple 1D Convolutional Neural Network (CNN) layers. By employing various window sizes (e.g., 1, 3, and 5), the architecture captures local n-gram dependencies at multiple scales. These local representations are then aggregated using mean-over-time pooling to form a single global sentence embedding.

The IS-BERT architecture uses CNNs to extract local features and maximizes mutual information between local and global representations.

Mutual Information Maximization

The core training mechanism is inspired by Deep InfoMax. The model is trained to maximize the mutual information (MI) between the global sentence embedding and its constituent local n-gram embeddings. This is achieved through contrastive learning: a discriminator distinguishes between "positive" pairs (global and local embeddings from the same sentence) and "negative" pairs (global embeddings paired with local n-grams from different sentences in the batch). This objective forces the encoder to retain information shared across all local segments of a sentence while filtering out noise common to the broader corpus.

Experimental Evaluation

The researchers evaluated IS-BERT across several benchmarks, including seven Semantic Textual Similarity (STS) tasks (2012–2016, STSb, and SICK-R) and the Argument Facet Similarity (AFS) dataset, which involves complex social media dialogues. For a fair comparison, "IS-BERT-NLI" was trained on the SNLI and MultiNLI datasets without utilizing any labels.

Results and Discussion

IS-BERT consistently outperformed standard unsupervised baselines. On STS tasks, IS-BERT-NLI achieved an average score of 66.58, significantly surpassing the 54.81 average of vanilla BERT embeddings and even exceeding the performance of some supervised models like InferSent (65.01).

Performance comparison on STS tasks shows IS-BERT-NLI outperforming unsupervised and some supervised baselines.

A critical insight emerged from the AFS dataset evaluation. Supervised models like SBERT-NLI showed poor transferability to niche domains, achieving a Spearman correlation of only 15.84. In contrast, the unsupervised IS-BERT achieved 45.25, demonstrating that supervised NLI training can lead to overfitting on specific logical patterns that do not generalize. IS-BERT's reliance on local-global synergy through CNNs and MI maximization provides a more robust and expressive representation.

Conclusion

IS-BERT provides a powerful unsupervised alternative for generating sentence embeddings. By leveraging CNNs for structural awareness and mutual information maximization for feature extraction, it bridges the gap between simple averaging techniques and supervised models. While it still trails supervised models when in-domain labels are plentiful, its robustness in domain-shift scenarios makes it a valuable tool for real-world applications where labeled data is unavailable.

Summary updated

BibTeX
@inproceedings{zhang2020unsupervised,
  author = {Yan Zhang and Ruidan He and Zuozhu Liu and Kwan Hui Lim and Lidong Bing},
  title = {{An Unsupervised Sentence Embedding Method by Mutual Information Maximization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.124},
}
Figure