The Power of LLM-Generated Synthetic Data for Stance Detection in Online Political Discussions

Stefan Sylvius Wagner, Maike Behrendt, Marc Ziegele, Stefan Harmeling

TL;DR

Deploying Large Language Models (LLMs) directly for online text classification faces challenges like high latency, inconsistent outputs, and adversarial vulnerabilities. This paper demonstrates that using an LLM offline to generate synthetic training data allows researchers to fine-tune smaller, safer models (like BERT) that match or exceed full-data performance. Furthermore, by using this synthetic data as a reference distribution for active learning, they beat a 100% manually labeled baseline while using only 25% of the human labeling effort.

What Problem Does This Paper Address?

Stance detection—identifying whether a piece of text is in favor of or against a particular topic—is a crucial tool for content moderation and mapping public opinion in online political discussions. However, political debates cover an incredibly diverse and shifting array of niche topics, making it exceptionally difficult to gather enough labeled real-world data to train traditional transformer models like BERT.

While modern generative LLMs can reason about complex topics out-of-the-box, deploying them directly in production environments introduces significant risks: they are prone to subtle biases, can output inconsistent formats, are expensive to run at scale, and are highly vulnerable to prompt injection attacks. The authors address this dilemma: How can we leverage the powerful text-generation capabilities of LLMs to improve stance detection without inheriting their online deployment risks?

Methods

The authors propose a two-pronged framework that keeps the LLM safely offline:

  1. Synthetic Data Augmentation: For a specific political question, they prompt an offline, quantized Mistral-7B-Instruct model to generate balanced sets of comments (half "in favor", half "against"). Because the target dataset is in German, they use a translation pipeline (NLLB-300M) to translate the prompt to English, generate the text, and translate the responses back to German. A lightweight BERT model is then fine-tuned on this synthetic data.
  2. Synthetic Query by Committee (SQBC): To push performance further, they introduce a novel active learning strategy. Instead of training an expensive ensemble of models to find ambiguous data points, they use the generated synthetic data as an "ensemble of experts" directly within the embedding space. For any unlabeled real-world comment, the algorithm finds its $k$-nearest synthetic neighbors. If the neighbors have highly conflicting labels (e.g., half favor, half against), the real-world sample is deemed highly ambiguous and informative, flagging it for human labeling.
Overview of the synthetic data generation and active learning pipeline

Datasets

  • X-Stance Dataset: A comprehensive multilingual benchmark containing over 48,600 comments on 140 political topics from Swiss election candidates. The authors specifically evaluate their approach on the German subset, selecting 10 diverse questions ranging from healthcare costs to electronic voting.
  • LLM-Generated Synthetic Dataset: Created using Mistral-7B, consisting of balanced datasets of varying sizes ($M \in \{200, 500, 1000\}$) tailored to each of the 10 target questions.

Key Insights and Ideas

  • Offline Generation > Online Classification: Directly prompting Mistral-7B to classify stances yielded poor results on the niche political topics of the X-Stance dataset. However, using the exact same model to generate arguments proved highly effective. LLMs excel at open-ended text generation even when they struggle with rigid classification tasks.
  • Decision Boundary Smoothing: Synthetic data acts as a regularizer. By cleanly partitioning the embedding space into "favor" and "against" clusters, it effectively smooths out the model's decision boundary, making it more robust against real-world outliers.
  • Topic Alignment is Mandatory: The authors ran an ablation study using "misaligned" synthetic data (training a model on synthetic data generated for a completely different topic). This led to virtually zero performance gains, proving that the BERT model is highly sensitive to the semantic content of the synthetic data rather than just its linguistic structure.

Key Results

  • Closing the Gap with Zero Real Data: Fine-tuning BERT solely on 1,000 synthetic samples (Baseline+Synth) achieved an average F1-score of 0.723, nearly matching the performance of a model trained on 100% true human labels (0.727), without requiring a single real-world training label.
  • Surpassing the Human Baseline: By combining synthetic data with their SQBC active learning strategy, the authors achieved an F1-score of 0.737 using only 25% of the manually labeled data. This outperformed the baseline model trained on the entire human-annotated dataset.
F1-score improvements when scaling synthetic data size
  • Direct LLM Failure: Zero-shot Mistral-7B achieved an F1-score of just 0.419, and fine-tuning it directly on the stance task caused performance to tank to 0.182, underscoring the superiority of the bi-model (LLM-to-BERT) distillation approach.

Limitations and Future Work

The primary limitation of this approach is its per-topic architecture. The authors fine-tune a separate, distinct BERT model for each individual debate question. While lightweight models like BERT are incredibly fast to train (taking less than a minute on a standard GPU), maintaining a separate model instance for every single topic in a massive discussion forum could present engineering overhead.

For future work, the authors suggest exploring why smaller open-source LLMs struggle so heavily with direct stance classification on niche datasets, and investigating methods to enforce specific distributional distances when generating synthetic reference data.

Summary updated

Abstract

Stance detection holds great potential to improve online political discussions through its deployment in discussion platforms for purposes such as content moderation, topic summarization or to facilitate more balanced discussions. Typically, transformer-based models are employed directly for stance detection, requiring vast amounts of data. However, the wide variety of debate topics in online political discussions makes data collection particularly challenging. LLMs have revived stance detection, but their online deployment in online political discussions faces challenges like inconsistent outputs, biases, and vulnerability to adversarial attacks. We show how LLM-generated synthetic data can improve stance detection for online political discussions by using reliable traditional stance detection models for online deployment, while leveraging the text generation capabilities of LLMs for synthetic data generation in a secure offline environment. To achieve this, (i) we generate synthetic data for specific debate questions by prompting a Mistral-7B model and show that fine-tuning with the generated synthetic data can substantially improve the performance of stance detection, while remaining interpretable and aligned with real world data. (ii) Using the synthetic data as a reference, we can improve performance even further by identifying the most informative samples in an unlabelled dataset, i.e., those samples which the stance detection model is most uncertain about and can benefit from the most. By fine-tuning with both synthetic data and the most informative samples, we surpass the performance of the baseline model that is fine-tuned on all true labels, while labelling considerably less data.
BibTeX
@inproceedings{wagner2025power,
  author = {Stefan Sylvius Wagner and Maike Behrendt and Marc Ziegele and Stefan Harmeling},
  title = {{The Power of LLM-Generated Synthetic Data for Stance Detection in Online Political Discussions}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ws5phQki00},
}
Figure