Abstract
This study investigates the utility of Large Language Models (LLMs), specifically GPT-2, in generating synthetic training data for text classification tasks. We explore scenarios where synthetic data serves as a complement to or a substitute for real data, particularly in contexts of data scarcity or privacy constraints. Our findings indicate that while synthetic data struggles to fully replace real data in complex tasks, it significantly enhances simpler models by providing lexical variety. Furthermore, we demonstrate that automatic filtering of synthetic data is crucial for maintaining performance.
Introduction
Supervised learning relies heavily on high-quality labeled data, which is often scarce or restricted due to privacy concerns. This research explores whether generative transformers like GPT-2 can "manufacture" artificial datasets to mitigate these issues. We evaluate three primary use cases: augmenting existing datasets (Complement), replacing sensitive data (Substitution), and improving the performance of interpretable models (Explainability).
Methodology
The proposed pipeline involves fine-tuning a GPT-2 model (774M parameters) on specific classes to generate targeted synthetic text. To prevent data leakage, a de-duplication step removes any generated sequences of five or more words identical to the training set.
A critical component of the methodology is the Automatic Filtering ($G^f$) step. Recognizing that LLMs can drift off-topic, a classifier trained on real data validates the synthetic samples, discarding those that do not align with the intended class. We compare four training strategies: real data ($T$), purely synthetic data ($G$), mixed data ($T+G$), and sequential training ($G$ then $T$).
Experimental Setup
The approach was tested on two distinct benchmarks:
- MediaEval 2020 (FakeNews): A complex English dataset of tweets regarding conspiracy theories, characterized by high class imbalance.
- FLUE (CLS-FR): A French dataset of Amazon product reviews for binary sentiment analysis.
Results and Discussion
The impact of synthetic data varies significantly by model type and task complexity. For Transformer-based models, the sequential training approach ($G$ then $T$) yielded the best results, slightly outperforming the baseline on both benchmarks.
However, the most substantial gains were observed in simpler "bag-of-words" models like Logistic Regression. These models lack the inherent semantic knowledge of pre-trained Transformers; synthetic data provides them with a broader vocabulary and lexical variety, effectively bridging the performance gap between interpretable and black-box models. For instance, on the French dataset, adding synthetic data moved the Logistic Regression model from 84.77% to 88.36% F1.
The necessity of filtering is evident when comparing raw synthetic data to filtered data.
As shown in the table above, raw synthetic data ($G$) often leads to a performance drop compared to real data ($T$), particularly in the complex MediaEval task. However, applying automatic filtering significantly narrows this gap.
With filtering ($G^f$), the purely synthetic approach achieves results much closer to the real-data baseline. In the French sentiment analysis task, the filtered synthetic data even allows the sequential approach to exceed the baseline performance (95.96% vs 95.44% F1).
Conclusion and Future Work
While LLM-generated data is not yet a perfect substitute for real data in nuanced classification tasks, it is a powerful tool for data augmentation and for boosting the performance of interpretable models. Future research should address the "filter paradox"—the reliance on real data to validate synthetic data—and explore the application of these techniques to more granular NLP tasks like Named Entity Recognition.
Summary updated