Balancing Cost and Effectiveness of Synthetic Data Generation Strategies for LLMs

Yung-Chieh Chan, George Pu, Apaar Shanker, Parth Suresh, Penn Jenks, John Heyer, Sam Denton

TL;DR

Fine-tuning Large Language Models (LLMs) on synthetic data is a powerful alternative to expensive human annotation, but what is the most cost-effective way to generate it? This paper from Scale AI demonstrates that the optimal strategy depends entirely on your "Budget Ratio"—the number of allowed teacher queries relative to your initial seed questions. When queries are scarce, generating new answers to existing questions wins; when the budget is large, evolving entirely new questions is the way to go.

What Problem Does This Paper Address?

Sourcing high-quality, task-specific data for fine-tuning LLMs is a major bottleneck in AI development. While human data collection is prohibitively expensive, synthetic data generation has emerged as a viable alternative. However, practitioners face a dizzying array of choices: should they generate multiple answers to existing questions, rephrase the questions, or create entirely new questions?

Crucially, how do these strategies perform under real-world constraints, such as having very few initial "seed" questions or a tight API query budget? This paper provides a systematic framework to answer these questions across different domains, helping developers maximize model performance per dollar spent.

Methods

The authors formalize synthetic data generation into a knowledge distillation framework consisting of a small set of seed instructions, an augmenter LLM ($\pi_{aug}$), a teacher LLM ($\pi_{T}$), and a student LLM ($\pi_{S}$) to be fine-tuned. They categorize generation strategies into three distinct approaches:

  1. Answer Augmentation: Generating multiple diverse responses to the original seed questions using Chain-of-Thought (CoT) prompting and temperature sampling.
  2. Question Rephrasing: Using the augmenter LLM to rewrite seed questions to have the same meaning and answer, then generating responses via the teacher.
  3. New Question Evolution: Prompting the augmenter LLM to create entirely new, semantically aligned questions with different answers, followed by teacher response generation and self-verification.

The authors evaluate these methods by tracking student performance across varying dataset sizes and a defined Budget Ratio (BR), which is the number of teacher queries divided by the seed dataset size.

Figure 1: Overview of Synthetic Data Generation Approaches. Given a seed instruction set, we have 3 different methods to create instruction-response pairs for fine-tuning our student model. We use an example seed instruction from the ARC-C training set with synthetic instructions and responses generated with Llama 3.1 70b Instruct.

Datasets

The framework was tested across three distinct task types representing common industry use cases:

  • GSM8k: Grade-school math word problems (7,500 seed instructions), evaluated on exact final answer accuracy.
  • Spider: A complex text-to-SQL dataset spanning 200 databases and 138 domains (7,000 seed instructions), evaluated on code execution accuracy.
  • ARC-C (AI2 Reasoning Challenge): Grade-school science multiple-choice questions (3,000 seed instructions), evaluated on challenge-split exact accuracy.

Key Insights and Ideas

  • The Budget Ratio Dictates the Strategy: There is no single "best" method. When your query budget is low relative to your seed size (low BR), Answer Augmentation is highly efficient. As the budget grows (high BR), New Question evolution scales much better and avoids performance plateaus.
  • Data Regimes Matter: The choice of data augmentation strategy matters immensely in low-to-mid data regimes (e.g., starting with only 100 seed instructions). In high-data regimes, the performance gap between methods narrows significantly.
  • Augmenter Quality is Task-Dependent: For creating entirely New Questions, the quality of the student model is heavily tied to the strength of the augmenter LLM. However, for Question Rephrasing, even weaker, cheaper models (like Llama 2 7B) perform robustly, offering an easy path to cost reduction.
  • The Paradox of Verification: Surprisingly, filtering out incorrect synthetic answers using ground-truth verification did not yield significant performance boosts. The authors hypothesize that students still benefit from the structured reasoning paths of incorrect teacher responses, or that filtering inadvertently harms dataset diversity by discarding unique instructions.

Key Results

  • For a small seed set of 100 instructions, the optimal strategy shifts from Answer Augmentation to New Question evolution at a Budget Ratio (BR) between 27 and 51 (translating to roughly 3,000 to 5,000 generated samples).
  • As the seed dataset grows, this transition point drops: for 1,000 seeds, the average crossover BR is 17.6; for the largest seed sets, it falls to 16.4.
  • In the GSM8k math task with only 100 seed instructions, the New Question method allowed the student model to continue improving even when scaled to 50,000 examples (500x the seed size), whereas other methods quickly plateaued.
Cost-Effectiveness and Strategy Crossover Points

Limitations and Future Work

  • The cost analysis assumes a simplified query-based cost ratio of 1:2:2 for the three methods based on the number of API calls, which may vary depending on token lengths and specific model pricing structures.
  • The study focuses primarily on a knowledge distillation setup where the teacher model is significantly larger (Llama 3.1 70B) than the student (Llama 2 7B or Mistral 7B); results might differ for self-distillation or when fine-tuning larger models.
  • Future work could explore more sophisticated filtering and curation techniques that preserve diversity while removing truly toxic or highly corrupted synthetic data.

Summary updated

BibTeX
@misc{chan2024balancing,
  author = {Yung-Chieh Chan and George Pu and Apaar Shanker and Parth Suresh and Penn Jenks and John Heyer and Sam 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