1]University of Washington 2]Stanford University 3]Northeastern University 4]Carnegie Mellon University 5]Massachusetts Institute of Technology 6]National University of Singapore 7]Seoul National University 8]Stevens Institute of Technology 9]University of Chicago \contribution [*]Equal contribution \contribution [†]Joint last author \correspondence , , \metadata [Code] https://github.com/spade-rl/spade \metadata [Project] https://spade-rl.github.io

# SPADE ♠ \spadesuit : Self-Play in Adaptive Synthetic Executable Environments

###### Abstract

Continuous self-improvement requires an ever-expanding pool of self-generated, diverse, adaptive goals. For language agents, existing training environment pools (hand-curated, statically synthesized, or frozen-verifier) keep the goal distribution fixed as the learner scales. We introduce SPADE (Self-Play in Adaptive Synthetic Executable Environments), a self-play RL framework in which a single LLM plays two roles: an Environment Designer that writes complete, long-horizon training environments as executable code with an OpenAI Gym-style reset() / step() interface, and a Reasoning Agent that learns to act in them. Each is a stateful, multi-turn environment (state transitions, reward functions, and verification code), so one interface spans reasoning problems and multi-step agentic tool use. The Reasoning Agent ’s regret is estimated using the gap between its reward with and without privileged hints; in optimizing this regret signal the Environment Designer learns to target environments at the edge of the agent’s capabilities while keeping them feasible. Through extensive experimentation, we find several components critical to success: grounding the Environment Designer on documents sampled from a large pretraining corpus, and giving it an accumulated environment memory. Scaling to 30B-parameter models, SPADE improves over the strongest fixed-environment baseline by + 5.3 +5.3 on average across eight held-out math, science, code, and reasoning benchmarks, and lifts the tool-use setting by + 5.7 +5.7 on BFCL v4 multi-turn and + 13.9 +13.9 on ACEBench-Agent; on the games setting, the margin over the strongest baseline grows with model scale. By making environment design itself a learnable component, SPADE takes a concrete step toward open-ended self-improvement.

## 1 Introduction

Agentic AI has become broadly capable: language models now reason over long horizons, use tools, search the web, and operate computers ( OpenAI, 2024 ; DeepSeek-AI, 2025 ; Wang et al., 2025c ; Zhang et al., 2025c ) . These gains increasingly come not from pretraining alone but from learning through experience, where a model improves from its own trajectories of interacting with an environment and the rewards they return ( Silver and Sutton, 2025 ) . As high-quality human text is a finite resource ( Villalobos et al., 2024 ) , the bottleneck for further agentic progress is increasingly the supply of training environments: interactive tasks with verifiable rewards. Building them has become a central industry investment, with major labs weighing environment budgets exceeding $1 billion a year and a new class of startups raising nine figures to supply them ( Zeff, 2025 ; PYMNTS, 2026 ) . Yet whether hand-built or synthesized, these environments form a fixed pool that does not adapt as the learner improves, so an agent stops improving once it exhausts them.

Several lines of work try to keep agents improving, each with its own limitation. Harness engineering improves how an agent acts within a given environment at inference time, through tool orchestration and self-correction ( Yao et al., 2023 ; Shinn et al., 2023 ) , but it changes no weights, so its gains are tied to each hand-built harness, rather than improving general capabilities the model carries to new tasks. Human-curated scaling ( Zhang et al., 2025a ; Guertler et al., 2025 ; Liu et al., 2025c ) builds diverse environments to train across, but scales only as fast as people can write them. Synthetic generation ( Wang et al., 2026b ; Tu et al., 2026 ; Zhu et al., 2026 ; Gandhi et al., 2026 ; Zeng et al., 2025 ) produces environments programmatically, but the generators are fixed, so the environment space does not grow with the agent and the model soon exhausts it ( Song et al., 2024 ) . Self-play ( Zhao et al., 2025 ; Huang et al., 2025 ; Liu et al., 2025a ) lets a model improve through dual roles, but ungrounded self-play is bounded by information symmetry, unable to pose challenges beyond its own knowledge and prone to amplifying its errors ( Chae et al., 2025 ) ; corpus grounding mitigates this ( Liu et al., 2025b ) , yet most methods still generate tasks (a problem with a sparse terminal reward) rather than complete multi-turn environments (state transitions, reward functions, and verification code). None produces a self-improving system whose environments keep growing in complexity as the agent improves.

We introduce SPADE (Self-Play in Adaptive Synthetic Executable Environments), a framework where a single LLM plays two roles: an Environment Designer that produces complete training environments as executable Python code, and a Reasoning Agent that learns from them. Each environment implements a Gym-style interface (the standard reset() / step() API used in reinforcement learning) ( Brockman et al., 2016 ) , representing a full Markov decision process (MDP) with state transitions and reward functions. This code-as-environment representation unifies single-turn settings (one step to terminal reward) and multi-turn agentic tasks (sequential interaction with transition dynamics) under a single interface. Because any computable MDP can be written as a program, the Environment Designer can express any such environment in code, rather than only those a hand-designed parameterization allows. Unlike prior works where the environment generator is frozen, SPADE ’s Environment Designer is itself trained via RL with a hint-based regret signal that targets solvable environments precisely at the frontier of the Reasoning Agent ’s capability, creating co-evolution where the environment distribution shifts as the Reasoning Agent improves (Figure 2 ).

Overall, our work makes the following contributions: 1. We introduce a general framework for co-evolving environments synthesis and agentic capability through self-play , where the same LLM both generates executable environments as code and learns to solve them. By representing environments as Python programs with a Gym-style interface, the framework unifies single-turn reasoning and multi-turn agentic tasks, and turns environment design into a learnable, RL-trained component of post-training, enabling continual open-ended self-improvement.

2. We introduce a hint-based regret reward for the Environment Designer . The Environment Designer is rewarded by the gap between Reasoning Agent performance with and without privileged hints, a lightweight estimate of minimax regret ( Dennis et al., 2020 ) that targets environments at the frontier of the Reasoning Agent ’s capability. Unlike a pure adversary, which is free to make environments unsolvable, or a cooperative designer, which can inflate Reasoning Agent reward without teaching it anything, hint-based regret yields constrained competitive dynamics that reward environments which are both solvable and at the learning frontier, with an equilibrium analysis in Appendix E .

3. We design a corpus-grounded and memory-augmented design pipeline spanning cognitive-skill games and tool-use tasks. Where prior environment-generation work targets a single domain (math, code, or tool use), SPADE demonstrates improvements in both settings, with environments grounded in pretraining corpus knowledge and accumulated experience.

4. We validate self-play working at 30B+ scale with practical recipe provided, demonstrating that the approach works beyond the small-model with a complete training recipe including environment validation, reward hacking avoidance, and curriculum design.

On the games setting, SPADE outperforms fixed-environment baselines on all three backbones, by + 5.3 +5.3 points on average and up to + 7.5 +7.5 on individual benchmarks over the strongest fixed-environment baseline at 30B-A3B. In the tool-use setting, SPADE lifts BFCL v4 multi-turn ( Patil et al., 2025 ) by + 10.3 +10.3 at 4B and + 5.7 +5.7 at 30B-A3B, and ACEBench-Agent ( Chen et al., 2025a ) by + 13.9 +13.9 at 30B-A3B. Ablations show the advantage of hint-based regret over an exponential-moving-average (EMA) learning-potential signal ( Kanitscheider et al., 2021 ; Zhang et al., 2023 ) , and of the full adaptive, corpus-grounded, memory-augmented configuration over the partial and non-adaptive controls. Qualitative analysis reveals emergent curricula: SPADE progresses from simple single-skill tasks to complex multi-constraint environments requiring long-horizon interaction.

In SPADE , the Environment Designer writes a new, self-contained environment and the Reasoning Agent learns by acting in it. Making design a learnable role lets the two co-evolve: as the agent improves, so do the environments it trains on (Figure 2 ). A single model thus improves not only how it reasons and acts, but the worlds it builds to learn in, a concrete step toward open-ended, continual self-improvement.

## 2 Related Work

For an extended background and comparison to the literature see Appendix H , summarized here:

Self-Play for LLMs Self-play has driven capability growth from TD-Gammon ( Tesauro et al., 1995 ) through AlphaZero ( Silver et al., 2017 ; Silver et al., 2018 ) to modern game AI ( Vinyals et al., 2019 ; † et al.(2022)(FAIR)†, Bakhtin, Brown, Dinan, Farina, Flaherty, Fried, Goff, Gray, Hu, et al., FAIR ) . PowerPlay ( Schmidhuber, 2013 ) proposed a single self-modifying system that continually invents tasks at its own capability frontier, prefiguring the dual-role single-LLM pattern adopted below. Asymmetric self-play ( Sukhbaatar et al., 2017 ) later formalized a proposer-solver paradigm in which one agent sets challenges while another solves them. Applying self-play to LLMs is harder than in single-task game-playing systems: the goal is general capability across open-ended problems, and self-play training at LLM scale is often unstable. Earlier LLM self-play methods rely on curated seed data or evaluation sets, either for self-distillation ( Chen et al., 2024 ; Yuan et al., 2024 ; Singh et al., 2023 ) , for adversarial language games over fixed vocabularies ( Cheng et al., 2024 ) , or for bootstrapping a learned proposer ( Fang et al., 2025b ; Sundaram et al., 2026 ) . A more recent line removes this dependency, training proposer and solver from minimal seeds with proxy rewards that target the learnable frontier. AZR ( Zhao et al., 2025 ) , SQLM ( Chen et al., 2025c ) , and Language Self-Play ( Kuba et al., 2025 ) have a single LLM play both roles with shared parameters; R-Zero ( Huang et al., 2025 ) and Tool-R0 ( Acikgoz et al., 2026 ) instead train two separate models initialized from the same base, using uncertainty- or solve-rate-based rewards. The closest predecessors to our work are SPIRAL ( Liu et al., 2025a ) , which trains LLMs through self-play on multi-turn zero-sum language games, and SPICE ( Liu et al., 2025b ) , which extends self-play to corpus-grounded question generation. However, both generate tasks (a single problem with only a terminal reward) and can collapse when the model’s capacity bounds the reachable solution distribution ( Chae et al., 2025 ) or when proxy rewards induce degenerate outputs ( Shafayat et al., 2025 ) ; a recent theorem-proving method adds a frozen Guide to score the proposer’s conjectures and curb collapse (SGS, Bailey et al., 2026 ); in SPADE the verifier is instead part of each generated environment, co-evolving with the Environment Designer rather than fixed. By contrast, SPADE generates full multi-turn MDP environments (state transitions, reward functions, and verification code) as executable code, trains the Environment Designer itself via RL with hint-based regret grounded in measured Reasoning Agent return, and spans a broader range of tasks (games and tool use) than prior methods confined to a single domain.

Unsupervised Environment Design and Open-Endedness Curriculum learning and learnability-driven adaptation ( Bengio et al., 2009 ; Schmidhuber, 2013 ) laid the groundwork for what Dennis et al. (2020) termed unsupervised environment design (UED). POET ( Wang et al., 2019 ) pioneered paired open-ended environment-agent co-evolution via evolutionary search over parameterized terrain, while PAIRED ( Dennis et al., 2020 ) introduced adversarial environment design with minimax regret; subsequent work improved level curation via prioritized replay ( Jiang et al., 2021b ; Jiang et al., 2021a ) , evolutionary complexity ( Parker-Holder et al., 2022 ) , stability ( Mediratta et al., 2023 ) , regret approximations ( Rutherford et al., 2024 ) , and theoretical foundations ( Monette et al., 2025 ) . Güzel et al. (2025) extends prioritized level replay to imagined trajectories from a learned diffusion world model. Multi-agent autocurricula provide a complementary route to emergent complexity ( Baker et al., 2019 ) , and open-endedness has been argued essential for superhuman AI ( Hughes et al., 2024 ) . OMNI-EPIC ( Faldor et al., 2024 ) represents environments as executable code generated by foundation models, with a frozen FM judge of interestingness gating task acceptance. PAPRIKA ( Tajwar et al., 2025 ) brings curriculum-style training to LLM agents across diverse synthetic task groups. However, classical UED searches parameterized environments (maze dimensions, grid layouts) within small, fixed design spaces, and curriculum-based LLM training draws from fixed task pools without a learned generator. SPADE carries the regret principle into an unbounded, code-defined environment space: the Environment Designer is itself the learning agent, writing full MDPs as programs and co-evolving with the Reasoning Agent online, rather than an adversary selecting from a hand-designed parameterization. This turns environment design from selection within a fixed space into open-ended generation.

