Balancing Cost and Effectiveness of Synthetic Data Generation Strategies for LLMs

Yung-Chieh Chan, George Pu, Apaar Shanker, Parth Suresh, Samuel Marc Denton

TL;DR

Fine-tuning Large Language Models (LLMs) requires vast amounts of data, but human-generated data is expensive. This paper explores three synthetic data generation strategies (Answer Augmentation, Question Rephrasing, and New Question) and finds that the optimal approach depends heavily on the ratio of available queries to the initial seed dataset size. Understanding this "budget ratio" is key to cost-effectively improving LLM performance, especially in data-scarce scenarios.

What Problem Does This Paper Address?

As LLMs become more powerful and are applied to a wider array of tasks, the bottleneck for improving their performance has shifted from model architecture to data availability. Creating high-quality, task-specific datasets for fine-tuning is crucial, but relying solely on human-annotated data is often prohibitively expensive, especially for niche domains or when rapid iteration is needed. While synthetic data generation offers a promising alternative, its effectiveness, particularly in resource-constrained settings and for tasks that are difficult to verify, remains unclear. This paper aims to demystify this by systematically evaluating different synthetic data generation strategies under varying data constraints.

Methods

The authors propose a framework to evaluate synthetic data generation strategies for LLMs. They categorize these strategies into three main types:

  1. Answer Augmentation: This involves generating diverse responses to existing seed instructions. The goal is to enrich the reasoning paths, lexical choices, and semantic content of the answers. This is achieved using Chain-of-Thought prompting with a teacher LLM and temperature sampling to increase response variety.
  2. Question Rephrasing: Here, the seed instructions themselves are reformulated by an "augmenter" LLM to create new instructions. These rephrased questions are then paired with responses from a teacher LLM. The aim is to create variations of existing questions that maintain the same underlying answer.
  3. New Question Evolution: This strategy involves generating entirely new questions based on the seed instructions but designed to have different final answers. This approach uses a self-verification process to ensure the generated questions are answerable and correctly formatted, aiming for more semantic alignment with the target domain and greater diversity.

The core of their evaluation involves training a "student" LLM using data generated by these strategies under different constraints, such as the size of the initial seed instruction set and the "query budget" (the number of queries allowed to the teacher model). They also introduce a "budget ratio" (BR) as a key metric, defined as the query budget divided by the seed instruction set size, to analyze cost-effectiveness.

Datasets

The paper uses three diverse datasets for evaluation:

  • GSM8k: A dataset of grade-school math word problems, used for math reasoning tasks.
  • Spider: A text-to-SQL dataset for code generation tasks.
  • ARC-C: A reasoning-focused question-answering dataset comprising grade-school science questions, used for general question answering.

The authors also mention using a subset of the ARC-C training set for illustrative examples.

Key Insights and Ideas

  • The Budget Ratio is King: The most significant finding is that the optimal synthetic data generation strategy is not universal. It critically depends on the ratio between the query budget and the seed instruction set size (BR).
  • Low BR Favors Augmentation: When the query budget is limited relative to the initial data (low BR), generating new answers to existing questions (Answer Augmentation) is the most effective strategy. This suggests maximizing the value from existing prompts.
  • High BR Favors New Questions: As the query budget increases (high BR), generating entirely new questions (New Question Evolution) becomes the superior approach. This indicates that exploring new problem spaces yields greater gains when resources allow.
  • Data Regimes Matter: The choice of augmentation method and other design choices have a much more substantial impact in low to mid data regimes (fewer initial instructions or smaller synthetic datasets) than in high data regimes. This highlights the importance of strategic data generation when resources are scarce.
  • New Question Evolution is Generally Stronger: Across the board, New Question Evolution tends to outperform Question Rephrasing in terms of cost and scalability.
  • Verification's Limited Impact: Surprisingly, verifying synthetic responses with ground truth answers did not significantly improve student LLM performance. This suggests that LLMs can still benefit from some level of noise or incorrectness, or that verification might reduce data diversity.
  • Augmenter Model Choice Matters for New Questions: The performance of the New Question strategy is highly sensitive to the capability of the augmenter LLM. Weaker augmenter models can lead to substantial performance drops. Conversely, Question Rephrasing is more robust to weaker augmenter models.

Key Results

  • In GSM8k experiments with 100 seed instructions, New Question Evolution consistently improved accuracy as the synthetic dataset scaled, while other methods plateaued.
  • For Spider and ARC-C, the optimal augmentation method varied when synthetic data size was between 10,000 and 50,000 samples.
  • The paper provides specific BR ranges where the optimal strategy shifts. For instance, with 100 seed instructions, this shift occurs at a BR between 27 and 51 (approximately 3,000-5,000 samples). As seed set size grows, the average BR for this shift decreases.
  • When fine-tuning Mistral 7B (a different student model), the cost-effectiveness patterns held, with the optimal strategy shifting at a BR of 12, aligning with previous findings.
  • Table 2 shows effectiveness metrics (E, A, B, Alpha, Beta, R) for each generation method across tasks, with New Question generally showing higher R values, indicating greater potential for scaling.

Limitations and Future Work

  • Verification's Role: The authors note that verification of synthetic responses did not yield significant improvements. They hypothesize this could be due to LLMs benefiting from some incorrect responses or verification reducing data diversity. Future work could explore more nuanced verification strategies.
  • Augmenter Model Sensitivity: The New Question strategy's reliance on a capable augmenter LLM is a limitation. Future research could investigate methods to make this strategy more robust to weaker augmenter models.
  • Cost Modeling: While the paper uses a budget ratio, a more detailed cost model that accounts for the varying costs of different LLMs and query types could provide even finer-grained guidance.
  • Task Diversity: While the paper covers math, coding, and general QA, exploring a wider range of tasks could further validate the generalizability of the findings.
  • Teacher Model Choice: The paper primarily uses Llama 3.1 70B Instruct as the teacher model. Investigating the impact of different teacher models on synthetic data quality and effectiveness would be valuable.

Summary updated

BibTeX
@misc{chan2024balancing,
  author = {Yung-Chieh Chan and George Pu and Apaar Shanker and Parth Suresh and Samuel Marc Denton},
  title = {{Balancing Cost and Effectiveness of Synthetic Data Generation Strategies for LLMs}},
  year = {2024},
  eprint = {2409.19759},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.19759},
}
Figure