Synthesizing high-quality mathematical reasoning data without human priors remains a significant challenge. Current approaches typically rely on seed data mutation or simple prompt engineering, often suffering from mode collapse and limited logical complexity. This paper proposes a hierarchical synthesis framework that formulates data synthesis as an unsupervised optimization problem over a constraint graph followed by semantic instantiation, rather than treating it as a direct text generation task. We introduce a Legislator-Executor paradigm: The Legislator adversarially evolves structured generation blueprints encoding the constraints of the problem, while the Executor instantiates these specifications into diverse natural language scenarios. This decoupling of skeleton design from linguistic realization enables a prioritized focus on constructing complex and diverse logical structures, thereby guiding high-quality data synthesis. Experiments conducted on a total of 10 models across the Qwen, Llama, Mistral, and Gemma series demonstrate that our method achieves notable results: models fine-tuned on 1K synthesized samples outperform widely-used datasets of comparable scale (LIMO, s1K) across eight mathematical benchmarks, exhibiting superior out-of-distribution generalization.
Figures & tables
Figure 1: The MathAgent Framework. The framework consists of two decoupled phases: (1) Meta-Level Structural Evolution, where a tri-agent Legislator system (Proposer, Critic, and Moderator) iteratively optimizes a Constraint Graph G based on Style Tokens S ; and (2) Base-Level Semantic Instantiation, where the Executor grounds the optimized structural blueprint into natural language problems Q and reasoning chains A .
Model
Dataset
Elementary
Middle
Competition
Avg.
GSM8K
MATH 500
Minerva Math
Gaokao 2023en
Olympiad Bench
AIME24 (Avg@8)
AIME25 (Avg@8)
AMC23 (Avg@8)
Qwen3 Series Models
Qwen3-14B-Base
Base
94.7
80.6
37.5
67.5
46.2
15.0
15.8
66.6
53.0
LIMO
91.8
86.2
39.0
76.9
50.8
33.8
27.5
70.0
59.5
S1K
87.5
86.4
40.8
76.1
52.6
37.9
25.0
75.9
60.3
Ours
95.4
91.8
39.0
79.0
56.3
38.8
30.0
80.6
63.9
Table 1: Main Results. Model performance comparison on eight mathematical benchmarks (scores in %). Our synthesized dataset outperforms existing open-source baselines (LIMO and s1K) for SFT across multiple models.
Model
Method
Elem.
Mid.
Comp.
Avg.
Qwen2.5-7B ( Yang et al., 2025b )
Instruct
84.4
45.8
24.4
47.4
Ours
83.3
45.9
28.4
48.7
Qwen2.5-Math-7B ( Yang et al., 2024 )
Instruct
89.5
48.5
28.6
51.3
Ours
86.9
50.5
34.1
53.5
Gemma-2-9B ( Riviere et al., 2024 )
Instruct
61.1
21.8
6.0
25.7
Ours
59.9
25.2
9.3
27.9
Table 2: Performance Comparison of Our Method versus the Official instruction-tuned Version. Superior performance of our method on more challenging test sets.
Method / Variant
Avg.
Δ
Full MathAgent
45.4
-
Impact of Legislator-Executor paradigm
w/o Constraint Graph (Direct Gen.)
42.4
-3.0
Impact of Adversarial Evolution
w/o Roundtable (One-pass)
43.1
-2.3
Table 3: Ablation Study. Δ indicates the performance drop relative to the full framework. The results underscore the necessity of both structural decoupling and adversarial evolution for high-quality synthesis.
Method
Type
Size
Avg.
Qwen2.5-7B ( Yang et al., 2025b )
-
-
38.2
+ NuminaMath ( Li et al., 2024a )
SFT
1K
41.1
+ Magpie ( Xu et al., 2025 )
SFT
1K
41.5
+ LIMO ( Ye et al., 2025 )
SFT
0.8K
43.2
+ S1K ( Muennighoff et al., 2025 )
SFT
1K
43.0
+ MathAgent (Ours)
SFT
1K
45.4
Table 4: Isolating Problem Quality. By standardizing response generation for all datasets, we observe consistent gains under both SFT and IDPO. This confirms that the superiority of MathAgent stems from the inherent logical quality of the synthesized problems, independent of response-level variance.
Method
BBH
Human Eval
MMLU
TruthfulQA
MC1
MC2
Qwen2.5-7B
69.7
60.4
74.3
38.9
56.3
+ NuminaMath
67.3
58.5
73.8
38.8
55.9
+ Magpie
68.2
60.4
73.6
37.7
54.9
+ LIMO
67.8
62.2 ↑
73.8
37.9
56.2
+ S1K
67.4
63.4 ↑
73.2
37.2
55.1
Table 5: Cross-Task Generalization Benchmarks. Bold and underlined values denote the best and second-best results among the fine-tuned models, respectively. The superscript ↑ highlights performance improvements over the base model. TruthfulQA is evaluated using the standard MC1 (single-choice) and MC2 (multiple-choice) metrics. Our method effectively mitigates catastrophic forgetting while demonstrating positive transfer to code generation (HumanEval).
Figure 2: Quality and Difficulty Distributions. Quality and difficulty increase from left to right. Our method shows a significant advantage in generating high-quality, high-difficulty mathematical problems.
Figure 3: Intra-dataset Similarity Distribution. The bars represent frequency counts, while the curves denote Kernel Density Estimation (KDE). The results demonstrate that our method exhibits lower intra-similarity, indicating superior dataset diversity.
Figure 4: t-SNE Visualization of Knowledge Points. The extensive coverage of the dark blue points (representing our method) demonstrates the significant diversity of the generated mathematical problems.
Figure 5: Performance Scaling Analysis. The x-axis is plotted on a logarithmic scale for clarity. While performance generally improves with increased data scale, our method maintains a consistent and significant performance advantage over the baselines.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Comparison between simple prompts and more complex prompts (using the Qwen series prompt templates as an example).
Model
Prompt Template
Avg.
Qwen3-8B-Base ( Yang et al., 2025a )
simple
32.5
Qwen-complex
49.7
Llama-3.1-8B ( Grattafiori et al., 2024 )
simple
10.3
Llama-complex
1.4
Llama-3.1-8B-Instruct ( Grattafiori et al., 2024 )
simple
23.5
Llama-complex
31.0
Appendix
Table 6: Performance comparison using Simple vs. Complex prompts. Complex prompts degrade the performance of Llama-Base but benefit Qwen-Base and Llama-Instruct.
Model
Peak Learning Rate
Batch Size
Training Epochs
Qwen-7B/8B Series
1e-5
2×8
5
& Llama-3.1-8B
Qwen3-14B-Base
5e-6
1×8
5
& Gemma-2-9B
Qwen3-4B-Base
2e-5
4×8
5
& Llama-3.2-4B
Appendix
Table 7: Training Hyperparameters for Different Models. Note that " ×8 " in the batch size column denotes the total batch size calculated as per-device batch size × number of devices (8).
Figure 7: Average Maximum Similarity Between Training and Test Datasets: A lower similarity score indicates a reduced likelihood of data leakage. This figure demonstrates that our synthetic data does not carry a higher risk of data leakage compared to LIMO and s1K.
Figure 8: Case Study.
Figure 9: Prompt for the Proposer.
Figure 10: Prompt for the Critic.
Figure 11: Prompt for the Moderator
Figure 12: Prompt for the Question Synthesizer.
Figure 13: Prompts for Evaluating Mathematical Problem Quality and Difficulty.