Environment Synthesis and Scaling Following the shift from single-turn reinforcement learning with verifiable rewards (RLVR) ( OpenAI, 2024 ; DeepSeek-AI, 2025 ) to multi-turn agentic RL ( Wang et al., 2025c ; Zhang et al., 2025c ) , the env-pool bottleneck has motivated work that synthesizes training environments for LLM agents at scales unreachable by hand-curation. Recent systems generate agentic worlds and toolsets ( Wang et al., 2026b ; Tu et al., 2026 ; Dong et al., 2026 ) , terminal and computer-use sandboxes ( Zhu et al., 2026 ; Gandhi et al., 2026 ; Fan et al., 2026 ; Pi et al., 2026 ; Xue et al., 2026a ; Xue et al., 2026b ; Zhang et al., 2026e ) , and dynamic RL pipelines ( Wang et al., 2026a ; Guo et al., 2025 ; Shi et al., 2026 ) ; AgentScaler ( Fang et al., 2025a ) clusters thousands of real APIs into per-domain Python tool environments and trains agents via filtered supervised fine-tuning (SFT), and Eurekaverse ( Liang et al., 2024 ) provides a robotics analogue. Complementary task-level synthesis grounds generation in agent exploration ( Ramrakhya et al., 2025 ) , converts unverifiable text into RLVR data ( Lu et al., 2026 ) , or expands seed task spaces ( Jiang et al., 2025b ; Chen et al., 2025e ; Li et al., 2025 ; Lu et al., 2025 ) . Scaling studies show that distributions of verifiable environments lift generalization: WebScale-RL ( Cen et al., 2025 ) mines RL tasks from web pretraining data, AgentRL ( Zhang et al., 2025a ) unifies multi-turn multi-task training, and RLVE ( Zeng et al., 2025 ) hand-engineers 400 verifiable environments with adaptive difficulty levels. Curriculum selection over fixed pools provides difficulty adaptation without changing the underlying environments ( Chen et al., 2025d ; Xu et al., 2026a ) . Across these systems the environment generator is typically frozen, hand-engineered, or trained on a separate signal. SPADE instead trains the Environment Designer online, together with the Reasoning Agent , via RL with hint-based regret, produces full multi-turn MDP environments as executable Python rather than tasks with sparse terminal rewards, and co-evolves the environment distribution with the Reasoning Agent ’s capability frontier in a single training loop.

## 3 Preliminaries

SPADE builds on two standard components, which we review before presenting the method: the Markov decision process with a Gym-style reset() / step() interface, used to represent environments, and reinforcement learning from verifiable rewards optimized with GRPO, used to train the policy.

### 3.1 Markov Decision Processes and Gym-Style Environments

A Markov Decision Process (MDP) is a tuple ( 𝒮 , 𝒜 , T , R , ρ 0 ) (\mathcal{S},\mathcal{A},T,R,\rho_{0}) with state space 𝒮 \mathcal{S} , action space 𝒜 \mathcal{A} , transition function T ⁡ ( s ′ ∣ s , a ) T(s^{\prime}\mid s,a) , reward function R ⁡ ( s , a ) R(s,a) , and initial state distribution ρ 0 \rho_{0} . The standard programmatic interface for an MDP, popularized by OpenAI Gym ( Brockman et al., 2016 ) and standardized in its Gymnasium fork ( Towers et al., 2026 ) , exposes two functions: reset() returns an initial observation s 0 ∼ ρ 0 s_{0}\sim\rho_{0} (with an info dictionary), and step ( a a ) advances the state via T T and returns ( s ′ , r , terminated , truncated , info ) (s^{\prime},r,\text{terminated},\text{truncated},\text{info}) , separating natural termination from time-limit truncation. Our generated environments are fully observed: the observation returned at each step is the state itself. Listing 3 shows a minimal instantiation.

### 3.2 RLVR and GRPO

We train the policy π θ \pi_{\theta} , an LLM with parameters θ \theta , via reinforcement learning with verifiable rewards (RLVR) using Group Relative Policy Optimization (GRPO) ( Shao et al., 2024 ) . For each input prompt x x , GRPO samples a group of G G responses { y 1 , … , y G } ∼ π θ ( ⋅ ∣ x ) \{y_{1},\ldots,y_{G}\}\sim\pi_{\theta}(\cdot\mid x) and computes group-normalized advantages: A ^ i = r i − mean ​ ( { r j } j = 1 G ) std ​ ( { r j } j = 1 G ) \hat{A}^{i}=\frac{r^{i}-\text{mean}(\{r^{j}\}_{j=1}^{G})}{\text{std}(\{r^{j}\}_{j=1}^{G})} (1) The policy is updated via clipped policy gradient with KL regularization: ℒ ( θ ) = − 1 G ∑ i = 1 G min ( π θ ​ ( y i ∣ x ) π old ​ ( y i ∣ x ) A ^ i , clip ( π θ ​ ( y i ∣ x ) π old ​ ( y i ∣ x ) , 1 − ε low , 1 + ε high ) A ^ i ) + β KL ⋅ KL [ π θ ∥ π ref ] \mathcal{L}(\theta)=-\frac{1}{G}\sum_{i=1}^{G}\min\left(\frac{\pi_{\theta}(y_{i}\mid x)}{\pi_{\text{old}}(y_{i}\mid x)}\hat{A}^{i},\;\text{clip}\!\left(\frac{\pi_{\theta}(y_{i}\mid x)}{\pi_{\text{old}}(y_{i}\mid x)},1-\varepsilon_{\text{low}},1+\varepsilon_{\text{high}}\right)\hat{A}^{i}\right)+\beta_{\text{KL}}\cdot\text{KL}[\pi_{\theta}\|\pi_{\text{ref}}] (2)

## 4 SPADE : Self-Play in Adaptive Synthetic Executable Environments

SPADE is an end-to-end self-play framework where a single LLM, π θ \pi_{\theta} , alternates between generating executable training environments and learning to solve them (Figure 4 ; Algorithm 1 ). Its three components create an adaptive curriculum: § 4.1 details how dual-role self-play couples environment generation with Reasoning Agent (RA) learning; § 4.2 explains how hint-based regret steers the Environment Designer (ED) toward environments at the Reasoning Agent ’s learning frontier; and § 4.3 outlines the pipeline that grounds and validates these executable environments.

### 4.1 Dual-Role Self-Play and Code-as-Environment

SPADE formulates adaptive environment self-play as a game where a single model π θ \pi_{\theta} acts in two roles via role-specific system prompts: designing environments ( role = D \text{role}{=}D ) or solving them ( role = A \text{role}{=}A ). Let ℰ \mathcal{E} denote the space of all valid environments. In the Environment Designer role ( π D \pi_{D} ), π θ \pi_{\theta} produces an executable environment e ∈ ℰ e\in\mathcal{E} as a Python program implementing the Gym-style reset() / step() API (Section 3.1 ; a minimal example is shown in Appendix J.3.1 ), where the transition function T ⁡ ( s ′ ∣ s , a ) T(s^{\prime}\mid s,a) and reward function R ⁡ ( s , a ) R(s,a) are both encoded in the step() implementation. The Environment Designer also emits a privileged hint for each environment. A hint h h is task-relevant information that the Environment Designer attaches to an environment (for example, a partial solution sketch or a key structural observation); revealing h h to the Reasoning Agent makes the environment easier to solve, and the gap in Reasoning Agent return with versus without h h defines the Environment Designer ’s hint-based regret reward (Section 4.2 ).

In the Reasoning Agent role ( π A \pi_{A} ), π θ \pi_{\theta} interacts with e e via sequential actions, receiving observations and rewards. This code-as-environment representation unifies single-turn settings ( reset() → \rightarrow step(answer) → \rightarrow terminal reward) and multi-turn agentic settings ( reset() → \rightarrow step() → ⋯ → \rightarrow\cdots\rightarrow done ) under a single interface and training pipeline. This representation provides the vast task space that AI-GAs ( Clune, 2019 ) argue is necessary for open-ended self-improvement: any computable MDP can be expressed as a Python program, so the Environment Designer can express any such environment in code rather than being confined to a hand-designed environment parameterization. Both roles share parameters θ \theta , so updates for either role affect the same policy. Each self-play cycle first collects Environment Designer trajectories, and then Reasoning Agent trajectories from those generated environments. The Environment Designer receives hint-based regret (Section 4.2 ), whereas the Reasoning Agent receives task correctness from the environment’s reward function. Each candidate environment is validated for syntactic correctness and executability before entering the training pool; validation details are in Appendix F.2 .

Stabilizing joint two-role training. Optimizing a single policy for two coupled objectives requires several stabilizing techniques ( Liu et al., 2026a ) . Following SPIRAL ( Liu et al., 2025a ) , we normalize advantages independently for each role. We standardize Reasoning Agent returns within each environment’s rollouts and mean-center Environment Designer rewards within each skill. To ensure both roles contribute comparably, we upweight the less frequent Environment Designer trajectories. Finally, we delay the Environment Designer update by k k rollouts, where k k is the number of training steps per environment set, so the difficulty anchor can score each environment’s Reasoning Agent win rate over the full training window; the regret component is computed at generation time. Since this delay makes the Environment Designer objective off-policy, we correct the gradient using truncated importance sampling ( Yao et al., 2025 ) . We use an asymmetric clipping range ( ε low = 0.2 \varepsilon_{\text{low}}{=}0.2 , ε high = 0.28 \varepsilon_{\text{high}}{=}0.28 ) to preserve exploration and floor the raw regret at zero. The deployed Environment Designer reward blends this floored regret, normalized to [ 0 , 1 ] [0,1] by a fixed scale, (weight 0.4 0.4 ) with a flat-top difficulty anchor that pays environments whose Reasoning Agent win rate falls in a target band and decays linearly outside it (weight 0.6 0.6 , band [ 0.4 , 0.6 ] [0.4,0.6] ): the anchor regulates difficulty, and floored regret selects the most teachable environments within the band. Full hyperparameters appear in Appendix F.2 .

### 4.2 Hint-Based Regret Reward

The Environment Designer ’s reward for producing environment e e is: r D ​ ( e ) = r ¯ A ​ ( e ∣ h ) − r ¯ A ​ ( e ) , r_{D}(e)=\bar{r}_{A}(e\mid h)-\bar{r}_{A}(e), (3)

where r ¯ A ​ ( e ∣ h ) = 1 G ​ ∑ i = 1 G r A ​ ( y i ′ ∣ e , h ) \bar{r}_{A}(e\mid h)=\frac{1}{G}\sum_{i=1}^{G}r_{A}(y^{\prime}_{i}\mid e,h) is the Reasoning Agent ’s average return over G G fresh rollouts y i ′ y^{\prime}_{i} sampled with the privileged hint h h in context, and r ¯ A ​ ( e ) \bar{r}_{A}(e) is the corresponding average over G G rollouts without it. Three regimes emerge: high regret indicates an environment at the learning frontier (solvable with hints but not without); low regret where the Reasoning Agent succeeds with and without the hint indicates mastery; and low regret with low returns even with the hint indicates an intractable environment. This implements the minimax regret objective of PAIRED ( Dennis et al., 2020 ) without a separate antagonist: the hint-equipped Reasoning Agent serves as the upper-bound policy. For a policy that best-responds to the hint, extra information cannot reduce expected return, so regret is non-negative at the optimum; for the current policy, expected regret can dip below zero when hints mislead it, which we observe for the smaller backbones (Figure 13 ). We formalize this intuition and show that, under idealized assumptions, every pure Nash equilibrium yields hint-free optimality on every valid environment (Appendix E ). We compare hint-based regret against an EMA-based learning-potential signal ( Kanitscheider et al., 2021 ; Zhang et al., 2023 ) in the Environment Designer -reward ablation (Section 7.2 ).

Hint generation. For each environment e e , the Environment Designer (same LLM, different prompt) emits one task-specific hint of a few sentences. The prompt asks for the key insight or strategy and the expected answer format, but forbids revealing the exact answer; its output is unlabeled hint text. Figure 5 shows two high-regret examples. Each hint is shown beside the task it conditions and one logged Reasoning Agent rollout from each prompt condition. The paired trajectories expose the behavioral source of the return gap: the hint hands the fiber-task agent the probe pattern almost outright, and narrows the audio-task agent’s search to a parameter range it would otherwise reach only after repeated failed attempts.

### 4.3 Environment Design

Corpus grounding. A generator conditioned only on its own output has no source of novelty outside its own weights, so it narrows toward the patterns it already favors and mode-collapses, the “invisible leash” ( Chae et al., 2025 ; Zhang et al., 2026c ; Jiang et al., 2025a ) . We treat an external corpus as the mechanism that lengthens that leash: every round the Environment Designer conditions on freshly sampled human corpus. In the games setting these are 10 10 k mathematics and 5 5 k science documents drawn from DCLM ( Li et al., 2024 ) and MegaScience ( Fan et al., 2025 ) , spanning web pages, physics forums, and university-level scientific textbooks; in the tool-use setting, 15 15 k documents from the Nemotron pretraining code corpus ( NVIDIA, 2026 ) , which supplies algorithm implementations and API documentation. SPICE ( Liu et al., 2025b ) established corpus grounding for task generation, mining documents for reasoning questions; SPADE carries the principle to environment generation, where a sampled passage seeds an executable MDP rather than a question-answer pair. Section 6.2 (Figure 8 ) shows how corpus grounding sustains environment diversity.

Environment memory. The corpus supplies breadth from outside the loop; the cross-episode memory keeps the Environment Designer from re-posing what the Reasoning Agent has already mastered ( Schmidhuber, 2013 ) . A buffer of previously generated environments, annotated with regret scores and skill tags, gives the Environment Designer high-regret seeds to vary, so each round starts from what the Reasoning Agent currently finds hard rather than from scratch. Retaining and reusing past experience this way is the mechanism agentic-memory systems rely on to keep improving without further gradient updates ( Zhang et al., 2026d ; Xiong et al., 2026 ) ; here it acts on the design side, holding generated difficulty at the Reasoning Agent ’s frontier as that frontier moves. The two inputs work on different axes, the corpus on what environments are about and the memory on how hard they are, and Table 3 separates their contributions.

