Enhancing Unsupervised Sentence Embeddings via Knowledge-Driven Data Augmentation and Gaussian-Decayed Contrastive Learning

Peichao Lai, Zhengfeng Zhang, Wentao Zhang, Fangcheng Fu, Bin Cui

Abstract

Unsupervised sentence embedding methods, primarily based on contrastive learning, often struggle with limited data diversity and the presence of "false negatives" in synthetic training sets. We propose a novel framework that addresses these challenges through a two-pronged approach: Knowledge-Driven Data Augmentation and Gaussian-Decayed Contrastive Learning (GCSE). By utilizing Entity Knowledge Graphs to guide Large Language Models (LLMs) in generating high-quality, diverse samples, and implementing a denoising training objective that mitigates the impact of noisy negatives, our method achieves state-of-the-art results on standard Semantic Textual Similarity (STS) tasks. Notably, GCSE maintains superior performance while requiring significantly less training data and utilizing smaller, local LLMs compared to existing benchmarks.

Introduction

Sentence embeddings are fundamental to modern Natural Language Processing (NLP), enabling tasks such as semantic search, information retrieval, and clustering. Contrastive learning has emerged as the dominant paradigm for learning these embeddings, typically by pulling semantically similar sentence pairs together and pushing dissimilar pairs apart. However, in unsupervised settings where labeled data is absent, researchers often rely on data augmentation or LLM-based generation to create training pairs. This approach faces two critical issues: low data diversity, where generated sentences often follow repetitive patterns and fail to capture fine-grained entity or quantity differences, and high data noise, where semantically similar sentences are incorrectly treated as negatives, distorting the learned semantic space. Presented at ACL 2025, this paper introduces the GCSE framework to resolve these hurdles.

Methodology

Our proposed framework, GCSE, introduces a comprehensive pipeline to overcome the limitations of current unsupervised methods. The architecture consists of a knowledge-driven augmentation stage followed by a denoising contrastive learning stage.

Overview of the GCSE framework

Knowledge-Driven Data Augmentation

To improve data diversity and entity awareness, we move beyond simple LLM rewriting. Our pipeline first performs Knowledge Extraction, where an LLM identifies key entities and quantities within a source sentence to construct a local Entity Knowledge Graph (KG). Using this KG, we perform Surgical Edits to generate three distinct types of samples:

  1. Positive Samples: Paraphrases that preserve the original meaning.
  2. Syntactic Negatives: Structural changes that create contradictions (e.g., changing "love" to "hate").
  3. Knowledge-based Negatives: Swapping specific entities or quantities with related but distinct values from the KG (e.g., changing "two kids" to "three kids").

Gaussian-Decayed Contrastive Learning

To handle the noise inherent in unsupervised and synthetic data, we implement a two-stage training process. In the first stage, a standard model is trained to serve as an evaluation "teacher." In the second stage, we introduce a Gaussian-decayed function into the contrastive loss. This function identifies "hard negatives"—samples that the model perceives as highly similar despite being labeled as negatives. Early in training, the function reduces the gradient impact of these suspicious samples, preventing the model from being forced to push away potential "false negatives." As the model's confidence grows, these weights are gradually restored, ensuring a stable and accurate semantic representation.

Experiments and Results

We evaluated GCSE across a wide range of benchmarks, including STS 2012–2016, STS-Benchmark (STS-B), and SICK-R. Our experiments utilized various model backbones, including BERT and RoBERTa, and tested different LLMs for data generation, ranging from GPT-3.5 Turbo to local models like ChatGLM3-6B and Qwen2.5.

Main results on STS benchmarks

The results demonstrate that GCSE consistently outperforms previous state-of-the-art methods such as SynCSE and MultiCSR. As shown in the performance table, GCSE improved Spearman’s correlation by an average of 1.05% to 1.89% across STS tasks. A key finding is the framework's efficiency: GCSE achieved these gains using only 14% of the training data required by SynCSE. Furthermore, case studies confirmed that GCSE is significantly more robust to fine-grained changes in entities and numbers, a common failure point for earlier embedding models.

Conclusion

This work presents a significant advancement in unsupervised sentence embeddings by integrating structured knowledge into the data augmentation process and introducing a robust denoising mechanism for contrastive learning. By prioritizing data quality and structural integrity over sheer scale, GCSE achieves superior performance with greater efficiency. Future research will focus on improving prompt adherence for smaller LLMs to further democratize high-quality embedding generation.

Summary updated

BibTeX
@inproceedings{lai2025enhancing,
  author = {Peichao Lai and Zhengfeng Zhang and Wentao Zhang and Fangcheng Fu and Bin Cui},
  title = {{Enhancing Unsupervised Sentence Embeddings via Knowledge-Driven Data Augmentation and Gaussian-Decayed Contrastive Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure