Synthesis by Design: Controlled Data Generation via Structural Guidance

Lei Xu, Sirui Chen, Yuxuan Huang, Chaochao LuarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have demonstrated significant capabilities in natural language tasks, yet multi-step mathematical reasoning remains a persistent challenge. Traditional data augmentation techniques, which typically involve rephrasing existing problems, suffer from three primary limitations: the absence of intermediate ground-truth labels, the risk of "teacher" model hallucinations poisoning training data, and a "complexity ceiling" where models struggle to generate problems more difficult than those they can already solve. This paper introduces "Synthesis by Design," a framework that addresses these issues by leveraging structural guidance through executable code.

The Synthesis by Design Framework

The core of the proposed method is the use of Python code as a logical bridge between natural language and structured reasoning. The pipeline consists of four main stages:

  1. Structure Extraction: Natural language math problems are translated into Python code, where each line represents a discrete reasoning step and variables capture intermediate results.
  2. Structural Intervention: The resulting code is treated as a computational graph. Researchers can programmatically modify this graph—for instance, by altering leaf nodes or introducing "proxy nodes" (new operations)—to increase problem complexity.
  3. Code-to-Question Translation: The modified code, containing the full logic and final answer, is translated back into a natural language word problem. This shift from reasoning to translation allows models to generate complex problems with high accuracy.
  4. Quality Control: A multi-level validation process uses local code execution to verify mathematical correctness and external LLM judges to ensure linguistic coherence.
The Synthesis by Design pipeline: translating word problems to code, performing structural interventions, and generating new questions.

Datasets and Benchmarks

Using GSM8K and MATH as seed datasets, the authors generated a 39K-sample training set comprising both direct translations and "extended" (more complex) problems. Additionally, they introduced MATH-Struct and GSM8K-Struct, new benchmarks designed to evaluate model performance across varying logic chain lengths. By quantifying difficulty through the number of code blocks (steps), these benchmarks provide a granular view of how reasoning performance decays as complexity increases.

Distribution of reasoning steps across GSM8K and MATH datasets following structural interventions.

Results and Insights

Fine-tuning open-source models such as Mistral-7b, Qwen-2-7b, and Llama-3-8b on this structurally guided data yielded significant performance improvements. Mistral-7b, for example, achieved 68.31% on GSM8K, outperforming models trained on MetaMath (60.65%).

Key insights from the study include:

  • Code as a "Narrow Channel": Forcing reasoning through Python code creates a predictable and traceable logical path, reducing the ambiguity inherent in natural language.
  • Bypassing the Complexity Ceiling: Providing the "skeleton" of a hard problem via code enables models to synthesize training data for tasks they could not solve from scratch.
  • Long-Range Reasoning: Models trained with this method demonstrated superior resilience on the "Struct" benchmarks, maintaining higher accuracy as problem length increased compared to baseline models.

Limitations and Future Work

While effective, the framework's rigorous validation process results in a retention rate of approximately 51% for GSM8K and 35% for MATH, indicating significant computational overhead. Furthermore, as problems become extremely long, maintaining narrative coherence in the generated word problems becomes challenging. Future research may explore combining structural guidance with traditional paraphrasing to scale data volume while preserving logical integrity.

Summary updated

BibTeX
@misc{xu2025synthesis,
  author = {Lei Xu and Sirui Chen and Yuxuan Huang and Chaochao Lu},
  title = {{Synthesis by Design: Controlled Data Generation via Structural Guidance}},
  year = {2025},
  eprint = {2506.07664},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.07664},
}
Figure