HyperAIHyperAI

Command Palette

Search for a command to run...

SPADE ♠ : auto-jeu dans des environnements exécutables synthétiques adaptatifs

Résumé

L’auto-amélioration continue exige un réservoir sans cesse croissant d’objectifs autogénérés, diversifiés et adaptatifs. Pour les agents langagiers, les réservoirs d’environnements d’entraînement existants (curés manuellement, synthétisés statiquement ou dotés de vérificateurs figés) maintiennent la distribution des objectifs fixe à mesure que l’apprenant progresse. Nous présentons SPADE (Self-Play in Adaptive Synthetic Executable Environments), un cadre d’apprentissage par renforcement en auto-jeu dans lequel un unique grand modèle de langage joue deux rôles : un concepteur d’environnements qui écrit des environnements d’entraînement complets et à long horizon sous forme de code exécutable doté d’une interface reset()/step() de type OpenAI Gym, et un agent de raisonnement qui apprend à agir dans ces environnements. Chaque environnement est un environnement multi-tours avec état (transitions d’état, fonctions de récompense et code de vérification), de sorte qu’une même interface couvre à la fois les problèmes de raisonnement et l’utilisation d’outils agentiques en plusieurs étapes. Le regret de l’agent de raisonnement est estimé par l’écart entre sa récompense avec et sans indices privilégiés ; en optimisant ce signal de regret, le concepteur d’environnements apprend à cibler des environnements situés à la limite des capacités de l’agent tout en les maintenant réalisables. Par une expérimentation approfondie, nous identifions plusieurs composants essentiels au succès : l’ancrage du concepteur d’environnements sur des documents échantillonnés à partir d’un vaste corpus de préentraînement, et la mise à sa disposition d’une mémoire accumulée des environnements. En passant à l’échelle de modèles de 30 milliards de paramètres, SPADE améliore la meilleure référence à environnement fixe de +5,3 en moyenne sur huit jeux de référence tenus à part en mathématiques, sciences, code et raisonnement, et relève le cadre d’utilisation d’outils de +5,7 sur BFCL v4 multi-tours et de +13,9 sur ACEBench-Agent ; dans le cadre des jeux, l’écart par rapport à la meilleure référence croît avec l’échelle du modèle. En faisant de la conception d’environnements elle-même une composante apprenable, SPADE constitue un pas concret vers l’auto-amélioration ouverte.

One-sentence Summary

Researchers from University of Washington, Stanford University, and other institutions propose SPADE, a self-play RL framework in which a single LLM plays an Environment Designer that writes executable Gym-style reset()/step() environments and a Reasoning Agent that learns to act in them, using hinted/unhinted reward regret to target feasible edge-of-capability tasks; SPADE improves fixed baselines by +5.3+5.3+5.3 across eight benchmarks, +5.7+5.7+5.7 on BFCL v4, and +13.9+13.9+13.9 on ACEBench-Agent.

Key Contributions

  • The paper introduces SPADE, a self-play RL framework in which one LLM acts as an Environment Designer that writes executable Gym-style reset/step environments and a Reasoning Agent learns to act in them, unifying reasoning and multi-step tool use through a single stateful interface.
  • A hint-based regret reward trains the Environment Designer to target environments at the Reasoning Agent's learning frontier by using the reward gap between acting with and without privileged hints, keeping environments feasible but challenging and grounded in minimax regret theory.
  • Grounding environment design in a pretraining corpus and accumulated environment memory is critical; at 30B parameters on Qwen3 models, SPADE outperforms the strongest fixed-environment baseline by +5.3 on average across eight held-out math, science, code, and reasoning benchmarks, and lifts tool use by +5.7 on BFCL v4 multi-turn and +13.9 on ACEBench-Agent.

Introduction

Agentic language models increasingly improve through interaction with environments that provide verifiable rewards, making the supply of adaptive training environments a central bottleneck. Prior work is limited by fixed environment pools, slow human curation, frozen synthetic generators, or self-play that produces sparse-reward tasks rather than full multi-turn environments. The authors introduce SPADE, a framework where one LLM plays two roles: an Environment Designer that generates complete Gym-style Markov decision processes as executable Python code, and a Reasoning Agent that learns from them. The Environment Designer is itself trained with reinforcement learning using a hint-based regret signal that targets solvable environments near the Reasoning Agent’s current capability frontier. This creates co-evolution between environment generation and agent capability, unifying single-turn and multi-turn tasks while keeping the training curriculum adaptive as the agent improves.

Dataset

