Synthetic Data for any Differentiable Target

Tristan Thrush, Sung Min Park, Herman Brunborg, Luke Bailey, Marcel Rød, Neil Band, Christopher Potts, Tatsunori Hashimoto

TL;DR

The Dataset Policy Gradient (DPG) is a new reinforcement learning primitive that allows researchers to optimize synthetic data generators for specific, differentiable downstream goals. By using metagradients to attribute a model's final performance back to individual training examples, DPG can "steer" a model into bizarrely specific states—such as encoding a scannable QR code directly into its neural weights—simply by fine-tuning it on the generated text.

What Problem Does This Paper Address?

While synthetic data is increasingly used to train large language models (LLMs), our control over it remains relatively coarse. We usually rely on heuristics or "LLM-as-a-judge" to filter data, but we lack a principled way to optimize a data generator for a specific downstream outcome.

The fundamental challenge is one of credit assignment: if you train a model on a thousand synthetic examples and it performs well on a benchmark, which specific examples helped? Standard reinforcement learning (RL) would treat the entire training run as a single episode with one reward, which is computationally ruinous. The authors sought a way to provide per-example rewards that accurately reflect how much a single piece of synthetic text contributes to a final, differentiable metric.

Methods

The authors introduce Dataset Policy Gradient (DPG). The core idea is to treat the training of a "target model" as a differentiable process.

  1. Inner Loop: A generator (the "policy") produces a batch of synthetic examples. A target model is then trained on these examples using a learning algorithm (like Adam or SGD).
  2. Reward Signal: Instead of a simple scalar, DPG uses metagradients. It calculates the gradient of a downstream metric (e.g., loss on a specific task) with respect to the weights assigned to each training example. This tells the generator exactly how much increasing the "importance" of a specific synthetic text would improve the final result.
  3. Outer Loop: These metagradient scores serve as rewards for the generator, which is updated using Group Relative Policy Optimization (GRPO).
The DPG framework: A generator creates data, a target model trains on it, and metagradients provide the reward signal.

The authors provide a theoretical proof showing that this per-example reward approach closely approximates the true, but intractable, gradient of the generator’s objective.

Datasets

  • Prompts: The generator was prompted to rephrase English Wikipedia articles.
  • Evaluation Benchmarks: The team used the multilingual LAMBADA dataset (German, Spanish, French, Italian) to see if the generator could learn to translate text to satisfy a multilingual loss.
  • Custom Targets: To test the limits of the method, they created "exotic" targets, including a 21x21 QR code pattern, the number "67", and a specific 32-character UUID string.

Key Insights and Ideas

  • Weights as a Canvas: The most striking finding is that training data can be optimized to manipulate a model's internal parameters with surgical precision. By targeting the weights of the LM-head, the generator produced text that, when used for fine-tuning, "drew" images into the model's brain.
  • The Optimizer Matters: A crucial technical insight is that using Adam in the inner training loop is essential. While theoretical proofs often assume SGD for simplicity, the authors found that the metagradient signal from SGD was often too weak or unstable to achieve complex targets like weight-encoding.
  • Subliminal Learning: In the translation experiments, the generator was never told to translate. It was simply told to "rephrase" Wikipedia articles. However, because the reward was tied to a Spanish language modeling loss, the generator discovered that translating the English input into Spanish was the best way to get a high reward.

Key Results

The DPG framework achieved several "impossible" feats of data engineering:

  • Weight Manipulation: The generator successfully produced text that encoded a scannable QR code into GPT-2's weights.
  • Pattern Encoding: As seen in Figure 3, using Adam with 96 training steps allowed the generator to perfectly encode the pattern "67" into the model's sign'd weight updates.
Validation results for encoding the pattern '67' and lowering weight norms.
  • Multilingual Generalization: The generator learned to translate English Wikipedia into four different languages to minimize downstream loss, outperforming baselines like "fasttext" classification or embedding similarity.
  • UUID Generation: The generator learned to produce a specific, unnatural 32-character UUID that was entirely absent from its initial rollouts.

Limitations and Future Work

  • Compute Intensity: While more efficient than naive RL, metagradients still require a 3–5× increase in memory and compute compared to standard training. This limited the authors to using smaller target models (like GPT-2) for multi-step experiments.
  • Security Risks: The authors explicitly note the potential for data poisoning. If an adversary can optimize synthetic data to induce arbitrary properties in a model, they could potentially embed subtle backdoors or biases that are difficult to detect.
  • Future Directions: The authors suggest exploring non-differentiable targets via hybrid approaches and scaling the method to even larger models to see if these "subliminal" training effects become more pronounced.

Summary updated

BibTeX
@inproceedings{thrush2026synthetic,
  author = {Tristan Thrush and Sung Min Park and Herman Brunborg and Luke Bailey and Marcel Rød and Neil Band and Christopher Potts and Tatsunori Hashimoto},
  title = {{Synthetic Data for any Differentiable Target}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=Iudff0keb0},
}
Figure