Environment pool management, lifecycle, and quality control details are in Appendix F.2 .

## 5 Experimental Setup

### 5.1 SPADE Training Recipe

We train three Qwen3 backbones: Qwen3-4B-Instruct-2507, Qwen3-8B, and Qwen3-30B-A3B-Instruct-2507, the last of which is our primary model. The 4B and 30B runs use instruct models; the 8B run enables thinking for both the Environment Designer and the Reasoning Agent . We train with GRPO ( Shao et al., 2024 ) for 400 400 rollouts of 24 24 environments each. The Environment Designer regenerates the environment set every k k rollouts and its update is delayed by the same k k (Section 4.1 ), so k k sets how long the Reasoning Agent trains on a fixed set before the curriculum moves. The Reasoning Agent plays every environment 16 × k 16\times k times without the hint and 16 16 times with it; the regret subtracts hint and no-hint averages measured at the same regeneration step ( 16 16 plays each). The Environment Designer writes the privileged hint itself, with no external model, and each round it also draws high-regret seeds from a memory of past environments. Rewards are normalized per environment, and the stabilizers described earlier (per-role advantages, the delayed Environment Designer update with truncated importance sampling, and the regret floor) are unchanged across settings. Our RL backbone is slime ( Zhu et al., 2025 ) .

The settings below differ in what the Environment Designer generates, how it is grounded, how the Reasoning Agent acts, and the regeneration interval k k . Every benchmark is held out from training, and component-level controls such as removing Environment Designer training or grounding are covered by the ablations of Section 7 . Full hyperparameters, per-run adjustments, and evaluation protocol details are in Appendices F.2 and F.3 .

### 5.2 Domain: Games

Environments. The Environment Designer writes each environment as a self-contained Python game with a verifiable reward, and the Reasoning Agent solves it. Each rollout uses 24 24 games, eight for each of three active skills; the six cognitive-skill categories (Mathematical Reasoning, Logical Deduction, Spatial Reasoning, Pattern Recognition, Optimization, and Causal Inference) rotate three at a time, with k = 4 k{=}4 . The generation is grounded in the 15 15 k-document math and science corpus of Section 4.3 . Besides floored hint-based regret, the Environment Designer reward includes the flat-top difficulty anchor of Section 4.1 that pays games whose Reasoning Agent win rate falls in the target band, and every game must pass syntax and execution checks before it enters the pool.

Baselines and evaluation. We retrain two fixed-environment baselines separately for each backbone from its corresponding base checkpoint, using the same 400 400 -iteration budget: Fixed-env RLVE , GRPO on the official RLVE set ( Zeng et al., 2025 ) , and Fixed-env GRPO , which is generated offline by that same Qwen3 backbone and held fixed throughout training. Fixed-env RLVE follows the official RLVE sampling and curriculum settings. RLVE has the higher suite average at every backbone scale. Evaluation spans two distances from the training distribution: procedural reasoning , the four Reasoning-Gym ( Stojanovski et al., 2026 ) categories at hard difficulty, and out-of-distribution (OOD) reasoning and code , AIME 2025/2026 (Avg@32) ( MAA, ) , GPQA-Diamond (accuracy) ( Rein et al., 2023 ) , and LiveCodeBench-v6 (Pass@1) ( Jain et al., 2024 ) . Table 1 reports all eight for every backbone.

### 5.3 Domain: Tool Use

Environments. The Environment Designer instead writes an executable tool-use environment: a set of simulated tools in OpenAI function-calling format, a backend state the tools modify, and three to five natural-language user instructions that arrive one at a time, each with a check on the resulting state. Generation is grounded in the 15 15 k-document code corpus, and tool environments cost more to generate, so we used k = 8 k{=}8 . The Reasoning Agent solves an environment by calling tools over multiple turns and is rewarded only when it completes every user instruction. The privileged hint is a step-by-step plan (look up a record, update it, then reconcile the result), so the Reasoning Agent still has to find the exact arguments by calling the tools. Validation adds two checks beyond the game ones: a deterministic reset gate that exercises every success criterion under several seeds, and an LLM check that every success criterion can be met by some tool (details in Appendix F.2 ). The generation prompt targets the multi-turn function-calling task family of the evaluation suites (schema-defined simulated tools, a backend state, and per-instruction checks); no benchmark tasks or data are shown to the Environment Designer .

Baselines and evaluation. We compare SPADE with four synthetic-environment systems: AgentScaler ( Fang et al., 2025a ) , Agent-World ( Dong et al., 2026 ) , Agent World Model (AWM) ( Wang et al., 2026b ) , and EnvScaler ( Song et al., 2026 ) . Their results are transcribed from the cited papers and differ from ours in training data and budget, in some cases base model, and in evaluation protocol (Appendix F.3.1 ). Evaluation uses BFCL v4 multi-turn ( Patil et al., 2025 ) , τ 2 \tau^{2} -bench ( Barres et al., 2025 ) , and ACEBench-Agent (the Agent category of ACEBench-en) ( Chen et al., 2025a ) , reported per domain in Table 2 .

## 6 Experimental Results

We evaluate SPADE on two settings, game and tool-use environment design, across the three Qwen3 backbones of Section 5.1 . Section 6.1 reports held-out benchmark performance against the fixed-environment baselines, and Section 6.2 examines what the Environment Designer and Reasoning Agent produce over training.

### 6.1 Quantitative Analysis

Synthetic game environments improve science, code, and procedural reasoning. At 30B-A3B, SPADE reaches a suite average of 58.3 58.3 : + 8.1 +8.1 over base and + 5.3 +5.3 over the strongest fixed-environment baseline (Fixed-env RLVE), a margin that grows with model size (Table 1 ). The Environment Designer trains on synthetic games, never on any held-out task, yet the gains transfer to science, code, and procedural reasoning and hold late in the 400 400 -step run (Figure 6 ), while competition math is preserved. They concentrate on procedural reasoning, where every cognitive-skill category improves: the generated games exercise each skill through many problem structures rather than a fixed task set.

Synthetic tool-use environments improve multi-step interaction. The same recipe applied to tool-use environment design improves every backbone (Table 2 ), and at 30B-A3B the size of the gain tracks how closely a benchmark’s task structure matches the generated environments: ACEBench-Agent gains most ( + 13.9 +13.9 ), and its stateful, multi-step tasks mirror the generated pattern of a database, a tool schema, and a multi-call goal. BFCL v4 multi-turn follows ( + 5.7 +5.7 , and + 10.3 +10.3 at 4B), then τ 2 \tau^{2} -bench ( + 3.6 +3.6 ). SPADE at 30B-A3B leads the dedicated data-synthesis systems on both BFCL v4 multi-turn and ACEBench-Agent, so structural training signal transfers where domain-specific data collection does not reach.

### 6.2 Qualitative Analysis

The Environment Designer keeps supplying environments the Reasoning Agent can learn from. We examine what each role produces over the main 30B games run. Figure 8 tracks the learnable share of each rollout, the fraction of generated environments on which the Reasoning Agent wins between 20 % 20\% and 80 % 80\% of the time. Full SPADE raises this share over training, reaching roughly a third late in the 400-step run; the corpus, the memory, and Environment Designer training together sustain that supply. Figure 8 traces the diversity of that supply to the corpus: corpus grounding keeps the environments diverse (Vendi/ n n 0.68 0.68 , versus 0.04 0.04 without it), and the control without Environment Designer training or memory, but with the corpus, retains full diversity ( 0.70 0.70 , Appendix I.1.2 ). Corpus grounding provides the breadth, while the full Environment Designer training configuration sharpens the difficulty. Ivison (2026) reaches the same conclusion from the failure side: an ungrounded proposer collapses onto a handful of near-identical programs, explicit diversity rewards get hacked once they are optimized against, and conditioning on an external corpus is the intervention that holds longest. Figure 8 shows that corpus grounding sustains diversity, whereas the ungrounded run collapses.

Environment Designer training makes environments harder in measurable, code-level ways. The generation instructions are fixed across all 400 steps (the same template asking for hidden state, multi-turn structure, and partial reward), while the grounding document is resampled from the corpus each step with no trend over training, so any systematic change in the generated environments traces to Environment Designer training rather than to a prompt schedule. Two measurements move together. First, within Physics, the share of environments whose opening observation prints the governing formula falls from 25 % 25\% to 5 % 5\% over the 473 473 Physics environments of the canonical run (Figure 9 ). Second, rewards become more finely graded, from 3.7 3.7 to 5.8 5.8 distinct levels per environment, of which 2.2 → 4.0 2.2\to 4.0 are strictly partial (Appendix I.1.1 ). The no-corpus run (w/o corpus grounding in Table 3 ) shows none of this: over steps 290–312 it emits the same rotating-maze task 41 times in a row.

The Reasoning Agent learns to act on evidence rather than derive in advance. Figure 10 shows the Reasoning Agent ’s side of the same run. At step 0 it reasons entirely up front and cannot recover once the interface rejects its answer; by step 200 it tests short hypotheses and revises them as results return; by step 300 it gathers evidence first and derives once, when the evidence is enough. The shift appears only where the task rewards inference: on procedural environments the same policy acts in short commands (late-step median 8 8 tokens). The model still derives at length when the task calls for it, and the late-checkpoint benchmark gains (Table 1 ) confirm it keeps the ability.

## 7 Ablations

We ablate two design choices for the Environment Designer : whether it adapts during training (Section 7.1 ), and how it is rewarded (Section 7.2 ). Table 3 covers the ablation for training settings and environment sources. The first two settings remove corpus grounding and the environment memory, one at a time. The remaining two variants remove online Environment Designer training in different ways: one continues self-generation but removes both Environment Designer training and the environment memory; the other trains the Reasoning Agent on a static pool generated offline by GPT-5.5, with corpus grounding. All variants use games on Qwen3-30B-A3B-Instruct-2507 and are evaluated on the same eight-benchmark suite as the main experiments. Each variant reports its best checkpoint on the suite average; full eval curves are in Figure 11 , and per-ablation breakdowns in Appendix G .

### 7.1 Ablation: Environment Designer Adaptation

As shown in Table 3 and Figure 11 , the full SPADE run is strongest across settings. Removing both Environment Designer training and memory makes the model worse than no training at all, with the eight-benchmark average falling to 40.5 40.5 , 9.7 9.7 points below the untrained base. The static GPT-5.5 pool, generated offline with corpus grounding but no environment memory, does better, beating the base ( 53.0 53.0 versus 50.2 50.2 ), but recovers only about 35 % 35\% of SPADE ’s + 8.1 +8.1 gain and does not improve code (LiveCodeBench-v6 42.6 42.6 versus 43.2 43.2 ). The partial and non-adaptive variants peak early and then fade (the no-memory and no-corpus runs near step 111, the GPT-5.5 pool near step 175), while full SPADE stays strongest late in training (Figure 11 ). Each control changes more than one factor: the self-generation control removes both Environment Designer training and memory, while the GPT-5.5 control changes the generator and uses an offline, memory-free pool. Together they show that the full co-adaptive setup in SPADE wins.

### 7.2 Ablation: Environment Designer Reward

SPADE ’s Environment Designer reward is built on hint-based regret (Eq. 3 ), blended with the difficulty anchor of Section 4.1 . The alternative below is cheaper: it reuses the Reasoning Agent rollouts already collected and needs no hinted replay.

EMA-based learning potential. This reward design ( Kanitscheider et al., 2021 ; Zhang et al., 2023 ) scores an environment by how far the Reasoning Agent ’s success on it departs from its skill’s recent average. Environments are grouped by skill s s . Let r ¯ A ​ ( e ) \bar{r}_{A}(e) be the Reasoning Agent ’s average return on environment e e (Eq. 3 ), and r ¯ A , t ​ ( s ) \bar{r}_{A,t}(s) its mean over the skill’s environments in scoring round t t . Two moving averages of r ¯ A , t ​ ( s ) \bar{r}_{A,t}(s) are tracked at rates γ 1 > γ 2 \gamma_{1}>\gamma_{2} : μ t γ ​ ( s ) = ( 1 − γ ) ​ μ t − 1 γ ​ ( s ) + γ ​ r ¯ A , t ​ ( s ) , μ fast ≡ μ γ 1 , μ slow ≡ μ γ 2 . \mu^{\gamma}_{t}(s)\;=\;(1-\gamma)\,\mu^{\gamma}_{t-1}(s)\;+\;\gamma\,\bar{r}_{A,t}(s),\qquad\mu_{\text{fast}}\equiv\mu^{\gamma_{1}},\quad\mu_{\text{slow}}\equiv\mu^{\gamma_{2}}. (4) Here γ \gamma weights the new observation, so μ fast \mu_{\text{fast}} adapts faster than μ slow \mu_{\text{slow}} , and μ γ \mu^{\gamma} has half-life log ⁡ ( 0.5 ) / log ⁡ ( 1 − γ ) \log(0.5)/\log(1-\gamma) rounds. The reward uses μ slow \mu_{\text{slow}} as the skill baseline: ρ ⁡ ( e ) \displaystyle\rho(e)\; = | r ¯ A ​ ( e ) − μ slow , t ​ ( s ) | , \displaystyle=\;\bigl|\,\bar{r}_{A}(e)-\mu_{\text{slow},t}(s)\,\bigr|, (5) r D LP ​ ( e ) \displaystyle r_{D}^{\text{LP}}(e)\; = ρ ⁡ ( e ) − 1 | ℰ s | ​ ∑ e ′ ∈ ℰ s ρ ⁡ ( e ′ ) , \displaystyle=\;\rho(e)-\tfrac{1}{|\mathcal{E}_{s}|}\textstyle\sum_{e^{\prime}\in\mathcal{E}_{s}}\rho(e^{\prime}), (6) where ℰ s \mathcal{E}_{s} is the round’s environment set for skill s s .