The authors use synthetic tool-use environments as the data in this domain. Key details:

  • Source: environments are generated by an Environment Designer grounded in a 15k-document code corpus. No benchmark tasks or data are shown to the Environment Designer.
  • Composition: each generated environment includes simulated tools in OpenAI function-calling format, a backend state, and three to five natural-language user instructions that arrive one at a time. Each instruction has a check on the resulting state.
  • Scale: generation uses k=8 because tool environments are more expensive to generate.
  • Processing/validation: validation adds two checks beyond the game checks: 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.
  • Usage: the Reasoning Agent solves each 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, so the agent must still find exact arguments through tool calls.
  • Evaluation: the authors evaluate with BFCL v4 multi-turn, τ²-bench, and ACEBench-Agent, specifically the Agen category of ACEBench-en, with results reported per domain.

Method

SPADE is an end-to-end self-play framework where a single LLM, π\piπ, alternates between generating executable training environments and learning to solve them. As shown in the framework diagram, the system comprises two main roles: the Environment Designer (ED) and the Reasoning Agent (RA). The ED conditions on an environment memory MMM and a pretraining corpus CCC to emit an executable environment eee and a privileged hint hhh. The RA then plays the environment eee with and without hhh. The return gap between these two rollouts constitutes the ED's hint-based regret reward rD(e)r_D(e)rD(e), while task correctness serves as the RA's reward. Both rewards update the shared policy π\piπ via Group Relative Policy Optimization (GRPO).

