Narrowing the Gap between Supervised and Unsupervised Sentence Representation Learning with Large Language Model

Mingxin Li, Richong Zhang, Zhijie Nie, Yongyi Mao

Abstract: Supervised models for sentence embeddings consistently outperform unsupervised counterparts, even when sharing identical architectures. This research identifies "pattern complexity" as the fundamental cause of this performance disparity. We introduce Relative Fitting Difficulty (RFD), a metric that quantifies the complexity of training tasks. Our analysis reveals that unsupervised methods often utilize "too easy" patterns, leading to poor generalization. To bridge this gap, we propose a framework that leverages Large Language Models (LLMs) to generate synthetic, hierarchically complex training data. By combining these simulated patterns with a novel Hierarchical Triplet (HT) loss, we significantly improve unsupervised sentence representation learning, achieving results that approach supervised performance on standard benchmarks.

Introduction

Sentence Representation Learning (SRL) aims to map sentences into a vector space where semantic similarity corresponds to spatial proximity. Contrastive Learning of Sentence Embeddings (CSE) has emerged as the dominant paradigm. However, a significant performance gap persists between supervised CSE (trained on human-annotated NLI data) and unsupervised CSE (trained on raw text with simple augmentations like dropout). While previous work focused on alignment and uniformity as metrics for success, this paper argues that these are symptoms rather than the root cause. The true differentiator is the complexity of the training patterns.

Quantifying Pattern Complexity: Relative Fitting Difficulty (RFD)

The authors propose Relative Fitting Difficulty (RFD) to measure how much harder it is for a model to "fit" its training data compared to evaluation data. Low RFD indicates a task that is too simple, allowing the model to learn "shortcuts" or noise-specific features that do not generalize to real-world semantics. Conversely, high RFD tasks, such as human-annotated NLI, force the model to capture deeper semantic nuances.

Relative Fitting Difficulty (RFD) across different training patterns.

As shown in Figure 1, standard unsupervised methods like SimCSE (dropout) exhibit low RFD, while supervised NLI and the proposed LLM-simulated patterns occupy the high-RFD region, correlating with better performance. The model essentially learns to recognize its own noise rather than actual semantics when the task is too easy.

LLM-Powered Pattern Simulation and HT Loss

To elevate the RFD of unsupervised learning, the researchers utilize GPT-3.5 to generate synthetic training data that mimics the hierarchical complexity of human labels. Instead of binary positive/negative pairs, they generate a spectrum:

  • Source Sentence ($s_i$): The anchor.
  • Positive Sentence ($s_i^p$): A semantically equivalent version.
  • Intermediate Sentence ($s_i^m$): A version that shares some context but is less detailed.
  • Negative Sentence ($s_i^n$): A version that contradicts the anchor.
The overall framework for simulating complex NLI and STS patterns using LLMs.

Figure 5 illustrates the pipeline where Wikipedia or NLI corpora are combined with few-shot prompts to guide an LLM in generating these complex patterns. To effectively learn from this hierarchical data, the authors developed the Hierarchical Triplet (HT) Loss. This loss function forces the model to rank sentences: the positive must be closer to the anchor than the intermediate, and the intermediate must be closer than the negative.

Key Results and Insights

The proposed method, particularly the NLI.STS HT model, achieved a Spearman’s correlation of 82.21 on the STS Benchmark, a substantial improvement over the unsupervised SimCSE baseline (76.25). Notably, the Wiki.STS HT model, which uses no human labels at all, outperformed previous unsupervised and even some LM-based generation methods like Dino and CLAIF.

Key insights from the study include:

  • Complexity is a Feature: The "difficulty" of supervised data is exactly why it works. By forcing the model to distinguish between subtle semantic differences, we force it to understand meaning.
  • Hierarchy is Key: Semantic similarity in the real world isn't binary; it's a spectrum. Training on "intermediate" similarity creates a more robust embedding space.
  • Data Efficiency: The authors achieved their results using only 20,000 synthetic instances mixed into a larger corpus, proving you don't need millions of LLM-generated sentences to see gains.

Conclusion

By identifying pattern complexity as the key driver of the supervised-unsupervised gap, this work provides a new lens for understanding sentence representation learning. The use of LLMs to simulate complex human-like patterns, coupled with hierarchical loss functions, offers a powerful path toward high-performance sentence embeddings without the need for massive human-annotated datasets.

Summary updated

BibTeX
@inproceedings{li2024narrowing,
  author = {Mingxin Li and Richong Zhang and Zhijie Nie and Yongyi Mao},
  title = {{Narrowing the Gap between Supervised and Unsupervised Sentence Representation Learning with Large Language Model}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i12.29263},
}
Figure