LLM Agents for Automated Post-Training via Structured Recipe Optimization
Organizations: LIGHTSPEED · University of Cambridge · Independent Researcher
Abstract
Automated post-training transforms pre-trained large language models (LLMs) into models capable of handling diverse domains by automatically constructing and optimizing a recipe of coupled decisions over data sources, data processing, cross-domain composition, and training configuration under a limited experimental budget. Existing automation either searches predefined recipe spaces that enable systematic optimization but remain fixed rather than adapting their available choices to the target tasks, or uses open-ended agents that discover task-specific choices but leave them implicit in trial-level edits, limiting their systematic reuse and recombination across trials. To fill this gap, we introduce optimization over a task-adapted recipe space, a novel paradigm that can adapt the recipe space itself to the target tasks while representing its choices explicitly for systematic reuse, recombination, and joint optimization. We instantiate this paradigm with Structured Recipe Optimization (SRO), comprising an LLM-based Recipe-Space Designer that constructs the task-adapted recipe space and a Multi-Domain Recipe Optimizer that uses structured trial evidence to guide LLM candidate construction and multi-objective Bayesian trial selection. Extensive experiments show that SRO achieves the highest average score in all evaluated target-model and agent-LLM combinations. In joint post-training across three capability domains and six benchmarks, SRO reaches 41.1 versus 15.4 for the strongest baseline on Qwen3-1.7B with GPT-5.4, and 53.8 versus 40.8 on Qwen3-4B with DeepSeek-V4-Flash. Our code is available at https://github.com/RuohLiuq/SRO.
Figures & tables
| Benchmark Scores ( ) | ||||||
| Model | Agent LLM | Harness | GSM8K | GPQA Main | HumanEval | Avg. ( ) |
| Qwen3-1.7B-Base | – | None | 12.7 | 14.1 | 7.9 | 11.6 |
| DeepSeek-V4-Flash | PostTrainBench | 49.0 | 27.5 | 54.9 | 43.8 | |
| AutoTrainess | 79.1 | 28.1 | 53.7 | 53.6 | ||
| SRO (Ours) | 68.2 | 34.2 | 64.6 | 55.6 | ||
| GPT-5.4 | PostTrainBench | 48.4 | 28.6 | 39.0 | 38.7 | |
| Benchmark Scores ( ) | |||||||||
| Mathematical Reasoning | Coding & Tool Use | Science & Health | |||||||
| Model | Agent LLM | Harness | AIME 2025 | GSM8K | BFCL | HumanEval | GPQA Main | HealthBench | Avg. ( ) |
| Qwen3-1.7B-Base | – | None | 0.0 | 12.7 | 0.0 | 7.9 | 14.1 | 7.5 | 7.0 |
| DeepSeek-V4-Flash | PostTrainBench | 0.0 | 58.8 | 92.0 | 35.4 | 27.9 | 8.6 | 37.1 | |
| AutoTrainess | 0.0 | 73.8 | 92.0 | 58.5 | 30.8 | 15.6 | 45.1 | ||
| SRO (Ours) | 6.7 | 76.7 | 91.0 | 58.5 | 16.1 | 22.7 | 45.3 | ||
| Benchmark Scores ( ) | ||||||||
| Mathematical Reasoning | Coding & Tool Use | Science & Health | ||||||
| Model | Variant | AIME 2025 | GSM8K | BFCL | HumanEval | GPQA Main | HealthBench | Avg. ( ) |
| Qwen3-1.7B | Full SRO | 6.7 | 76.7 | 91.0 | 58.5 | 16.1 | 22.7 | 45.3 |
| w/o structured recipe search | 0.0 | 57.3 | 85.0 | 34.1 | 23.2 | 7.6 | 34.5 | |
| w/o LLM proposer | 6.7 | 74.3 | 94.0 | 55.5 | 20.3 | 13.4 | 44.0 | |
| w/o EHVI selection | 0.0 | 56.0 | 94.0 | 51.2 | 29.7 | 15.4 | 41.1 | |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | Domain | Test size | Output contract | Scoring |
|---|---|---|---|---|
| AIME 2025 | math | 30 | ANSWER: <integer> | exact match |
| GSM8K | math | 1,319 | ANSWER: <number> | exact match |
| BFCL v3 | coding & tool use | 500 | structured tool_calls | schema execution |
| HumanEval | coding & tool use | 164 | complete Python function | unit tests |
| GPQA Main | science & health | 448 | ANSWER: <A--D> | exact match |
| HealthBench-Easy | science & health | 245 | free-form responses | LLM-judge rubrics |
| Model | AIME | GSM8K | BFCL | HumanEval | GPQA | HealthBench | Mean |
|---|---|---|---|---|---|---|---|
| Qwen3-1.7B-Base | 0.0 | 12.7 | 0.0 | 7.9 | 14.1 | 7.5 | 7.0 |
| Qwen3-1.7B-Instruct | 26.7 | 88.5 | 94.0 | 68.9 | 35.5 | 44.9 | 59.7 |
| Qwen3-4B-Base | 3.3 | 41.8 | 0.0 | 36.6 | 13.4 | 13.4 | 18.1 |
| Qwen3-4B-Instruct | 53.3 | 93.8 | 95.0 | 77.4 | 44.6 | 52.7 | 69.5 |
| Hyperparameter | Value |
| Trees per domain | 24 |
| Maximum tree depth | 4 |
| Feature subsampling fraction | 0.7 |
| Monte-Carlo draws | 64 |
| Warm-start threshold (feasible trials) | 5 |
| Warm-start weights (conf / novelty / risk) | 0.4 / 0.2 / 0.3 |
| Base model | Before training | Best SFT | GRPO | Final | SRO (Ours) |
|---|---|---|---|---|---|
| Qwen3-1.7B-Base | 10.3 | 55.0 | 55.7 | 55.7 | 68.2 |
| Qwen3-4B-Base | 43.0 | 74.8 | 74.5 | 74.8 | 87.6 |
| Benchmark | Base training sources | Rewrite source | Correction source |
|---|---|---|---|
| AIME 2025 | AIME 1983–2024; Hendrycks MATH | AIME 1983–2024 | aime_diag |
| GSM8K | GSM8K train; MetaMathQA (GSM subset) | GSM8K train | gsm8k_diag |
| HumanEval | MBPP; MBPP+ (EvalPlus) | MBPP | mbpp_diag |
| BFCL | Hermes function-calling; Glaive v2 | Hermes | bfcl_hermes_diag |
| GPQA Main | MMLU (science subset); ARC | MMLU (science subset) | arc_diag |
| HealthBench | MedAlpaca flashcards; MedAlpaca WikiDoc | MedAlpaca flashcards | medical-o1-reasoning |
| Benchmark | Method | Description |
|---|---|---|
| AIME | Rewrite | Evolve AIME-adjacent competition problems into new integer-answer (0–999) problems with independent full reasoning. |
| Correction | Turn wrong AIME-style answers on independent source data into corrected full-reasoning integer-answer solutions. | |
| GSM8K | Rewrite | Evolve GSM8K-style word problems into new multi-step arithmetic problems with independent solutions. |
| Correction | Turn wrong GSM8K-style answers on independent source data into corrected full-reasoning numeric solutions. | |
| HumanEval | Rewrite | Evolve MBPP-style tasks into new function-writing specs with independent solutions and executable tests. |
| Correction | Repair failing MBPP-style solutions on independent source data into correct, test-passing implementations. |
| Agent LLM | Base model | Trials | Selected trial | Search-time | Final |
|---|---|---|---|---|---|
| DeepSeek-V4-Flash | Qwen3-1.7B | 16 | 11 | 45.3 | 45.3 |
| DeepSeek-V4-Flash | Qwen3-4B | 9 | 8 | 54.0 | 53.8 |
| GPT-5.4 | Qwen3-1.7B | 17 | 7 | 40.9 | 41.1 |
| GPT-5.4 | Qwen3-4B | 8 | 8 | 48.3 | 47.5 |
LLM Post-Training
Large language model post-training adapts pretrained models into more useful, reliable, and specialized assistants through supervised and preference-based learning.
See all 246 papers