Two consequences follow. The deviation is unsigned, so an environment the Reasoning Agent always solves can score as highly as one it never solves when the slow mean sits mid-range, though neither gives gradient; only a variance-style bonus such as r ¯ A ​ ( e ) ​ ( 1 − r ¯ A ​ ( e ) ) \bar{r}_{A}(e)\bigl(1-\bar{r}_{A}(e)\bigr) would favour mixed outcomes. And μ fast \mu_{\text{fast}} is tracked but unused: the classical gap | μ fast − μ slow | |\mu_{\text{fast}}-\mu_{\text{slow}}| is logged only as a diagnostic. The signal also needs a per-skill history before it is meaningful, and cannot separate deviation caused by environment design from Reasoning Agent drift or sampling noise.

Results. Figure 12 shows the trajectories for the two trained- Environment Designer rewards and the control without Environment Designer training or memory on the six-benchmark trajectory average, while Table 6 gives their selected checkpoints on the full eight-benchmark suite. Hint-based regret lifts the eight-benchmark average from 50.2 50.2 to 58.3 58.3 ( + 8.1 +8.1 ); EMA-based learning potential reaches around 70 % 70\% of that gain ( + 5.7 +5.7 , to 55.9 55.9 ) and climbs more slowly, the two signals separating after the first ∼ 50 {\sim}50 steps. Both stay far clear of the control without Environment Designer training or memory, whose selected checkpoint is 9.7 9.7 points below the untrained model. The comparison between the two trained- Environment Designer variants isolates the reward choice, the regret-based blend versus the standalone learning-potential signal; the third comparison does not isolate Environment Designer training from memory. The form of Eq. 6 helps explain the remaining reward gap: an unsigned deviation from a per-skill running mean needs history before it means anything, and even then scores mastered and hopeless environments alike, so it finds the frontier later and less sharply than a hint gap measured on the current policy. Per-benchmark numbers are in Table 6 .

## 8 Scaling Results

Scaling model size. Under a shared training recipe (Section 5.1 ), the average gain over each backbone’s base grows from + 5.2 +5.2 at 4B and + 5.7 +5.7 at 8B to + 8.1 +8.1 at 30B-A3B, while Fixed-env GRPO stays near + 1.2 +1.2 at every size (Figure 13 ; Table 1 ). Fixed-env GRPO supplies a static training signal, whereas the Environment Designer keeps adapting the curriculum to the Reasoning Agent ; the widening gap is consistent with larger models benefiting more from that adaptivity.

Scaling curriculum diversity. The cognitive-skill curriculum is the set of skill categories the Environment Designer targets when it generates environments: the six listed in Section 5.2 , three active per regeneration in round-robin. We compare the full six-skill curriculum against a two-skill version, with everything else held fixed (Figure 14 ; per-benchmark panels in Figure 15 , Appendix G ). The two-skill run also improves, but it captures only about half of the Reasoning-Gym gains and much smaller GPQA-Diamond and LiveCodeBench-v6 gains (best checkpoint on the eight-benchmark suite of Table 1 : 53.7 vs. 58.3). The gains grow with the diversity of the curriculum, not with any single game family.

## 9 Discussion

SPADE ’s results support two conclusions. First, training the Environment Designer to produce environments adapted to the Reasoning Agent ’s current ability outperforms training on fixed environment sources: both the main Fixed-env GRPO pools generated once offline by the corresponding Qwen3 backbones and held fixed throughout training (Table 1 , Section 6.1 ), and the offline pool generated by the stronger GPT-5.5 model in the ablation (Table 3 , Section 7 ). The widening gap over Fixed-env GRPO with model scale is consistent with an adaptivity advantage. Second, one code-as-environment interface spans two very different settings. In the games setting, reasoning skills the Reasoning Agent develops (planning, constraint satisfaction, strategic thinking) generalize to held-out mathematics, science, and code, well beyond the game format they were learned in. In the tool-use setting, the same recipe lifts multi-step agentic benchmarks most where interaction matters, by + 13.9 +13.9 on ACEBench-Agent and + 5.7 +5.7 on BFCL v4 multi-turn at 30B-A3B. The same learnable environment-design role is effective in both settings.

Limitations. (a) Complexity bounded by scale and the invisible leash ( Chae et al., 2025 ) . The Environment Designer cannot produce environments more complex than its base model can express in context, so reachable environment complexity grows with model scale and generation budget. (b) A human-designed optimizer. Both roles are updated by a fixed, human-authored RL algorithm (GRPO); SPADE does not modify its own learning rule. (c) No formal optimality, and fixed-task evaluation. Hint-based regret is motivated by PAIRED ( Dennis et al., 2020 ) but not proven to yield an optimal curriculum, and current benchmarks measure fixed-task performance rather than open-ended reasoning growth.

Future directions. We improve the Environment Designer with gradient updates, but co-adaptation between the Environment Designer and Reasoning Agent might also come from an Environment Designer that improves without weight updates, accumulating and refining design strategies from past attempts in context; whether learned weights or in-context evolution makes the better designer, and at what scale, is an open question. SPADE also automates one stage of post-training; combining adaptive environment design with systems that automate the remaining stages, from data curation through the learning rule itself, could extend co-adaptive self-play across the whole training pipeline.

## 10 Conclusion

We presented SPADE , a framework that makes environment design a learnable component of LLM post-training through self-play. Three contributions enable this: (1) a hint-based regret reward that trains the Environment Designer to produce environments at the Reasoning Agent ’s learning frontier, grounded in minimax regret theory; (2) environment design anchored in a pretraining corpus and an environment memory, with a code-as-environment interface that unifies single-turn and multi-turn settings; and (3) a practical recipe at 30B+ scale on Qwen3 models. In the games setting, SPADE raises held-out reasoning and code benchmarks by + 8.1 +8.1 average points over base at 30B-A3B ( + 5.2 +5.2 and + 5.7 +5.7 at 4B and 8B); these gains remain at late checkpoints of the 400 400 -step run, and the margin over the strongest fixed-environment baseline grows with scale. The same recipe lifts multi-step tool-use benchmarks by + 13.9 +13.9 on ACEBench-Agent and + 5.7 +5.7 on BFCL v4 multi-turn.

SPADE shows that a single model can design its own training environments and improve from them, a step from fixed benchmarks toward open-ended, continual self-improvement.

## Acknowledgments

This research was supported by the UW-Amazon Science Gift Hub, UW-Tsukuba Amazon NVIDIA Cross Pacific AI Initiative (XPAI), Sony Research Award, Modal Research Grants, Tinker Research Grants, Character.AI, DoorDash, Open Philanthropy, Coefficient Giving, Toyota Research Institute, and the Schmidt AI2050 Fellows program. This material is based upon work supported by the Defense Advanced Research Projects Agency and the Air Force Research Laboratory, contract number(s): FA8650-23-C-7316. Any opinions, findings and conclusions, or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of AFRL or DARPA.

## Appendix E Theoretical Analysis [back to contents]

This section formally analyzes the incentive structure of the hint-based regret reward (hereafter hint-regret) introduced in Section 4.2 . We model the interaction between the Environment Designer and Reasoning Agent as a two-player game: the Environment Designer selects an environment distribution, while the Reasoning Agent selects a policy. Since LLM inference is stochastic, all payoffs are defined through expected verifier returns.

The main result is an equilibrium characterization of the idealized game. If positive hint-regret remains anywhere, then the current unhinted Reasoning Agent is suboptimal there, and the Environment Designer can profitably concentrate on it. Consequently, at any pure Nash equilibrium, the Environment Designer ’s expected regret is zero, the Reasoning Agent is hint-free optimal on every environment in ℳ \mathcal{M} , and privileged hints become vacuous.

### E.1 Setup and Assumptions

##### Environment class.

Let 𝒰 \mathcal{U} be a finite universe of candidate environments. The set of mathematically valid executable environments is denoted by ℳ ⊆ 𝒰 \mathcal{M}\subseteq\mathcal{U} . These are environments whose specifications are internally consistent and whose attempted solutions can be evaluated by an external verifier. In the implementation, ℳ \mathcal{M} is approximated by syntax checks, executability checks, and, in the tool-use setting, solvability filtering.

##### Distribution notation.

For any finite set 𝒳 \mathcal{X} , let Δ ⁡ ( 𝒳 ) \Delta(\mathcal{X}) denote the set of probability distributions over 𝒳 \mathcal{X} . If D ∈ Δ ⁡ ( ℳ ) D\in\Delta(\mathcal{M}) (the Environment Designer ’s environment distribution; we reuse the letter D D for this distribution, while the subscript in u D u_{D} below labels the Environment Designer role) and ℬ ⊆ ℳ \mathcal{B}\subseteq\mathcal{M} , write D ⁡ ( ℬ ) := ∑ e ∈ ℬ D ⁡ ( e ) . D(\mathcal{B}):=\sum_{e\in\mathcal{B}}D(e). A property holds for D D -almost every environment if the set on which it fails has D D -mass zero.

##### Inference protocol.

Fix an inference budget B inf B_{\text{inf}} . This budget includes all evaluation-time choices that affect the set of possible Reasoning Agent trajectories: model architecture, context length, prompt format, maximum generation length, sampling rule, temperature, number of rollouts, tool access, memory access, and verifier. Let 𝒴 B inf \mathcal{Y}_{B_{\text{inf}}} denote the finite trajectory space induced by this budget.

##### Fine-tuning budget.

Fix a fine-tuning budget F F . This budget includes all training-time choices that determine which policies the procedure can produce: optimizer, objective, number of updates, and regularization. Let Π \Pi denote the set of policies attainable under this budget; we take Π \Pi to be finite, so maxima over Π \Pi are attained.

##### Returns with and without hints.

For each environment e ∈ ℳ e\in\mathcal{M} , let h ⁡ ( e ) h(e) denote the privileged hint emitted by the Environment Designer ; hints are modeled as a fixed map e ↦ h ⁡ ( e ) e\mapsto h(e) , so strategic hint choice by the Environment Designer is outside this idealization. A Reasoning Agent policy π ∈ Π \pi\in\Pi induces a distribution over trajectories in 𝒴 B inf \mathcal{Y}_{B_{\text{inf}}} given either the unhinted input e e or the hinted input ( e , h ⁡ ( e ) ) (e,h(e)) . Let r ⁡ ( e , y ) ∈ [ 0 , 1 ] r(e,y)\in[0,1] denote the verifier return of trajectory y ∈ 𝒴 B inf y\in\mathcal{Y}_{B_{\text{inf}}} on environment e e . Returns are normalized to [ 0 , 1 ] [0,1] for the analysis; training uses a shaped reward in [ − 1 , 1 ] [-1,1] (Algorithm 1 ). Here r ⁡ ( e , y ) r(e,y) is the per-trajectory return written r A ​ ( y ∣ e ) r_{A}(y\mid e) in Section 4 , and R π ​ ( e ) R_{\pi}(e) , R π h ​ ( e ) R_{\pi}^{h}(e) below are the population analogues of the empirical means r ¯ A ​ ( e ) \bar{r}_{A}(e) and r ¯ A ​ ( e ∣ h ) \bar{r}_{A}(e\mid h) .

The unhinted expected return of policy π \pi on environment e e is R π ( e ) := 𝔼 y ∼ π ( ⋅ ∣ e ) [ r ( e , y ) ] , R_{\pi}(e):=\mathbb{E}_{y\sim\pi(\cdot\mid e)}[r(e,y)], and the hinted expected return is R π h ( e ) := 𝔼 y ∼ π ( ⋅ ∣ e , h ( e ) ) [ r ( e , y ) ] . R_{\pi}^{h}(e):=\mathbb{E}_{y\sim\pi(\cdot\mid e,h(e))}[r(e,y)].

##### Game payoffs.

The Environment Designer chooses a distribution D ∈ Δ ⁡ ( ℳ ) D\in\Delta(\mathcal{M}) . Its payoff is the expected hint-based regret u D ​ ( D , π ) := 𝔼 e ∼ D ​ [ R π h ​ ( e ) − R π ​ ( e ) ] . u_{D}(D,\pi):=\mathbb{E}_{e\sim D}\left[R_{\pi}^{h}(e)-R_{\pi}(e)\right]. The Reasoning Agent ’s payoff is its unhinted expected return u A ​ ( D , π ) := 𝔼 e ∼ D ​ [ R π ​ ( e ) ] . u_{A}(D,\pi):=\mathbb{E}_{e\sim D}[R_{\pi}(e)]. Together these define the expected-regret self-play game on Δ ⁡ ( ℳ ) × Π \Delta(\mathcal{M})\times\Pi .

##### Pure Nash equilibrium.

A pair ( D ∘ , π ∘ ) ∈ Δ ⁡ ( ℳ ) × Π (D^{\circ},\pi^{\circ})\in\Delta(\mathcal{M})\times\Pi is a pure Nash equilibrium of this game if neither player can improve by unilateral deviation: u D ​ ( D ∘ , π ∘ ) ≥ u D ​ ( D , π ∘ ) ∀ D ∈ Δ ⁡ ( ℳ ) , u_{D}(D^{\circ},\pi^{\circ})\geq u_{D}(D,\pi^{\circ})\qquad\forall D\in\Delta(\mathcal{M}), and u A ​ ( D ∘ , π ∘ ) ≥ u A ​ ( D ∘ , π ) ∀ π ∈ Π . u_{A}(D^{\circ},\pi^{\circ})\geq u_{A}(D^{\circ},\pi)\qquad\forall\pi\in\Pi.

##### Optimal values.

For each environment, define the optimal unhinted value R ⋆ ​ ( e ) := max π ∈ Π ⁡ R π ​ ( e ) . R^{\star}(e):=\max_{\pi\in\Pi}R_{\pi}(e).

###### Assumption E.1 (Sound generation) .

The Environment Designer only samples mathematically valid executable environments: D ∈ Δ ⁡ ( ℳ ) . D\in\Delta(\mathcal{M}). Operationally, this corresponds to syntax checks, executability checks, and, in the tool-use setting, solvability filtering. (Stated for completeness: the game is defined over Δ ⁡ ( ℳ ) \Delta(\mathcal{M}) throughout.)

###### Assumption E.2 (Articulated hints) .

Conditioning on the hint attains the optimal unhinted value: for every policy π ∈ Π \pi\in\Pi and every environment e ∈ ℳ e\in\mathcal{M} , R π h ​ ( e ) = R ⋆ ​ ( e ) . R_{\pi}^{h}(e)=R^{\star}(e). In particular R π h ​ ( e ) ≥ R π ​ ( e ) R_{\pi}^{h}(e)\geq R_{\pi}(e) .

###### Assumption E.3 (Internalizability of hinted behavior) .

Hinted behavior is attainable without the hint: for every policy π ∈ Π \pi\in\Pi there exists a policy π ′ ∈ Π \pi^{\prime}\in\Pi with R π ′ ​ ( e ) = R π h ​ ( e ) for all ​ e ∈ ℳ . R_{\pi^{\prime}}(e)=R_{\pi}^{h}(e)\qquad\text{for all }e\in\mathcal{M}.

### E.2 Main Results

Theorem E.5 shows that every pure Nash equilibrium in this setup drives hint-regret to zero, so that the Reasoning Agent is optimal on every environment in ℳ \mathcal{M} . The ideal hint-regret enables this result, because it vanishes on environments the Reasoning Agent already solves and on unsolvable environments, where the hint cannot help, and is positive only where the Reasoning Agent fails unaided but a hint would close the gap. The Environment Designer therefore profits exactly by targeting this learnable frontier, and at equilibrium no gap can remain anywhere, since the Environment Designer could otherwise deviate to it profitably. This is what distinguishes the regret reward from the plain adversarial-difficulty reward − 𝔼 e ∼ D ​ [ R π ​ ( e ) ] -\mathbb{E}_{e\sim D}[R_{\pi}(e)] , which provides no mechanism restricting the Environment Designer ’s support to useful environments.

###### Lemma E.4 (Hint-regret equals hint-free regret) .

Under Assumption E.2 , for any Reasoning Agent policy π ∈ Π \pi\in\Pi and any environment e ∈ ℳ e\in\mathcal{M} , R π h ​ ( e ) − R π ​ ( e ) = R ⋆ ​ ( e ) − R π ​ ( e ) . R_{\pi}^{h}(e)-R_{\pi}(e)=R^{\star}(e)-R_{\pi}(e). In particular the hint-regret is nonnegative, and strictly positive if and only if R π ​ ( e ) < R ⋆ ​ ( e ) R_{\pi}(e)<R^{\star}(e) .

###### Proof.

By Assumption E.2 , R π h ​ ( e ) = R ⋆ ​ ( e ) R_{\pi}^{h}(e)=R^{\star}(e) ; subtracting R π ​ ( e ) R_{\pi}(e) gives the identity. The remaining claims follow since R ⋆ ​ ( e ) ≥ R π ​ ( e ) R^{\star}(e)\geq R_{\pi}(e) . ∎

###### Theorem E.5 (Nash equilibria imply hint-free optimality on every environment) .

Under Assumptions E.1 – E.3 , every pure Nash equilibrium ( D ∘ , π ∘ ) (D^{\circ},\pi^{\circ}) of the expected-regret self-play game satisfies u D ​ ( D ∘ , π ∘ ) = 0 . u_{D}(D^{\circ},\pi^{\circ})=0. Moreover, the pointwise regret vanishes everywhere: for every e ∈ ℳ e\in\mathcal{M} , R π ∘ ​ ( e ) = R ⋆ ​ ( e ) , R π ∘ h ​ ( e ) = R π ∘ ​ ( e ) . R_{\pi^{\circ}}(e)=R^{\star}(e),\qquad R_{\pi^{\circ}}^{h}(e)=R_{\pi^{\circ}}(e).

Such equilibria exist: Assumptions E.2 and E.3 guarantee a uniformly optimal policy π ⋆ \pi^{\star} with R π ⋆ ​ ( e ) = R ⋆ ​ ( e ) R_{\pi^{\star}}(e)=R^{\star}(e) for all e e , and any pair ( D , π ⋆ ) (D,\pi^{\star}) is a pure Nash equilibrium, so the statement is not vacuous.

###### Proof.

Let ( D ∘ , π ∘ ) (D^{\circ},\pi^{\circ}) be a pure Nash equilibrium. By Lemma E.4 , ρ reg ​ ( e ) := R π ∘ h ​ ( e ) − R π ∘ ​ ( e ) = R ⋆ ​ ( e ) − R π ∘ ​ ( e ) ≥ 0 for every ​ e ∈ ℳ . \rho^{\text{reg}}(e):=R_{\pi^{\circ}}^{h}(e)-R_{\pi^{\circ}}(e)=R^{\star}(e)-R_{\pi^{\circ}}(e)\geq 0\qquad\text{for every }e\in\mathcal{M}.

Reasoning Agent side. By Assumption E.3 , there is π ′ ∈ Π \pi^{\prime}\in\Pi with R π ′ ​ ( e ) = R π ∘ h ​ ( e ) R_{\pi^{\prime}}(e)=R_{\pi^{\circ}}^{h}(e) for all e e ; by Assumption E.2 , R π ∘ h ​ ( e ) = R ⋆ ​ ( e ) R_{\pi^{\circ}}^{h}(e)=R^{\star}(e) , so R π ′ ​ ( e ) = R ⋆ ​ ( e ) ≥ R π ∘ ​ ( e ) R_{\pi^{\prime}}(e)=R^{\star}(e)\geq R_{\pi^{\circ}}(e) for every e ∈ ℳ e\in\mathcal{M} . Hence u A ​ ( D ∘ , π ′ ) = 𝔼 e ∼ D ∘ ​ [ R ⋆ ​ ( e ) ] ≥ 𝔼 e ∼ D ∘ ​ [ R π ∘ ​ ( e ) ] = u A ​ ( D ∘ , π ∘ ) . u_{A}(D^{\circ},\pi^{\prime})=\mathbb{E}_{e\sim D^{\circ}}[R^{\star}(e)]\geq\mathbb{E}_{e\sim D^{\circ}}[R_{\pi^{\circ}}(e)]=u_{A}(D^{\circ},\pi^{\circ}). Since π ∘ \pi^{\circ} is a best response to D ∘ D^{\circ} , equality holds, so 𝔼 e ∼ D ∘ ​ [ R ⋆ ​ ( e ) − R π ∘ ​ ( e ) ] = 0 \mathbb{E}_{e\sim D^{\circ}}[R^{\star}(e)-R_{\pi^{\circ}}(e)]=0 . The integrand is nonnegative, hence ρ reg ​ ( e ) = 0 \rho^{\text{reg}}(e)=0 for D ∘ D^{\circ} -almost every e e , and therefore u D ​ ( D ∘ , π ∘ ) = 𝔼 e ∼ D ∘ ​ [ ρ reg ​ ( e ) ] = 0 . u_{D}(D^{\circ},\pi^{\circ})=\mathbb{E}_{e\sim D^{\circ}}[\rho^{\text{reg}}(e)]=0.

Environment Designer side. Fix any e ∈ ℳ e\in\mathcal{M} . The Environment Designer may deviate to the point mass δ e ∈ Δ ⁡ ( ℳ ) \delta_{e}\in\Delta(\mathcal{M}) , which yields u D ​ ( δ e , π ∘ ) = ρ reg ​ ( e ) u_{D}(\delta_{e},\pi^{\circ})=\rho^{\text{reg}}(e) . Since ( D ∘ , π ∘ ) (D^{\circ},\pi^{\circ}) is a Nash equilibrium, ρ reg ​ ( e ) = u D ​ ( δ e , π ∘ ) ≤ u D ​ ( D ∘ , π ∘ ) = 0 . \rho^{\text{reg}}(e)=u_{D}(\delta_{e},\pi^{\circ})\leq u_{D}(D^{\circ},\pi^{\circ})=0. Combined with ρ reg ​ ( e ) ≥ 0 \rho^{\text{reg}}(e)\geq 0 from Lemma E.4 , this gives ρ reg ​ ( e ) = 0 \rho^{\text{reg}}(e)=0 for every e ∈ ℳ e\in\mathcal{M} . Therefore R π ∘ ​ ( e ) = R ⋆ ​ ( e ) , R π ∘ h ​ ( e ) = R π ∘ ​ ( e ) R_{\pi^{\circ}}(e)=R^{\star}(e),\qquad R_{\pi^{\circ}}^{h}(e)=R_{\pi^{\circ}}(e) for every e ∈ ℳ e\in\mathcal{M} . ∎

## Appendix F Method and Experiment Details [back to contents]

### F.1 System Prompts and Templates

##### Environment-generation prompt.

The Environment Designer receives the prompt below to generate a new single-turn game as executable Python; the skill name, its description, and a short list of example concepts fill the slots shown in angle brackets. In the canonical corpus-grounded runs the Environment Designer instead conditions on a freshly sampled corpus document, and the example-concept slot is unused. The single-turn prompt serves the single-turn setting of Section 3.1 (one derivation task, graded per attempt), while the multi-turn prompts demand stateful interaction. The \boxed{} extraction in the displayed contracts stops at the first closing brace, so generated environments use plain, brace-free answer strings.

##### Multi-turn environment-generation prompt.

Because gameplay spans multiple turns, the Environment Designer also receives a dedicated prompt for generating interactive, multi-turn games (state that evolves across turns, branching actions), shown below with the same placeholder convention.

##### Corpus-grounded interactive generation prompt.

The canonical games runs use the corpus-grounded variant below: the sampled document replaces the example-concept list, and the specification demands hidden state, multi-turn structure, and partial reward. The skill, difficulty, and document slots are shown in angle brackets.

##### Tool-use generation prompt.

The tool-use runs generate environments with the multi-turn variant below (selected by SPARE_MULTITURN_ENV_GEN=1 in the released launchers). The skill, difficulty, and example slots fill as in the games prompts; each generation call additionally samples one of ten application domains and one of four task variants (weighted 3 : 2 : 1 : 1 3{:}2{:}1{:}1 ), whose filler blocks follow the main template.

##### Reasoning Agent gameplay prompt.

The Reasoning Agent receives each turn’s observation wrapped in the template below and answers in \boxed{} form.

### F.2 Implementation Details

Two auxiliary Environment Designer reward terms are disabled in all full- SPADE runs: a per-environment EMA-based learning-potential bonus ( Kanitscheider et al., 2021 ; Zhang et al., 2023 ) , enabled only as the standalone reward replacement evaluated in Section 7.2 , and a frontier bonus (extra reward for environments with a large fast-versus-slow EMA gap | μ fast − μ slow | |\mu_{\text{fast}}-\mu_{\text{slow}}| ). No separate variance bonus (a r ¯ A ​ ( 1 − r ¯ A ) \bar{r}_{A}(1-\bar{r}_{A}) -style reward for mixed outcomes) is used. Failed environment candidates are regenerated up to a fixed number of attempts. Table 5 lists the full training configuration.

Pool lifecycle. At each regeneration the previous environment set is deleted and replaced; the environment memory evicts oldest-first at its 200 200 -record cap; rejected candidates are persisted for inspection; generation retries up to five attempts per environment.

Hint generation detail. The privileged hint is produced by a separate designer-side call conditioned on the generated environment’s source code: the hint writer sees the code, while the Reasoning Agent never does.

Validation detail. Every candidate environment must pass a programmatic smoke test: the class is instantiated, reset() is called, and a few probe actions are stepped through, discarding candidates that fail to parse or crash. The tool-use setting adds the two semantic checks of Section 5.3 : a deterministic reset gate that rejects environments in which a success criterion errors on the freshly reset state under every tested seed, and an LLM screen that rejects impossible environments (unreachable, pre-satisfied, or underivable success criteria) while keeping hard-but-feasible ones.

### F.3 Reproducibility

The training and evaluation code is released. The configuration files for every run reported here are released with the paper. The evaluation output JSONs and the scripts that produce every figure are included alongside the code.

#### F.3.1 Comparability Notes for Table 2

The reference systems in Table 2 were trained and evaluated by their own authors on their own harnesses; we reprint their published scores for context and record the protocol differences here. BFCL versions. Our rows and Agent-World ( Dong et al., 2026 ) report the BFCL v4 multi-turn suite. AWM ( Wang et al., 2026b ) and EnvScaler ( Song et al., 2026 ) label the suite v3, which contains the same four multi-turn subcategories; EnvScaler evaluates a frozen 2024-09-22 data snapshot whose repository notes minor differences from later releases. τ 2 \tau^{2} -bench variants. AWM evaluates τ 2 \tau^{2} -bench-verified, a fork with task corrections, runs the Telecom domain in solo mode (agent only, no user simulator), and uses a GPT-5.1 user simulator in the other domains; AgentScaler ( Fang et al., 2025a ) does not state its user simulator. We evaluate the standard τ 2 \tau^{2} -bench release. Aggregation. Reference-row Avg cells follow the rule stated in the table caption; Agent-World and AWM print their own aggregates (61.8/65.4 and task-weighted 33.5/39.0), which do not equal the unweighted means of the domain scores they report. Base models. Our rows post-train Qwen3-4B-Instruct-2507, Qwen3-8B, and Qwen3-30B-A3B-Instruct-2507; the reference systems post-train their own base checkpoints, with training data and budgets that differ from ours.

## Appendix G Extended Ablations [back to contents]

Cross-family transfer. As a check on a non-Qwen backbone, we ran the same recipe on Nemotron-30B-A3B-BF16, evaluating only the Reasoning-Gym suite; AIME 2025/2026, GPQA-Diamond, and LiveCodeBench-v6 were not evaluated on this backbone, so this checks that the training dynamics are not Qwen-specific rather than serving as a matched cross-family comparison. All four Reasoning-Gym categories rise above the untrained base, with the largest Nemotron gains in RG-Cognition ( + 9.6 +9.6 ) and RG-Algorithmic ( + 9.3 +9.3 ; Figure 16 ).

Table 6 expands the component-controlled ablations of Table 3 to every games-setting variant reported in this paper, including the skill-diversity run, with each variant’s selected checkpoint and its GEM overall win rate. Checkpoints are selected per variant by the best suite average (the mean of the eight benchmark columns); the corresponding evaluation trajectories appear in Figures 11 , 15 , and 12 .

## Appendix H Extended Related Work [back to contents]

### H.1 Self-Play for LLMs

Self-play has been a cornerstone of AI since Tesauro et al. (1995) trained TD-Gammon through self-play in backgammon. AlphaGo ( Silver et al., 2016 ) combined Monte Carlo tree search with deep neural networks and self-play to defeat a human Go champion, and AlphaZero ( Silver et al., 2017 ; Silver et al., 2018 ) extended the approach to chess, shogi, and Go from tabula rasa with no human data. OpenAI Five ( Berner et al., 2019 ) and AlphaStar ( Vinyals et al., 2019 ) scaled multi-agent self-play to Dota 2 and StarCraft II, while Cicero ( † et al.(2022)(FAIR)†, Bakhtin, Brown, Dinan, Farina, Flaherty, Fried, Goff, Gray, Hu, et al., FAIR ) combined language models with strategic reasoning in Diplomacy. Littman (1994) formalized the Markov-game framework underlying these results, and Irving et al. (2018) proposed debate as an AI-safety mechanism grounded in self-play. The asymmetric self-play paradigm of Sukhbaatar et al. (2017) , in which one agent proposes challenges while another solves them, provides the conceptual template for teacher-student environment design.

Translating self-play to LLMs introduces new challenges because rewards are sparse, outputs are discrete sequences, and the “environment” is open-ended language. SPIN ( Chen et al., 2024 ) applies self-play fine-tuning by training the LLM to distinguish its own outputs from human demonstrations, converting weak models to strong ones. Self-Rewarding Language Models ( Yuan et al., 2024 ) let the LLM judge its own outputs to generate preference data, iteratively improving both generation and evaluation. SPAG ( Cheng et al., 2024 ) uses adversarial language games (Adversarial Taboo) to incentivize strategic reasoning through a zero-sum objective. ReST EM ( Singh et al., 2023 ) alternates between sampling model solutions filtered by a binary correctness reward and supervised fine-tuning on the filtered correct rollouts. Prover-Verifier Games ( Kirchner et al., 2024 ) train a prover to produce legible solutions that a weaker verifier can check, improving output interpretability. ReMA ( Wan et al., 2025 ) decomposes reasoning via multi-agent RL into a high-level meta-thinking agent (strategy and decomposition) and a low-level reasoning agent (step-by-step execution), trained jointly.

The most relevant line of recent work uses LLMs as their own source of training data in self-play, with varying degrees of reliance on external data. At one extreme, fully data-free methods bootstrap from minimal seeds: Absolute Zero Reasoner (AZR) ( Zhao et al., 2025 ) has a single model (shared parameters) propose and solve code-reasoning triplets (deduction, abduction, induction) with proposer reward 1 − r ¯ solve 1-\bar{r}_{\text{solve}} computed from solver Monte-Carlo success rates verified by a code executor, bootstrapping from a single identity function. R-Zero ( Huang et al., 2025 ) instead instantiates a Challenger and a Solver as two independently optimized copies of the same base LLM, training the Challenger via GRPO with a self-consistency uncertainty reward; the paper reports that this two-model design outperforms a single-model variant in ablations but plateaus after a few iterations. PopuLoRA ( Castanyer et al., 2026 ) extends this asymmetric paradigm to co-evolving populations of LoRA-adapter teachers and students with cross-evaluation between sub-populations. In a related but mechanistically distinct line, G-Zero ( Huang et al., 2026 ) performs DPO-based self-distillation over hint-induced preference pairs: a Proposer trained via GRPO emits a hint h h for query q q , the Generator π G \pi_{G} produces both an unassisted response a hard ∼ π G ( ⋅ ∣ q ) a_{\text{hard}}\sim\pi_{G}(\cdot\mid q) and a hint-conditional response a assisted ∼ π G ( ⋅ ∣ q , h ) a_{\text{assisted}}\sim\pi_{G}(\cdot\mid q,h) , and DPO is applied with a assisted a_{\text{assisted}} as chosen and a hard a_{\text{hard}} as rejected; the Proposer’s reward is Hint- δ \delta , the per-token mean log-probability shift induced on a hard a_{\text{hard}} when the hint is prepended to the Generator’s context. All supervision is derived from a single model’s own outputs under hint vs no-hint contexts, placing the method closer to the self-rewarding and self-distillation line ( Chen et al., 2024 ; Yuan et al., 2024 ; Singh et al., 2023 ) than to verifier-grounded agent-environment co-evolution. Tool-R0 ( Acikgoz et al., 2026 ) adapts the same Challenger-Solver paradigm to tool use, training the generator with a solve-rate-band reward plus a semantic alignment score and the solver with soft tool-call matching, similarly finding that separate parameters outperform a shared-weight setup. Self-Questioning Language Models ( Chen et al., 2025c ) have a single model propose and solve problems from only a topic prompt, with the proposer rewarded for majority-vote calibration (problems neither always solved nor always missed). Language Self-Play ( Kuba et al., 2025 ) proposes a data-free framework where question generation and answer improvement reinforce each other. PasoDoble ( Zhang et al., 2025d ) pairs an adversarial proposer and solver grounded in a pretraining knowledge base, sustaining improvement beyond R-Zero’s plateau. At the other extreme, methods that retain limited seed data or curated evaluation sets include SeRL ( Fang et al., 2025b ) , which uses a few-shot-prompted question generator with a difficulty-band filter and trains only the solver via Reinforce++ on majority-vote rewards from 500 seed instructions, and Sundaram et al. (2026) , who ground the teacher’s reward in measured student improvement on curated target problems instead of proxy statistics. Self-Challenging Language Model Agents ( Zhou et al., 2025 ) let agents propose harder task variants for themselves and then attempt to solve them. Autodata ( Kulikov et al., 2026 ) generalizes the self-instruct line by casting an LLM agent as a meta-optimizing data scientist that iteratively constructs training data; its Agentic Self-Instruct instantiation selects examples by the separation between a strong and a weak reference solver, targeting learnable examples over merely hard ones, a frontier-targeting principle analogous to SPADE ’s hint-based regret but operating over offline data creation with fixed reference solvers, without the online co-evolution of a gradient-trained generator. Vision-Zero ( Wang et al., 2025a ) brings gamified multi-agent self-play (Who Is the Spy?) to vision-language models with iterative self-play policy optimization. SPELL ( Yang et al., 2025 ) co-trains a three-role self-play loop (questioner, responder, verifier) on long documents, using a history-memory curriculum to generate progressively harder questions for evolving long-context capabilities. SPC ( Chen et al., 2025b ) trains a self-play critic via adversarial games to improve LLM reasoning evaluation. TextArena ( Guertler et al., 2025 ) provides an open-source collection of 57+ competitive text-based game environments with a Gym-compatible API for LLM evaluation and self-play training. Sarkar et al. (2025) train LLMs for Among Us-style social deduction with multi-agent RL. Self-Play with Execution Feedback ( Dong et al., 2024 ) uses code execution to verify instruction-following in a self-play loop. SPIRAL ( Liu et al., 2025a ) introduces self-play on zero-sum games as a multi-agent, multi-turn RL framework that incentivizes reasoning through game-theoretic competition. SPICE ( Liu et al., 2025b ) extends self-play to corpus environments via information asymmetry: a Challenger mines documents from a large corpus to generate diverse reasoning tasks with document-grounded answers, while a Reasoner solves them without document access; the corpus prevents hallucination amplification and information-symmetry collapse seen in ungrounded self-play. SWE-RL ( Wei et al., 2026 ) applies RL to open software evolution tasks, and SSR ( Wei et al., 2025 ) trains software engineering agents through self-play. Anchored Self-Play ( Choi et al., 2026 ) has a single model play a bug-generator and a fixer for code repair with a difficulty-band reward, adding reference-bug mixing and embedding-similarity shaping to keep self-generated bugs on the realistic distribution, preventing drift off it, and GASP ( Jana et al., 2026 ) guides asymmetric self-play for coding LLMs with grounding in real data. Chae et al. (2025) provide a systematic analysis of when LLM self-play succeeds and when it fails, analyzing the “invisible leash” where generation quality is bounded by base-model capability. Shafayat et al. (2025) investigate whether large reasoning models can self-train and find that naive self-play degrades performance without careful curriculum control. Liu et al. (2026b) analyze when self-synthetic self-play actually improves, showing that sustained evolution requires the synthetic pipeline to guarantee learnable information gain.

Two themes emerge across this body of work. First, all data-free self-play methods generate tasks (a problem statement paired with a sparse terminal reward) rather than full environments with state transitions. Second, the generator in every data-free case is either frozen or trained with heuristic proxy rewards (learnability, difficulty, variance) that risk reward hacking and distributional drift. By contrast, SPADE generates full MDP environments (state space, transition function, reward function, and verification code) as executable Python, and trains the Environment Designer via RL with hint-based regret that is grounded in measured Reasoning Agent return rather than proxy statistics.

### H.2 Unsupervised Environment Design and Open-Endedness

Curriculum learning ( Bengio et al., 2009 ) established the principle that ordering training examples from easy to hard accelerates learning. Quality-Diversity (QD) algorithms, exemplified by MAP-Elites ( Mouret and Clune, 2015 ) , illuminate the search space by maintaining an archive of high-performing solutions across a structured behavior space, providing the algorithmic substrate for many open-ended environment-generation systems. Paired Open-Ended Trailblazer (POET) ( Wang et al., 2019 ) pioneered the paradigm of co-evolving environments alongside agents, using evolutionary search to grow a population of parameterized BipedalWalker terrains together with the policies that solve them, with explicit transfer attempts moving high-performing agents across environments. Unsupervised Environment Design (UED) extends this idea by automatically generating training environments instead of selecting from a fixed pool. PAIRED ( Dennis et al., 2020 ) formalized UED via a minimax regret objective: an adversary generates environment parameters to maximize the gap between an antagonist’s and a protagonist’s returns, producing curricula of increasing complexity while avoiding unsolvable environments. Dennis et al. (2020) proved that at Nash equilibrium, the protagonist plays a minimax regret policy, connecting UED to decision theory. Prioritized Level Replay (PLR) ( Jiang et al., 2021b ) replaced the learned adversary with a replay buffer that prioritizes high-regret levels, achieving comparable curriculum quality with lower computational cost. Replay-Guided Adversarial Environment Design ( Jiang et al., 2021a ) combined the adversarial generator with prioritized replay, using the replay distribution to guide the adversary toward high-regret regions of the environment space. ACCEL ( Parker-Holder et al., 2022 ) introduced evolutionary mutations of high-regret levels, compounding complexity over training without domain-specific heuristics and recovering minimax regret guarantees at a fraction of the compute required by population-based methods like POET. Mediratta et al. (2023) stabilized PAIRED-style learned adversaries via entropy regularization and behavioral cloning between protagonist and antagonist, addressing the entropy collapse that destabilizes UED. Rutherford et al. (2024) investigated regret approximations used in PLR and ACCEL, showing that common proxies (positive value loss, maximum Monte Carlo) correlate with success rate rather than true regret, and proposing Sampling For Learnability (SFL) as an improved estimator. Monette et al. (2025) recast UED as a nonconvex-concave optimization over a categorical level distribution, proving convergence to first-order Nash equilibria and generalizing learnability scores to continuous-return settings. CENIE ( Teoh et al., 2024 ) augmented regret-based UED with a novelty objective that measures how much a candidate environment pushes the agent into unexplored regions of the state-action space, finding that novelty and regret are synergistic rather than competing. DISCOVER ( Diaz-Bone et al., 2026 ) provides a complementary formal-analysis view from goal-conditioned RL: it scores candidate goals via current-policy value estimates balancing achievability, relevance, and novelty, and proves a UCB-style bound on time-to-target-achievability that depends only on the agent’s initial distance to the target, independent of task-space volume. The three-axis selection rule parallels SPADE ’s hint-based regret as a frontier-targeting curriculum signal, but DISCOVER operates over a fixed goal pool whereas SPADE generates the environment distribution itself.

A broader thread of open-endedness research motivates the need for unbounded environment spaces. Hughes et al. (2024) argue that open-endedness, defined as simultaneous novelty and learnability, is essential for superhuman AI, and that systems plateau when the environment parameterization is exhausted. Baker et al. (2019) demonstrated emergent tool use from multi-agent autocurricula in hide-and-seek, showing that competitive self-play in rich physics environments produces increasingly sophisticated strategies. OMNI ( Zhang et al., 2023 ) uses foundation models as a “Model of Interestingness” to filter open-ended task proposals, focusing the curriculum on tasks that are both learnable and interesting. OMNI-EPIC ( Faldor et al., 2024 ) extends this line by representing each environment as executable code generated by a foundation model, with a frozen FM judge of interestingness gating which generated tasks enter the archive; SPADE shares the code-as-environment representation but trains the Environment Designer via RL with hint-based regret, with no frozen interestingness judge. Imagined Autocurricula ( Güzel et al., 2025 ) applies PLR inside a learned diffusion world model trained from offline data, demonstrating that UED principles transfer to imagined environments. SIMA 2 ( Bolton et al., 2025 ) scales open-ended self-improvement to embodied 3D worlds: a Gemini-based agent uses foundation models to generate its own tasks and rewards and acquires new skills in previously unseen and even model-generated (Genie 3) environments, though it distributes the process across separate task-setter, agent, and reward models plus a distinct generative world model instead of a single policy that authors its own environments. Goldfeder et al. (2026) argue for Superhuman Adaptable Intelligence over AGI, emphasizing speed of adaptation over static benchmark performance. PAPRIKA ( Tajwar et al., 2025 ) trains generally curious agents on ten hand-designed task groups, showing that diverse multi-turn training produces transferable exploration strategies.

All classical UED methods operate in parameterized environment spaces (maze dimensions, terrain friction, grid layouts) with small, fixed design vocabularies. To our knowledge, SPADE is the first system to bring regret-based UED with an RL-trained Environment Designer that produces full MDP environments to LLM post-training: the environment space is unbounded (arbitrary Python code), the Environment Designer is the LLM rather than a separate adversary network, and hint-based regret provides the co-evolution signal without requiring a trained antagonist.

### H.3 Synthetic Environment Generation

A growing body of work uses LLMs to programmatically generate training environments for agentic RL, addressing the bottleneck of hand-curated environment design. Agent World Model (AWM) ( Wang et al., 2026b ) decomposes environment synthesis into five stages (scenario, task, database, interface, verification) to produce 1,000 SQLite-backed tool-use environments with MCP interfaces, training agents via GRPO with hybrid step-level and task-level rewards. ScaleEnv ( Tu et al., 2026 ) generates multi-turn tool-use environments by synthesizing API specifications, databases, and verification code from seed domains, scaling to thousands of environments for generalist interactive agent training. TermiGen ( Zhu et al., 2026 ) synthesizes high-fidelity terminal environments inside Docker containers with automated trajectory verification, producing diverse command-line tasks for terminal agent training. Nemotron-Terminal ( Pi et al., 2026 ) introduces Terminal-Task-Gen, a two-stage pipeline that combines dataset adaptation (transforming math, code, and SWE benchmarks into terminal-formatted prompts) with synthetic task generation (seed-based and skill-based, the latter driven by a Skill Taxonomy of nine domains and primitive skills); the resulting Terminal-Corpus is open-sourced, and Qwen3-32B post-trained via SFT reaches 27.4% on Terminal-Bench 2.0 (from a 3.4% baseline), surpassing Qwen3-Coder-480B (23.9%) at a fraction of the parameter count. SkillSynth ( Fan et al., 2026 ) constructs a scenario-mediated skill graph with 82,073 scenarios as nodes, 57,214 filtered skills as directed transitions, and 185,529 LLM-verified bridges, samples directed paths through the graph as workflow abstractions, and instantiates them via a multi-agent harness with dual execution-based and rubric-based verification (95.7% oracle pass rate, 3,560 verified task instances per run); the explicit objective is maximizing the diversity of execution trajectories over raw task count. Eurekaverse ( Liang et al., 2024 ) uses LLMs to generate Python terrain-program curricula (height-field functions) for robot skill learning, producing progressively harder physics environments guided by agent performance feedback, and validates on quadrupedal parkour. LLM-in-Sandbox ( Cheng et al., 2026 ) places LLMs in sandboxed code-execution environments and shows that agentic intelligence emerges from multi-turn interaction with executable feedback. EvoCUA ( Xue et al., 2026a ) evolves computer-use agents by synthesizing scalable GUI interaction experiences, generating training trajectories across diverse desktop applications. Xue et al. (2026b) extend this to autonomous continual learning where computer-use agents adapt to new environments through self-generated experience. DreamGym ( Chen et al., 2025e ) trains an LLM-based world model on demonstration trajectories from existing agentic environments (WebShop, ALFWorld, WebArena) and uses it to generate abstract-text rollouts that replace expensive real-environment interactions during RL. Simia ( Li et al., 2025 ) pushes this direction further by removing real environments entirely: Simia-SFT amplifies small seed trajectories into diverse SFT data via reasoning-model-simulated feedback, and Simia-RL performs PPO/GRPO directly against LLM-generated environment transitions; fine-tuned 7–32B Qwen and Llama models reach 36–59 average on τ 2 \tau^{2} -bench (Airline+Retail subset) without ever executing real tool code, but the framework still inherits the LLM-as-transition-model hallucination risk and the reduced two-domain τ 2 \tau^{2} setup is not directly comparable to the three-domain Avg used elsewhere. Lu et al. (2025) argue that tuning the environment (reward shaping, observation design) can be more effective than tuning the agent, providing a complementary perspective on environment optimization. Exploratory Iteration ( Jiang et al., 2025b ) grows a self-improvement task space by sampling informative intermediate solution iterates from previous episodes as starting points for new single-step training tasks, training K K -step inference-time self-improvement while only training on single-step transitions. Golden Goose ( Lu et al., 2026 ) synthesizes RLVR tasks from unverifiable internet text by extracting verifiable sub-claims, converting passive corpora into training signal without requiring curated datasets. AutoEnv ( Zhang et al., 2025b ) provides automated environments for measuring cross-environment agent transfer, enabling systematic evaluation of generalization. Synthetic Sandbox ( Zhou et al., 2026 ) generates sandboxed ML-engineering environments for training software agents on realistic development workflows. RLAnything ( Wang et al., 2026a ) proposes a dynamic RL system that jointly optimizes policy and reward model while adapting the task distribution via perturbation of existing tasks. GenEnv ( Guo et al., 2025 ) targets difficulty-aligned environment generation with a curriculum reward signal. Agent-World ( Dong et al., 2026 ) mines real-world environments and toolsets from web content (1,978 environments, 19,822 tools) and applies a self-evolving training arena that diagnoses agent weaknesses and generates targeted tasks across rounds. AgentScaler ( Fang et al., 2025a ) clusters over 30,000 real APIs into more than 1,000 simulated tool-use domains via Louvain community detection on a parameter-similarity graph, materializes each tool as a Python class operating on a per-domain database schema, and trains 4B/8B/30B-A3B agents via two-phase supervised fine-tuning on filtered agent-user trajectories without RL. EnvScaler ( Song et al., 2026 ) programmatically synthesizes tool-interactive environments for multi-turn tool-use agent training, and EnvFactory ( Xu et al., 2026b ) scales executable tool-use environment synthesis paired with a stable RL recipe. From Trainee to Trainer ( Chen et al., 2026 ) narrows the adaptivity gap by letting the current RL checkpoint reconfigure its own environment generator from diagnosed failures across training rounds, though it tunes a fixed set of generator parameters and does not emit executable environment code. AutoPlay ( Ramrakhya et al., 2025 ) addresses task synthesis for UI agents (mobile and desktop) by first running an MLLM explorer in each app to gather state and functionality information, then having a frozen GPT-4o task-generator condition on those exploration trajectories plus task-guideline prompts to propose grounded tasks; the executor is trained via SFT and GRPO with binary outcome rewards from an MLLM verifier, gaining 20.6 points on AndroidWorld over Qwen2.5-VL-7B. InfiniteWeb ( Zhang et al., 2026e ) synthesizes complete static-HTML/localStorage websites alongside tasks and dense-reward JavaScript evaluators via task-centric test-driven development; UI-TARS-1.5-7B post-trained with GRPO on 600 generated tasks improves on OSWorld from 24.5 to 31.4 and on Online-Mind2Web from 23.0 to 28.7, with the largest gains concentrated in easy and medium difficulty buckets. EvoEnv ( Shi et al., 2026 ) co-trains a single LLM under generator and solver role-conditioning via shared-parameter GRPO, producing reusable Python verifier-and-prompt artifacts whose oracle and scorer remain frozen at training time; the generator reward combines staged validation, solver-relative difficulty calibration targeting 30% solver accuracy, and an embedding-based novelty bonus, with evaluation on three model families restricted to single-shot reasoning benchmarks (Qwen3-4B-Thinking-2507 improves from 72.4 to 74.8 averaged across eight math, code, and science benchmarks). The environment interface is single-shot scoring (sampler, oracle, renderer, scorer) without state evolution or step-level rewards, so the framework does not extend to multi-turn agentic settings such as tool use or terminal workflows; SPADE differs in three respects: (i) the Environment Designer is rewarded via hint-based regret grounded in Reasoning Agent return rather than validation and novelty signals, (ii) environments are full MDPs with reset/step interfaces that unify single-turn and multi-turn settings, and (iii) evaluation spans games and tool use in addition to reasoning.

These methods produce useful training material, and some incorporate feedback-driven adaptation where the generation distribution shifts in response to agent progress: Eurekaverse evolves environments based on agent performance statistics, and EvoCUA iterates synthesis with an improving policy. However, even in these cases the generator LLM receives no RL gradients; adaptation operates through prompting heuristics or iterative data filtering, without joint optimization. By contrast, SPADE ’s Environment Designer is a genuine RL learner, trained via hint-based regret in the same optimization loop as the Reasoning Agent , producing full MDP environments at the Reasoning Agent ’s competence frontier.

### H.4 Environment Scaling

A growing consensus holds that the next frontier for agentic RL is scaling environments rather than algorithms. Silver and Sutton (2025) articulate this vision most directly, arguing that the field is entering an “era of experience” in which the primary bottleneck is generating sufficiently diverse and abundant training environments. Zhang et al. (2026b) argue in the same vein that scalable, diverse environments are what drive generalizable agents. AgentRL ( Zhang et al., 2025a ) provides a multi-turn, multi-task RL framework with a fully asynchronous generation-training pipeline, cross-policy sampling for improved exploration, and task advantage normalization, training a single agent across five agentic domains to outperform frontier models. SCALER ( Xu et al., 2026a ) converts competitive programming problems (from CodeContests) into parameterized single-turn reasoning environments at controlled difficulty levels, demonstrating that scaling the number and diversity of training problems yields consistent improvements in mathematical reasoning. RLVE ( Zeng et al., 2025 ) creates 400 hand-engineered verifiable environments for RL training with adaptive difficulty levels and per-environment custom verifiers (mixing rule-based parsing, soft scoring, and code execution) in place of LLM-as-judge. WebScale-RL ( Cen et al., 2025 ) builds an automated data pipeline that harvests web content to create RL training environments at pretraining scale, showing that more diverse environments produce better generalization. Endless Terminals ( Gandhi et al., 2026 ) procedurally generates 3,255 verified terminal-use tasks via a four-stage pipeline and demonstrates that vanilla PPO with binary rewards yields substantial gains as the number of training environments scales, with transfer to TerminalBench 2.0. Self-Evolving Curriculum ( Chen et al., 2025d ) dynamically adjusts the difficulty distribution of training problems based on the learner’s current performance, preventing saturation on easy examples. TTCS ( Yang et al., 2026 ) co-evolves a gradient-trained problem synthesizer with a solver via GRPO, using a capability-adaptive reward that targets the solver’s learning frontier at test time. Xu et al. (2025) survey the path toward Large Reasoning Models, organizing the field into three pillars (automated data construction, learning-to-reason via RL, and test-time scaling) and identifying environment scaling as a key open problem. Song et al. (2024) examine self-improvement capabilities of LLMs and find that naive self-training saturates quickly, motivating the need for adaptive curricula. Embodied Co-Design ( Wang et al., 2025b ) provides a taxonomy of co-design approaches where agent morphology and controller evolve jointly, drawing parallels to SPADE ’s co-evolution of environment and agent. Agent Learning via Early Experience ( Zhang et al., 2025c ) introduces a reward-free training paradigm in which agents propose alternative actions at expert-visited states and learn from the resulting future states (implicit world modeling and self-reflection), bridging imitation learning and full RL across eight agentic environments.

