SQBC: Active Learning using LLM-Generated Synthetic Data for Stance Detection in Online Political Discussions

Stefan Sylvius Wagner, Maike Behrendt, Marc Ziegele, Stefan HarmelingarXiv 2024

Abstract

Stance detection is an important task for many applications that analyse or support online political discussions. Common approaches include fine-tuning transformer based models. However, these models require a large amount of labelled data, which might not be available. In this work, we present two different ways to leverage LLM-generated synthetic data to train and improve stance detection agents for online political discussions: first, we show that augmenting a small fine-tuning dataset with synthetic data can improve the performance of the stance detection model. Second, we propose a new active learning method called SQBC based on the "Query-by-Comittee" approach. The key idea is to use LLM-generated synthetic data as an oracle to identify the most informative unlabelled samples, that are selected for manual labelling. Comprehensive experiments show that both ideas can improve the stance detection performance. Curiously, we observed that fine-tuning on actively selected samples can exceed the performance of using the full dataset.

Introduction

Analyzing online political discourse requires automatically determining if a person is "for," "against," or "neutral" regarding a specific topic—a task known as stance detection. This field faces significant challenges, primarily data scarcity and the "infinite topic" problem, where models fail to generalize across highly specific political issues. Traditional active learning methods often require an initial pool of labeled data to begin the selection process. This research explores leveraging Large Language Models (LLMs) to generate synthetic data that acts as an "oracle" to jumpstart active learning and augment training sets.

Methodology

The proposed approach utilizes a quantized Mistral-7B-Instruct-v0.1 model to enhance stance detection performance through two primary mechanisms:

Synthetic Data Augmentation

An LLM generates a balanced set of "pro" and "con" comments for a specific political question. This synthetic data is used to fine-tune a base model (e.g., BERT), grounding it in the specific vocabulary and context of the target topic.

Synthetic Data-driven Query-by-Committee (SQBC)

SQBC adapts the "Query-by-Committee" active learning paradigm. Instead of multiple models, the "committee" is the synthetic dataset itself:

  1. Embedding Similarity: Embeddings are generated for both unlabeled real data and LLM-generated synthetic data.
  2. Oracle Scoring: For each unlabeled real comment, the system identifies its $k$-nearest neighbors in the synthetic dataset.
  3. Selection: If the synthetic neighbors exhibit conflicting stances (e.g., a mix of "pro" and "con"), the real comment is deemed "informative" and prioritized for human labeling.

An extended version, SQBC+, assigns "pseudo-labels" to non-selected samples based on the majority vote of their synthetic neighbors, further expanding the training pool.

Experimental Setup

The methods were evaluated using the X-Stance dataset, focusing on German comments regarding five diverse political questions from Swiss voting advice platforms. This setup ensures that the findings are not limited to a single topic.

Results and Discussion

The experiments yielded several key insights regarding the efficiency and effectiveness of synthetic data in active learning.

Performance of SQBC and variants across different labeling efforts (Kappa).

Efficiency and Performance Gains

As shown in the figure above, SQBC significantly outperforms random selection baselines. A critical finding is that using SQBC to select only approximately 20% of the data for manual labeling often resulted in higher F1-scores than using the entire dataset with random labeling. This suggests that LLM-guided selection effectively prunes "noisy" or redundant data, creating a cleaner training signal.

Robustness Across Topics

The performance improvements were consistent across various political questions, indicating that the embedding-based similarity search effectively captures informativeness regardless of the specific topic.

Accuracy and F1-score across five distinct political questions, comparing SQBC variants to baselines.

The SQBC+ variant, which utilizes pseudo-labeling for unselected samples, consistently provided additional performance boosts, demonstrating the value of leveraging synthetic data even for "uninformative" samples.

Conclusion

This work demonstrates that LLM-generated synthetic data can serve as a powerful tool for stance detection, both as a data augmentation source and as an oracle for active learning. The SQBC method enables high-performance model training with significantly reduced human labeling effort, potentially overcoming the data scarcity hurdles prevalent in analyzing niche political discussions. Future work will explore the applicability of synthetic oracles to other NLP tasks such as sentiment analysis and toxicity classification.

Summary updated

BibTeX
@misc{wagner2024sqbc,
  author = {Stefan Sylvius Wagner and Maike Behrendt and Marc Ziegele and Stefan Harmeling},
  title = {{SQBC: Active Learning using LLM-Generated Synthetic Data for Stance Detection in Online Political Discussions}},
  year = {2024},
  eprint = {2404.08078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.08078},
}
Figure