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

Recently, using large language models (LLMs) for data augmentation has led to considerable improvements in unsupervised sentence embedding models. However, existing methods encounter two primary challenges: limited data diversity and high data noise. Current approaches often neglect fine-grained knowledge, such as entities and quantities, leading to insufficient diversity. Besides, unsupervised data frequently lacks discriminative information, and the generated synthetic samples may introduce noise. In this paper, we propose a pipeline-based data augmentation method via LLMs and introduce the Gaussian-decayed gradient-assisted Contrastive Sentence Embedding (GCSE) model to enhance unsupervised sentence embeddings. To tackle the issue of low data diversity, our pipeline utilizes knowledge graphs (KGs) to extract entities and quantities, enabling LLMs to generate more diverse samples. To address high data noise, the GCSE model uses a Gaussian-decayed function to limit the impact of false hard negative samples, enhancing the model's discriminative capability. Experimental results show that our approach achieves state-of-the-art performance in semantic textual similarity (STS) tasks, using fewer data samples and smaller LLMs, demonstrating its efficiency and robustness across various models.

Introduction

Sentence embeddings are the "mathematical fingerprints" of language—vectors that represent the semantic meaning of a sentence. They are essential for tasks like search engines, chatbots, and document retrieval. While supervised models are effective, they are expensive to build due to the need for human-labeled pairs. Unsupervised methods, which learn from raw text, are therefore highly desirable.

Recently, researchers have turned to Large Language Models (LLMs) to generate synthetic training data for unsupervised models. However, two major roadblocks remain:

  1. Low Data Diversity: LLMs often generate repetitive variations, ignoring fine-grained details like specific entities or quantities.
  2. High Data Noise: In contrastive learning, models try to pull similar sentences together and push different ones apart. Synthetic "negative" samples are often too similar to the original (false hard negatives), causing the model to learn incorrect patterns.

Methodology

1. Knowledge-Driven Data Augmentation

To address the diversity gap, we propose a pipeline that integrates Knowledge Graphs (KGs) into the data generation process. Instead of simple rewriting, the system first extracts entities and quantities to provide a structured foundation for the LLM.

The Knowledge-Driven Data Augmentation Pipeline extracts entities and quantities from source text to guide LLMs in generating diverse synthetic instances.

The pipeline utilizes three specialized prompting strategies:

  • Rewriting: Creates diverse positive samples that maintain the original meaning.
  • Syntactic Antisense: Changes sentence structure to create contradictions (negative samples).
  • Entity Revision: Swaps specific entities or numbers from the KG to create subtle, "hard" negative samples that force the model to attend to fine-grained details.

2. GCSE (Gaussian-Decayed Contrastive Sentence Embedding)

To handle noise in synthetic data, we introduced a two-stage training process. First, an "evaluation model" is trained to establish a baseline for sentence similarity. During the second stage, we implement a Gaussian-decayed function. This function acts as a dynamic filter: if a negative sample is too similar to the original sentence (a likely false negative), its influence on the model's gradient is decayed. This prevents the model from being confused by noisy synthetic data while preserving overall data diversity.

Experimental Results

The GCSE model was evaluated on standard benchmarks, including the Semantic Textual Similarity (STS) 2012–2016 tasks, STS-Benchmark (STS-B), and SICK-Relatedness.

GCSE achieves state-of-the-art performance across various backbone models and STS datasets, outperforming previous methods like SynCSE and MultiCSR.

Key Insights

  • State-of-the-Art Performance: GCSE outperformed previous leaders on STS tasks. For instance, using a BERT-base backbone, it improved average Spearman correlation scores by 1.05% over the previous best.
  • Efficiency: The method is highly efficient, outperforming competitors while using only 14% of the sample size required by previous state-of-the-art models like SynCSE.
  • Robustness: Improvements were consistent across different backbone models (BERT and RoBERTa) and various LLMs used for generation, including smaller local models like ChatGLM3-6B.

Conclusion

By combining knowledge-driven data augmentation with a noise-resilient Gaussian-decayed loss function, the GCSE framework significantly advances the state-of-the-art in unsupervised sentence embeddings. Our results highlight that controlling the knowledge content of synthetic data is more critical than simply increasing data volume. Future work will explore reducing dependency on specific LLM architectures and further refining prompt adherence.

Summary updated

Abstract

Recently, using large language models (LLMs) for data augmentation has led to considerable improvements in unsupervised sentence embedding models. However, existing methods encounter two primary challenges: limited data diversity and high data noise. Current approaches often neglect fine-grained knowledge, such as entities and quantities, leading to insufficient diversity. Besides, unsupervised data frequently lacks discriminative information, and the generated synthetic samples may introduce noise. In this paper, we propose a pipeline-based data augmentation method via LLMs and introduce the Gaussian-decayed gradient-assisted Contrastive Sentence Embedding (GCSE) model to enhance unsupervised sentence embeddings. To tackle the issue of low data diversity, our pipeline utilizes knowledge graphs (KGs) to extract entities and quantities, enabling LLMs to generate more diverse samples. To address high data noise, the GCSE model uses a Gaussian-decayed function to limit the impact of false hard negative samples, enhancing the model's discriminative capability. Experimental results show that our approach achieves state-of-the-art performance in semantic textual similarity (STS) tasks, using fewer data samples and smaller LLMs, demonstrating its efficiency and robustness across various models.
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