SoftSRV: Learn to generate targeted synthetic data.

Giulia DeSalvo, Jean-François Kagy, Lazaros Karydas, Afshin Rostamizadeh, Sanjiv Kumar

TL;DR

This paper introduces SoftSRV, a novel framework for generating targeted synthetic data to improve the performance of smaller language models. Instead of relying on labor-intensive and domain-specific human-engineered prompts, SoftSRV uses a data-driven approach to steer a frozen large language model (LLM) to produce high-quality synthetic data. This method significantly outperforms traditional prompt engineering techniques and generates data that more closely matches the target distribution.

What Problem Does This Paper Address?

Training smaller language models to achieve performance comparable to much larger ones often requires vast amounts of high-quality training data. However, obtaining such data can be challenging, especially for specialized domains where natural text is scarce or difficult to procure. Current methods for generating synthetic data, primarily relying on prompt engineering, are effective but suffer from several drawbacks: they are labor-intensive to craft, require domain-specific expertise, and can be idiosyncratic, making them difficult to generalize. Furthermore, these methods don't directly optimize for data distribution matching. This paper aims to address these limitations by proposing a more automated, generalizable, and data-driven approach to synthetic data generation.

Methods

SoftSRV frames synthetic data generation as an autoencoder-like process. It takes a sample from a target distribution and uses a frozen pre-trained LLM to generate synthetic sequences. The core innovation lies in replacing the LLM's standard input embedding layer with a trainable, parameterized embedding module. This module, trained via a data-driven loss minimization (specifically, a next-word-prediction loss), learns to steer the LLM to produce outputs that resemble the target distribution.

The framework offers several parameterizations for these trainable embeddings, including:

  • SoftSRV Non-contextual Parameterization (SSNP): A basic parameterization where the embedding is directly learned.
  • SoftSRV Mixture Parameterization (SSMPk): Uses a mixture of "basis" embeddings.
  • SoftSRV MLP Concatenated Parameterization (SSMC): Employs small MLPs whose outputs are concatenated to form the embedding, allowing for more expressive context.

Crucially, SoftSRV requires minimal human intervention (no prompt engineering) and can be applied across various domains with little to no specialization.

Datasets

The paper evaluates SoftSRV on three benchmark datasets:

  • MBPP (Mostly Basic Python Problems): For coding tasks.
  • GSM8K: For grade-school math word problems.
  • BoolQ: For general reasoning (binary question answering).

The generated synthetic data is used to fine-tune a smaller Gemma 2B model. The performance is compared against models fine-tuned on data generated by traditional prompt engineering methods (PT and PTSR) and, in some cases, the original non-synthetic training data.

Key Insights and Ideas

  • Parametric Embeddings Outperform Natural Language Prompts: The core idea that trainable embeddings can be more expressive and effective than natural language prompts for guiding LLMs is a key insight. This allows for a more direct, data-driven optimization of the generated data's quality.
  • Generality Across Domains: SoftSRV's ability to work effectively across diverse domains (coding, math, reasoning) without domain-specific tuning highlights its generalizability and practical utility.
  • Data Scarcity Advantage: SoftSRV is particularly well-suited for data-scarce settings, where traditional prompt engineering methods might struggle due to limited seed examples.
  • High-Fidelity Data Generation: The MAUVE scores indicate that SoftSRV-generated data is significantly closer to the target distribution compared to prompt-engineered data, suggesting it's a high-fidelity generation method.

Key Results

  • Superior Downstream Performance: Models fine-tuned on SoftSRV-generated data (specifically the SSMC parameterization) consistently outperformed models fine-tuned on data generated by prompt template methods (PT and PTSR) across MBPP, GSM8K, and BoolQ benchmarks. For instance, on MBPP, SSMC achieved a 0.372 pass@1 score, compared to 0.296 for PT.
  • Contextual Embeddings are Crucial: Empirical results showed that contextual SoftSRV embeddings (SSMC and SSMP2) significantly outperformed the non-contextual SSNP, underscoring the importance of conditioning the embedding on context.
  • SSMC is the Preferred Parameterization: The SSMC parameterization generally yielded the best results, demonstrating the benefit of its more expressive, MLP-based approach.
  • Comparable to Curated Datasets: For GSM8K, SoftSRV-generated data achieved performance comparable to a highly curated dataset (TinyGSM), which is encouraging given SoftSRV's automated nature.
  • Improved Data Distribution Matching: SoftSRV consistently achieved higher MAUVE scores, indicating its generated data is a better match to the target distribution than prompt-engineered data.

Limitations and Future Work

  • Computational Cost: While SoftSRV requires less human effort than prompt engineering, training the parameterized embeddings still involves computational resources.
  • Out-of-Domain Generalization: While SoftSRV shows promise, its performance on out-of-domain tasks (e.g., evaluating a model trained on BoolQ data on TriviaQA) was not always superior to prompt-engineered methods, though it was competitive.
  • Future Work: The authors suggest extending SoftSRV to an adaptive setting where it can generate targeted fine-tuning data based on a small model's mistakes, which could be a promising direction. They also note that while MAUVE scores are a good indicator of distribution matching, they are not a direct predictor of downstream performance.

Summary updated

Abstract

We present a novel framework, SoftSRV, that is used to generate targeted synthetic fine-tuning data for improving task-specific model performance. Given a sample from a target distribution, our proposed framework uses a data-driven loss minimization approach to steer a frozen large language model (LLM) to generate synthetic sequences that are similar to those from the target distribution. SoftSRV provides a practical improvement over common prompt engineering approaches that rely on human-engineered prompt-templates, which can be idiosyncratic, labor-intensive to craft, and may need to be specialized per domain. We empirically evaluate our method against standard baselines guiding a large LLM to generate synthetic data to fine-tune a smaller language model on three different domains (coding, math, reasoning). We perform these evaluations without any particular specialization of the framework to each domain, emphasizing the generality of our approach. We find that SoftSRV improves upon typical prompt engineering approaches, generating targeted data that leads to fine-tuned models with significantly better task-specific performance. In addition, SoftSRV-generated data better matches the target distribution according to the MAUVE similarity metric.
BibTeX
@inproceedings{desalvo2025softsrv,
  author = {Giulia DeSalvo and Jean-François Kagy and Lazaros Karydas and Afshin Rostamizadeh and Sanjiv Kumar},
  title = {{SoftSRV: Learn to generate targeted synthetic data.}},
  booktitle = {SynthData @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=Nd2Ml58XwC},
}
Figure