These works independently demonstrate that more environments yield better generalization and that curriculum design matters at least as much as algorithm choice. Several incorporate adaptive mechanisms: RLVE adjusts per-environment difficulty levels, SCALER tracks accuracy for difficulty control, and Self-Evolving Curriculum learns a sampling policy over problem categories. SPADE combines gradient-trained environment design with the code-as-environment representation, producing an adaptive curriculum of executable MDPs that co-evolves with the Reasoning Agent .

### H.5 Agentic Memory Design and Self-Improving Code Systems

MemRL ( Zhang et al., 2026d ) introduces self-evolving agents that learn via runtime reinforcement learning on episodic memory, storing and retrieving past interaction experiences to improve future decision-making without additional gradient updates. ALMA ( Xiong et al., 2026 ) meta-learns agentic memory designs themselves: a foundation model searches the space of Python memory-architecture programs (an open-ended scaffold over update/retrieve operations), discovering memory designs that improve continual learning at test time. HyperAgents ( Zhang et al., 2026a ) extends self-referential code evolution by fusing the task-solver and the meta-improver into a single editable program, so the self-modification mechanism is itself modifiable; tasks are externally fixed and the foundation model is frozen. These directions are complementary to SPADE : they address how agents use accumulated experience or rewrite their own scaffolding at the meta-level, while SPADE addresses how to generate the training environments that produce that experience in the first place via RL. HyperAgents explicitly leaves co-evolving the task distribution as future work, which SPADE addresses directly. The approaches are composable: SPADE ’s adaptive environment generation could populate the experience streams that ALMA-style memory systems and MemRL-style runtime RL operate over.

## Appendix I Extended Quantitative Analysis [back to contents]

Throughout, environment text is embedded with SBERT ( all-MiniLM-L6-v2 ) ( Reimers and Gurevych, 2019 ) , and every embedding-based result is replicated under a second, purely lexical embedding (TF-IDF with LSA-128), following the multi-embedding robustness protocol of Abdulhai et al. (2026) ; conclusions are identical under both. Step-level training dynamics use the matched 30B-A3B runs (full SPADE is the resume-stitched 0–399 step run; ablations end earlier), with curves EMA-smoothed over real logged values, expanding on Section 6.2 .

### I.1 Games

The games-setting analyses below expand the environment-quality and diversity signals summarized in the main text.

#### I.1.1 Environment Quality

We track five quality signals; four are tracked over training (Table 7 ) and executability is measured once over the raw generations. (i) Learnability (ground truth): the fraction of environments in the learnable band ( Reasoning Agent win rate in [ 0.2 , 0.8 ] [0.2,0.8] ) rises from 0.16 0.16 to 0.31 0.31 , and Reasoning Agent win-rate rises 0.30 → 0.62 0.30\to 0.62 : the Environment Designer keeps targeting tasks at the frontier of the improving agent (Figure 8 ). (ii) Well-posedness: an LLM rubric over all environments scores 97 97 to 98 % 98\,\% well-posed, flat over training. (iii) Verifiability: 90 90 to 93 % 93\,\% of environments have an objectively checkable terminal answer, flat to slightly rising. (iv) Executability: re-executing raw generated code in a sandbox (parse, instantiate, reset() ), 84.9 % 84.9\,\% runs as emitted and 90.3 % 90.3\,\% after stripping a stray Markdown fence; the dominant residual failure is a systematic f-string brace-escaping bug in \boxed{} action templates ( 7.4 % 7.4\,\% ), which the training pipeline’s sanitizer repairs before execution ( 100 % 100\,\% post-filter validity). (v) Richness: environments hold steady at ∼ 320 {\sim}320 lines of code, ∼ 13 {\sim}13 hidden state variables, and 8 8 to 10 10 interaction turns per episode; the Environment Designer does not shortcut to trivial programs to inflate its reward. Reward granularity also rises, from 3.7 3.7 to 5.8 5.8 distinct levels per environment ( 2.2 → 4.0 2.2\to 4.0 strictly partial; Figure 17 ).

Figure 18 gives the per-skill decomposition of the Reasoning Agent ’s gains behind Table 7 .

#### I.1.2 Environment Diversity

##### Metric and calibration.

Within each training step’s batch we report the Vendi Score ( Friedman and Dieng, 2023 ) , the effective number of distinct items in a sample, VS ( K ) = exp ( − ∑ i λ i log λ i ) , \mathrm{VS}(K)\;=\;\exp\Big(-\textstyle\sum_{i}\lambda_{i}\log\lambda_{i}\Big), (7) where λ i \lambda_{i} are the eigenvalues of the normalized cosine-similarity matrix K / n K/n over SBERT embeddings. The score is calibrated: batches of 24 identical environments score 1.0 1.0 , single-domain batches score 14.8 14.8 to 16.5 16.5 , and mixed batches drawn across the whole run score 21.3 21.3 (the practical ceiling for n = 24 n{=}24 ).

##### Diversity is maintained at the ceiling.

Per-step Vendi is flat for the whole run, 20.8 20.8 (steps 0 to 40) versus 21.0 21.0 (steps 340 to 396), directly at the mixed-population ceiling; mean pairwise cosine distance is likewise flat ( 0.94 0.94 ). Novelty stays saturated (97 of 100 logged steps consist entirely of never-seen initial states), and all 13 domains of an LLM-labeled taxonomy are present from step 0 with 8.4 8.4 per batch of 24 on average (Mathematics 30 %, Physics 20 %, Medicine 11 %, Chemistry 10 %, CS 7 %, Engineering 6 %, other 16 %). The distribution is also stationary: after removing seed-document reuse, a linear probe cannot separate early-half from late-half environments (5-fold AUC 0.551 ± 0.024 0.551\pm 0.024 ).

##### Corpus grounding drives diversity.

The ablations quantify the matched-step generation contrast of Appendix J (Table 8 , Figure 19 ). Diversity remains at the mixed-population reference level when memory alone is removed and when Environment Designer training and memory are jointly removed, as long as the corpus is retained ( 0.70 0.70 for the joint control); without the corpus, it collapses to 0.04 0.04 . These configuration-level contrasts associate corpus grounding with preserved diversity, but do not isolate the independent effect of Environment Designer training from memory. The windowed dynamics (Figure 19 ) sharpen this further: the no-corpus run starts near-collapsed (Vendi ∼ 1.6 {\sim}1.6 ), RL exploration briefly lifts it to a peak of ∼ 5.2 {\sim}5.2 around step 100, and continued optimization then re-collapses it to ∼ 2 {\sim}2 . That run’s best evaluation checkpoint (step 111, Table 6 ) coincides with its diversity peak; once the environment stream re-collapses, downstream evaluation stops improving. The corpus-grounded runs hold the ceiling for their full run lengths under the same optimization pressure (full SPADE for all 400 steps).

##### Scope and limitations.

Per-environment scalar rewards are not retained in the public run log, so learnability is measured at the step level (win rate, learnable-band fraction) rather than per environment; the LLM rubric measures absolute difficulty and coherence rather than fit to the current agent; and executability is measured on raw generations, upstream of the pipeline’s sanitizer. Diversity numbers use batch size 24 with larger boot-step batches subsampled for comparability.

## Appendix J Extended Qualitative Analysis [back to contents]

We analyze all 3,310 environments generated by the canonical SPADE -30B run at the level of their content: the seed document each was generated from, the generated program, and the opening observation. Every generated environment is a distinct program (3,310 of 3,310 unique program hashes; 2,388 distinct initial states; 1,513 distinct seed documents), so all analyses operate on content, never on surface identifiers such as class names (585 distinct; 58 % keep the scaffold default despite the prompt’s naming instruction). This appendix presents the qualitative evidence; the matching proxy metrics and training dynamics appear in Appendix I .

### J.1 Games

For the games setting we give additional privileged-hint examples and trace how a single environment evolves from early to late training.

#### J.1.1 Additional Privileged-Hint Examples

Figure 20 expands the main-text selection to four positive-regret task–hint pairs from the same canonical 30B games run, spanning the regret range from large frontier gaps to a small mastery-regime gap. Each pair is drawn from one logged game record: the task description is a concise summary of its reset observation, while the hint is a verbatim excerpt of the substantive guidance appended to the with-hint arm.

#### J.1.2 Environment Evolution over Training

The cards below show one early and one late environment in the exact format produced by the Environment Designer (cf. the minimal example in Appendix J.3.1 ): a seed document grounds the task; the generated program implements a Gym-style interface with hidden state and a verifiable terminal answer; the opening observation states the goal and action space. The corpus’s DCLM slice is filtered web text and includes off-topic documents; the early card’s personal-finance seed is one such document. The visible shift over training is toward structured, instrumented “laboratory” tasks, while program size, functional hidden state, and verifiability hold steady (about half the early card’s raw state variables are write-only narrative fields): the added difficulty comes from state-gated interaction and finer reward grading, not from longer programs.

The complete source of both environments (369 and 376 lines as generated) is reproduced verbatim in Appendix J.3.2 .

#### J.1.3 Matched-Step Generation Contrast

The clearest qualitative view of diversity is a matched-step contrast against the no-corpus ablation. At training steps 290 to 312, SPADE generates environments spanning probability theory, quantum gate tomography, volcanology, hematology, radar signal processing, and hypoelliptic operators, while the no-corpus run generates the same rotating-maze navigation task 41 times in a row, varying only the grid layout. Grounding each generation in a sampled corpus document supplies the stream of new task material.

### J.2 Tool Use

The tool-use Environment Designer emits environments in a different register from the games setting: each is a simulated API domain (banking, retail orders, support tickets, telecom accounts, smart-home control) in which a user issues one atomic instruction at a time, and the environment advances only when a programmatic criterion over the hidden state confirms the current instruction is complete. The cards below reproduce one early and one late environment exactly as generated: a code-corpus snippet seeds the generation, the Environment Designer builds an unrelated everyday domain on top of it, and each user instruction is paired with a checkable criterion over the backend state (in the early card, coupling the tool call’s provenance with its state effect). Criteria check the salient state effect; qualifiers in the instruction text, such as which account pays an invoice, are not always bound, an artifact the validation checks do not catch.

Across the full 30B run the structural profile of generated environments is stationary, mirroring the distributional stationarity of the games setting (Appendix I.1.2 ): mean program length moves from 247 247 to 226 226 lines between the first and last training band, tools per environment from 7.6 7.6 to 5.9 5.9 , while instructions per environment ( 4.7 4.7 ) and the logical complexity of the per-step criteria ( 1.9 1.9 to 2.0 2.0 conditions per criterion) stay flat, and roughly one environment in five ships a guarded failure path (locked cards, unavailable agents, denied requests) that the Reasoning Agent must detect and recover from. What changes over training is not the scaffold but the instantiations rotated through it: the Environment Designer holds a stable inventory of everyday API domains while regenerating fresh states, identifiers, and instruction sequences each round, exactly the regime the corpus-grounding and memory components are designed to sustain.

### J.3 Generated Environment Gallery

This gallery collects representative environments in the exact format the Environment Designer emits, starting from a minimal multi-turn example.

#### J.3.1 A Minimal Generated Environment

Listing 21 (reproduced from Listing 3 ) shows a minimal multi-turn environment in the format produced by SPADE ’s Environment Designer : a single Python class exposing the Gym-style reset() / step() interface described in Section 3.1 , with internal state, per-step feedback, and a verifiable terminal reward. This one worked example stands in for the gallery: the same interface and training pipeline also carry single-turn answer-grading tasks and multi-turn tool-use interactions.

#### J.3.2 Full Source of Two Exemplar Generated Environments

The two environments carded in Appendix J.1.2 are reproduced here in full, exactly as emitted by the Environment Designer (lightly transliterated to ASCII: typographic quotes, dashes, arrows, and sub-/superscripts). Each is a complete, self-contained program: hidden state initialized in reset() , a multi-turn step() loop with intermediate feedback, and a verifiable terminal reward. Episode return is the final-step reward, clipped to [ − 1 , 1 ] [-1,1] and 0 0 if the episode never terminates; the intermediate per-step rewards visible below are progress feedback, not summed.

##### Training step 0: CarOwnershipDisputeEnv (370 lines).

⬇

##### Training step 384: ThermodynamicCycleManipulationLabEnv (376 lines).

⬇

#### J.3.3 Full Source of a Generated Tool-Use Environment

The late tool-use exemplar of the cards above in full: CustomerSupportTicketWorkflowEnv , generated at training step 392 of the 30B tool-use run. The environment subclasses the training harness’s tool-use base class, which dispatches OpenAI-format tool calls to the tool_* methods, replays each instruction’s criterion after every call, and terminates when the final answer is submitted after all criteria pass.

##### Training step 392: CustomerSupportTicketWorkflowEnv (200 lines).

⬇

## Instructions for reporting errors

We are continuing to improve HTML versions of papers, and your feedback helps enhance accessibility and mobile support. To report errors in the HTML that will help us improve conversion and rendering, choose any of the methods listed below:

Click the "Report Issue" ( ) button, located in the page header.

Tip: You can select the relevant text first, to include it in your report.

Our team has already identified the following issues . We appreciate your time reviewing and reporting rendering errors we may not have found yet. Your efforts will help us improve the HTML versions for all readers, because disability should not be a barrier to accessing research. Thank you for your continued support in championing open access for all.

Have a free development cycle? Help support accessibility at arXiv! Our collaborators at LaTeXML maintain a list of packages that need conversion , and welcome developer contributions .
