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

Guiding Generative Language Models for Data Augmentation in Few-Shot Text Classification

Aleksandra Edwards, Asahi Ushio, Jose Camacho-Collados, Hélène de Ribaupierre, Alun PreecearXiv 2021

In the world of machine learning, "more data" is the standard prescription for better performance. But what happens when you’re working in a highly specialized field—like medical research or social safeguarding—where data is scarce and labeling requires expensive expert time?

A recent paper titled "Guiding Generative Language Models for Data Augmentation in Few-Shot Text Classification" explores how to bridge this gap. The researchers demonstrate that we can use large language models (LLMs) like GPT-2 to "hallucinate" high-quality training data, provided we give them the right starting point.

TL;DR

The researchers show that fine-tuning GPT-2 on just a handful of examples allows it to generate effective synthetic training data for few-shot text classification. Crucially, they found that having a domain expert hand-pick the "seed" examples for the generator significantly boosts the performance of the final classifier in specialized domains.

What Problem Does This Paper Address?

Deep learning models are data-hungry. In "few-shot" scenarios—where you might only have 5 or 10 examples per category—models often fail to generalize. Data Augmentation (DA) is the usual fix, but traditional methods like swapping words for synonyms or "back-translation" often produce clunky, ungrammatical, or semantically incorrect text.

While generative models like GPT-2 can create coherent new sentences, they often suffer from "label drift"—generating a sentence that looks like it belongs to Class A when it was supposed to represent Class B. This paper tackles how to guide these models to produce high-quality, label-accurate synthetic data, especially for niche domains where the model's pre-existing knowledge is thin.

Methods

The authors propose a framework for Text Generation-based Data Augmentation (TG-based DA). Instead of just asking GPT-2 to write more, they experimented with how to "seed" the generation process:

  1. Fine-tuning Strategy: They found that fine-tuning a separate GPT-2 model per label was the most effective way to ensure the generated text stayed true to its intended category.
  2. Seed Selection Strategies: This is the paper's core innovation. They compared four ways to choose the original "seed" sentences used to prompt the generator:
  3. Random: Picking seeds at random (the baseline).
  4. Maximum Nouns: Selecting sentences rich in domain-specific terminology (nouns).
  5. Subclass-guided: Ensuring seeds are pulled evenly from various sub-categories to maintain diversity.
  6. Human-in-the-loop: Having domain experts pick the most "representative" examples of a class.

The overall workflow is illustrated in the methodology overview below:

Overview of the methodology

Datasets

The study evaluated these methods across three distinct datasets:

  • Safeguarding Reports: A highly specialized dataset of social reports involving criminology, healthcare, and law. This served as the primary "specialized domain" test.
  • 20 Newsgroups: A classic benchmark of internet forum posts across broad topics like "science" and "politics."
  • Toxic Comments: A large-scale dataset from Wikipedia used for detecting abusive speech.

Key Insights and Ideas

  • The "Where" Matters More Than the "How Much": In specialized domains, the quality of the seed examples is paramount. If you start with a poor representative of a class, the LLM will simply amplify that "noise."
  • Experts are Worth the Time: While it takes time for an expert to pick seeds, it is far more efficient than generating thousands of random synthetic examples that might actually confuse the classifier.
  • GPT-2 already "knows" the general stuff: For common topics (like those in 20 Newsgroups), random seed selection works fine because the model already has a strong internal representation of those subjects. For niche topics (like Safeguarding), the model needs the "expert nudge" to stay on track.
  • Label Preservation is the Bottleneck: The biggest risk in generative DA is "label distortion." Fine-tuning per label acts as a guardrail, preventing the model from mixing up categories.

Key Results

The results were striking, particularly for the specialized Safeguarding domain. As shown in the Micro-F1 results (Figure 3 in the paper), the expert-guided and noun-guided strategies consistently outperformed random selection and traditional non-generative baselines.

Figure 3: Micro-F1 results with 5 and 10 ‘base’ in- stances per label for the Safeguarding reports dataset.

In the Safeguarding "sentence-level" task, starting with just 5 base instances, the expert-guided DA reached a Micro-F1 of 0.337, compared to just 0.242 for the non-augmented baseline. By the time they added 20 synthetic instances to 10 base instances, the expert-guided approach reached 0.414, nearly doubling the performance of the original tiny dataset.

The full comparison across all datasets (Figure 6) confirms that GPT-based augmentation (labeled TG (GPT2)) frequently outperforms word-replacement (WR) and sentence-replacement (SR) strategies.

Full classification results table

Limitations and Future Work

Despite the success, the authors acknowledge several hurdles:

  • Computational Cost: Running and fine-tuning LLMs like GPT-2 requires significant GPU resources, which might not be available in all real-world settings (e.g., on-site at a small non-profit).
  • Expert Bias: Using only two experts for seed selection might introduce specific biases into the training data.
  • Language Constraints: The study was limited to English. The authors suggest that expert involvement might be even more critical for low-resource languages.

Future research will look into scaling this to even larger models like GPT-3 and determining the "saturation point"—the moment when adding more synthetic data starts to hurt rather than help.

Summary updated

BibTeX
@misc{edwards2021guiding,
  author = {Aleksandra Edwards and Asahi Ushio and Jose Camacho-Collados and Hélène de Ribaupierre and Alun Preece},
  title = {{Guiding Generative Language Models for Data Augmentation in Few-Shot Text Classification}},
  year = {2021},
  eprint = {2111.09064},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.09064},
}
Figure