From Trainee to Trainer: LLM-Designed Training Environment for RL with Multi-Agent Reasoning
About
Reinforcement learning pipelines for Large Language Model (LLM) training often rely on manually redesigned environments between stages, requiring practitioners to heuristically infer which configuration will best improve the current policy. To automate this process, we propose the LLM-as-Environment-Engineer framework in which the current policy model analyzes failure trajectories together with contextual information and proposes modifications to the next-stage training environment configuration. We also introduce MAPF-FrozenLake, a controllable testbed whose generator exposes multi-dimensional environment configurations, making it suitable for studying and benchmarking environment redesign. On this testbed, we condition the environment engineer on structured summaries of policy behavior, failure cases, and environment statistics, from which it produces the configuration for the next training stage. With Qwen3-4B as the backbone, our framework achieves the strongest aggregate performance on our benchmarks, outperforming larger proprietary LLMs (e.g., GPT, Gemini) and fixed-environment training baselines. We further analyze which forms of context are most effective, finding that successful environment updates rely on failure evidence and preserve configurations that already work. Interestingly, the current RL checkpoint serves as a better environment engineer than the original base model, suggesting that policy learning improves the model's ability to diagnose its remaining weaknesses.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent 4x4 | Valid Rate49.33 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent 5x5 | Valid Rate37.33 | 7 | |
| Multi-Agent Path Finding | 4-agent MAPF-FrozenLake 6x6 | Valid Rate36.67 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent 7x7 | Valid Rate33.33 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent 8x8 | Valid Rate31.33 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent (9x9) | Valid Rate25.33 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent 10x10 | Valid Rate18.67 | 7 | |
| Multi-Agent Path Finding | MAPF-FrozenLake 4-agent Sum | Valid Rate33.14 | 7 | |
| Multi-Agent Path Finding | 3-agent evaluation set (3x3) | Valid Rate68.67 | 7 | |
| Multi-Agent Path Finding | 3-agent 4x4 (test) | Valid Rate64.67 | 7 |