The authors formulate adaptive environment self-play as a game where a single model πθ\pi_\thetaπθ acts in two roles via role-specific system prompts. In the Environment Designer role (πD\pi_DπD), the model produces an executable environment eEe \in \mathcal{E}eE as a Python program implementing a Gym-style reset/step API. The transition function T(ss,a)T(s'|s,a)T(ss,a) and reward function R(s,a)R(s,a)R(s,a) are encoded in the step implementation. The ED also emits a privileged hint hhh, which is task-relevant information such as a partial solution sketch or a key structural observation that makes the environment easier to solve. In the Reasoning Agent role (πA\pi_AπA), the model interacts with eee via sequential actions. This code-as-environment representation unifies single-turn and multi-turn agentic settings under a single interface. Since both roles share parameters θ\thetaθ, updates for either role affect the same policy.

The Environment Designer's reward for producing environment eee is defined by the hint-based regret:

rD(e)=rˉA(eh)rˉA(e)r_D(e) = \bar{r}_A(e|h) - \bar{r}_A(e)rD(e)=rˉA(eh)rˉA(e)

where rˉA(eh)\bar{r}_A(e|h)rˉA(eh) is the RA's average return over GGG fresh rollouts sampled with the privileged hint hhh in context, and rˉA(e)\bar{r}_A(e)rˉA(e) is the average over GGG rollouts without it. High regret indicates an environment at the learning frontier (solvable with hints but not without), while low regret indicates either mastery or an intractable environment. This implements a minimax regret objective without a separate antagonist. The paired trajectories expose the behavioral source of the return gap, as the hint narrows the agent's search space or provides key structural observations directly.

To prevent the generator from mode-collapsing, the authors treat an external corpus as a mechanism to lengthen the invisible leash of novelty. Every round, the ED conditions on freshly sampled human corpus, which seeds an executable MDP. This corpus grounding sustains environment diversity, as demonstrated by the t-SNE visualization and Vendi scores, which show a significant drop in diversity when corpus grounding is removed. Additionally, a cross-episode memory buffer of previously generated environments, annotated with regret scores and skill tags, prevents the ED from re-posing mastered tasks. This memory ensures each round starts from what the RA currently finds hard, holding generated difficulty at the RA's frontier as that frontier moves.

The policy πθ\pi_\thetaπθ is trained via reinforcement learning with verifiable rewards (RLVR) using Group Relative Policy Optimization (GRPO). For each input prompt xxx, GRPO samples a group of GGG responses {y1,,yG}πθ(x)\{y_1, \dots, y_G\} \sim \pi_\theta(\cdot|x){y1,,yG}πθ(x) and computes group-normalized advantages:

A^i=rimean({rj}j=1G)std({rj}j=1G)\hat{A}^i = \frac{r^i - \mathrm{mean}(\{r^j\}_{j=1}^G)}{\mathrm{std}(\{r^j\}_{j=1}^G)}A^i=std({rj}j=1G)rimean({rj}j=1G)

The policy is updated via clipped policy gradient with KL regularization:

L(θ)=1Gi=1Gmin(πθ(yix)πold(yix)A^i,clip(πθ(yix)πold(yix),1εlow,1+εhigh)A^i)+βKLKL[πθπref]\mathcal{L}(\theta) = -\frac{1}{G} \sum_{i=1}^G \min \left( \frac{\pi_\theta(y_i|x)}{\pi_{\mathrm{old}}(y_i|x)} \hat{A}^i, \operatorname{clip} \left( \frac{\pi_\theta(y_i|x)}{\pi_{\mathrm{old}}(y_i|x)}, 1-\varepsilon_{\mathrm{low}}, 1+\varepsilon_{\mathrm{high}} \right) \hat{A}^i \right) + \beta_{\mathrm{KL}} \cdot \mathrm{KL}[\pi_\theta \| \pi_{\mathrm{ref}}]L(θ)=G1i=1Gmin(πold(yix)πθ(yix)A^i,clip(πold(yix)πθ(yix),1εlow,1+εhigh)A^i)+βKLKL[πθπref]

To stabilize joint two-role training, advantages are normalized independently for each role. The ED update is delayed by kkk rollouts to allow the difficulty anchor to score each environment's RA win rate over the full training window. The deployed ED reward blends floored regret with a flat-top difficulty anchor. Under this training recipe, the average gain over each backbone's base grows with model size, while fixed-environment GRPO stays near baseline, demonstrating the effectiveness of the adaptive curriculum in keeping the training signal challenging.

Experiment

SPADE is evaluated on game and tool-use environment design across three Qwen3 backbones, compared against fixed-environment and frozen-designer baselines. The game experiments show that adaptively generated environments improve held-out procedural reasoning, science, and code, while the tool-use experiments show gains on multi-step agentic benchmarks. Qualitative and ablation results indicate that corpus grounding sustains diversity, co-adaptation between the Environment Designer and Reasoning Agent is necessary for improvement, and hint-based regret rewards outperform an EMA-based alternative. Scaling analyses further show that benefits grow with model size and curriculum diversity.

Training a reasoning agent on diverse synthetic game environments improves held-out reasoning and code benchmarks at every backbone scale. The adaptive environment designer outperforms fixed-environment baselines, with gains over the base model growing as model size increases and procedural reasoning improving across all cognitive-skill categories while competition math is preserved. Curriculum diversity contributes substantially, since a reduced two-skill curriculum captures only part of the gains. SPADE improves average held-out performance at every backbone scale, and the gain over the base model grows from smaller models to the largest tested backbone. Fixed-environment baselines show much smaller average gains, and static environments provide a fixed signal that larger models fit quickly without continued benefit. Procedural reasoning improves across every cognitive-skill category, while competition math performance is preserved. The full six-skill curriculum produces stronger procedural, science, and code gains than a two-skill curriculum, indicating gains scale with curriculum diversity. At the largest tested backbone, SPADE reaches a suite average of 58.3, outperforming the strongest fixed-environment baseline by 5.3 points.

Synthetic tool-use environments generated by SPADE match dedicated data-synthesis systems and perform best on benchmarks requiring stateful, multi-step interaction. Gains are largest on ACEBench-Agent and BFCL v4 multi-turn, where task structure closely mirrors the generated environments, and SPADE at 30B-A3B surpasses reference synthetic-environment agents on both. The pattern indicates that structural training signal transfers where domain-specific data collection alone does not reach. SPADE at 30B-A3B leads the compared dedicated data-synthesis systems on BFCL v4 multi-turn and ACEBench-Agent. Tool-use gains track task structure, with the largest improvement on ACEBench-Agent, followed by BFCL v4 multi-turn and then τ2-bench. The generated environments improve every evaluated backbone, with the strongest relative gains on stateful, multi-call agentic tasks.

In the games setting, the full adaptive environment designer configuration achieves the highest suite-average performance among all variants tested. Removing corpus grounding or environment memory, or freezing the designer, lowers the best-checkpoint score, and even a frozen frontier-model designer does not close the gap. The comparisons show that adaptive training of the environment designer is central to the observed gains. The full adaptive configuration outperforms every partial and frozen-designer control on the unweighted suite average. Ablations that remove corpus grounding or environment memory, or that freeze the Environment Designer, all reduce best-checkpoint performance.

The experiments evaluate training reasoning agents in diverse synthetic game environments generated by an adaptive environment designer, comparing against fixed-environment and dedicated data-synthesis baselines. The adaptive approach improves held-out reasoning and code benchmarks at every backbone scale, with gains growing as model size increases and with greater curriculum diversity, while tool-use performance improves most on stateful, multi-step tasks. Ablations show that adaptive training of the environment designer is central, since removing corpus grounding, environment memory, or freezing the designer reduces best-checkpoint performance.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp