Knowledge-Based Domain-Oriented Data Augmentation for Enhancing Unsupervised Sentence Embedding

Peichao Lai, Zhengfeng Zhang, Bin Cui

Abstract

Unsupervised sentence embedding models are critical for various NLP tasks but often struggle with limited data diversity and synthetic noise. We propose GCSE (Gaussian-decayed Contrastive Sentence Embedding), a framework that integrates Knowledge Graphs (KG) with Large Language Models (LLMs) to generate high-quality, diverse training data. To address the issue of "false negatives" in contrastive learning, we introduce a Gaussian-decayed loss function that dynamically weights samples based on their similarity scores. GCSE achieves state-of-the-art results on Semantic Textual Similarity (STS) benchmarks, outperforming existing methods while utilizing only 14% of the training samples.

Introduction

Sentence embeddings serve as the foundation for modern information retrieval and question-answering systems. While supervised models excel, they are constrained by the need for labeled data. Unsupervised methods, such as SimCSE, rely on data augmentation to create training pairs. However, these methods face two primary challenges:

  1. Low Data Diversity: Simple augmentations like word deletion or dropout fail to capture fine-grained semantic nuances.
  2. High Data Noise: Synthetic data often contains "false negatives"—sentences that are semantically similar but treated as distinct by the model—which degrades the embedding space.

Methodology

Knowledge-Driven Data Augmentation

To overcome the limitations of generic LLM rewriting, GCSE employs a structured knowledge-driven pipeline. As shown in the figure below, the process begins by extracting entities and quantities from source text to construct a mini Knowledge Graph (KG).

The knowledge-driven data augmentation pipeline using LLMs and Knowledge Graphs.

The LLM is then guided by three specific prompts:

  • Rewriting: Generates diverse positive samples.
  • Syntactic Antisense: Creates negatives by altering logic (e.g., changing "love" to "hate").
  • Entity/Quantity Revision: Uses the KG to swap specific details (e.g., changing "two kids" to "eight kids"), creating "hard negatives" that force the model to distinguish fine-grained differences.

GCSE and the Gaussian-Decayed Function

To mitigate noise, GCSE utilizes a two-stage training process. An initial "evaluation model" identifies potentially noisy samples. During the main training phase, a Gaussian-decayed function is applied to the loss calculation. Early in training, samples that appear too similar to the source (potential false negatives) are assigned lower weights. As the model's confidence grows, these weights are gradually restored, allowing the model to learn from challenging negatives without being misled by initial noise.

Results and Discussion

Performance on STS Benchmarks

GCSE was evaluated across standard Semantic Textual Similarity (STS) benchmarks. As detailed in the results table, GCSE consistently outperforms previous state-of-the-art methods like SynCSE and MultiCSR across various backbone architectures, including BERT and RoBERTa.

Performance comparison of GCSE against baseline methods on STS benchmarks.

Key Findings

  • Efficiency: GCSE achieves superior performance using only 14% of the sample size required by its closest competitors, demonstrating the high quality of its knowledge-driven synthetic data.
  • Precision vs. Scale: Smaller, local LLMs (e.g., ChatGLM3-6B) paired with smart prompting strategies can outperform massive models like GPT-3.5 that lack structured knowledge guidance.
  • Robustness: Ablation studies confirm that the Gaussian-decayed strategy is vital; removing it leads to a significant performance drop, highlighting the importance of noise management in contrastive learning.

Conclusion

GCSE demonstrates that combining structured knowledge with LLM-based synthesis significantly enhances unsupervised sentence embeddings. By targeting specific entities and managing data noise through a dynamic weighting function, GCSE provides a robust and efficient framework for building high-quality semantic representations. Future work will focus on improving prompt adherence in smaller models and addressing potential biases in LLM-generated data.

Summary updated

BibTeX
@inproceedings{lai2025knowledge,
  author = {Peichao Lai and Zhengfeng Zhang and Bin Cui},
  title = {{Knowledge-Based Domain-Oriented Data Augmentation for Enhancing Unsupervised Sentence Embedding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure