NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Data Generation Using Large Language Models for Text Classification: An Empirical Case Study

Yinheng Li, Rogerio Bonatti, Sara Abdali, Justin Wagle, Kazuhito KoishidaarXiv 2024 · DOI

Introduction

In Natural Language Understanding (NLU), the acquisition of high-quality, human-labeled data remains a significant bottleneck. For emerging or niche text classification tasks, researchers often encounter a "cold start" problem characterized by sparse data and prohibitive labeling costs. While Large Language Models (LLMs) offer a potential solution through synthetic data generation, their effectiveness is contingent upon prompting strategies, task complexity, and inherent model biases. This study provides an empirical roadmap for leveraging LLMs to augment training sets effectively.

Methodology

The researchers implemented a pipeline where an LLM (specifically GPT-3.5 turbo) generates synthetic training data to train a smaller, more efficient "student" model, such as RoBERTa. This approach aims to distill the knowledge of a massive generative model into a specialized classifier suitable for production environments.

The comprehensive data augmentation pipeline: LLMs generate synthetic samples which are combined with original training data to train a RoBERTa classification model.

The study evaluated five distinct prompting strategies:

  • Zero-shot: Generating examples based solely on a task description.
  • Zero-shot Topic: A two-stage process where the LLM first identifies relevant topics and then generates examples for those specific categories.
  • One-shot / Few-shot: Providing the LLM with one or more human-labeled examples (3 or 5) to guide the generation process.
  • Data Mixing: Comparing "synthetic only" training against "augmented" training, which combines synthetic data with a small set (100 samples) of real-world data.

Key Insights

The Power of Topic Guidance

The "Zero-shot Topic" method emerged as a superior strategy. By requiring the LLM to generate data for specific, diverse topics, the researchers mitigated the "repetition trap"—a common issue where LLMs produce highly similar, generic examples that offer limited signal for the student model.

The Necessity of Hybrid Data

A critical finding was that purely synthetic datasets rarely achieve peak performance. Integrating as few as 100 real-world samples into the synthetic pool resulted in significant F1 score improvements across nearly all benchmarks, including emotion classification (EMO), news topic classification (NYT), and sentiment analysis.

Cost and Efficiency

The economic advantages of LLM-based generation are substantial. For the SST-2 dataset, manual labeling of 3,000 samples costs approximately $221–$300 and requires over 16 hours of labor. In contrast, generating the same volume via GPT-3.5 costs roughly $14.37$ and takes less than an hour.

Results

The quantitative results underscore the efficacy of the augmented approach. As illustrated in the performance breakdown for the EMO dataset, the hybrid "augmented" strategy consistently outperformed models trained on synthetic data alone, regardless of the prompting technique used.

F1 scores for the EMO (emotion classification) task, demonstrating that augmented data (orange) consistently outperforms synthetic-only data (blue) across various few-shot and zero-shot prompting strategies.

Limitations and Bias

Despite the performance gains, the study identified "bias leakage." In the BoolQ task, the LLM frequently included linguistic shortcuts (e.g., using specific words like "only" for "False" answers), allowing the student model to achieve high scores without genuine comprehension. Furthermore, while GPT-3.5 is effective, future research is needed to determine if more advanced models like GPT-4 can further reduce the reliance on real-world data mixing.

Conclusion

LLMs are powerful tools for overcoming data scarcity in text classification. However, the "secret sauce" for high-performance models is not just more data, but a diverse mix of topic-guided synthetic samples and a foundational set of real-world examples.

Summary updated

BibTeX
@misc{li2024data,
  author = {Yinheng Li and Rogerio Bonatti and Sara Abdali and Justin Wagle and Kazuhito Koishida},
  title = {{Data Generation Using Large Language Models for Text Classification: An Empirical Case Study}},
  year = {2024},
  eprint = {2407.12813},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.12813},
}
Figure