K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

METAL MEDIA

SPADE: Self-Play in Adaptive Synthetic Executable Environments

arXiv:2608.191972026-08-18

让AI自己出题、自己练习,不断给自己升级训练关卡

SPADE让同一个语言模型同时扮演两个角色:一个是编写可执行游戏环境代码的环境设计师,另一个是在这些环境中学习的推理智能体。因为两个角色共享同一套参数,它们能相互促进、共同进化,设计师会不断把难度调到智能体刚好能学会的边界。在30B规模模型上,SPADE比最强的固定环境基线平均高出5.3分,且模型越大优势越明显。

METAL MEDIA 解读图

让AI自己出题、自己练习,不断给自己升级训练关卡

  1. 01以往的训练方式依赖人工整理或固定的自动生成题库,模型一旦学完这些题目就没有新内容可练了
  2. 02SPADE中同一个模型既充当环境设计师,用Python代码写出包含状态、奖励、验证逻辑的完整游戏环境,也充当推理智能体,在这些环境里进行学习
  3. 03设计师的奖励来自智能体在有提示和无提示两种情况下表现的差距(称为基于提示的后悔值),这促使它生成难度恰好合适、既可解又有挑战性的任务
  4. 04设计师会参考从预训练语料库中抽取的文档,并保留过去生成环境的记忆,从而保持生成任务的多样性,避免内容重复塌缩
  5. 05在30B模型上,SPADE在数学、科学、代码、推理等八项基准上平均提升5.3分,在工具使用基准上最高提升13.9分,且提升幅度随模型规模增大而增大(4B为5.2,30B为8.1)
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 以往的训练方式依赖人工整理或固定的自动生成题库,模型一旦学完这些题目就没有新内容可练了
  2. SPADE中同一个模型既充当环境设计师,用Python代码写出包含状态、奖励、验证逻辑的完整游戏环境,也充当推理智能体,在这些环境里进行学习
  3. 设计师的奖励来自智能体在有提示和无提示两种情况下表现的差距(称为基于提示的后悔值),这促使它生成难度恰好合适、既可解又有挑战性的任务
  4. 设计师会参考从预训练语料库中抽取的文档,并保留过去生成环境的记忆,从而保持生成任务的多样性,避免内容重复塌缩
  5. 在30B模型上,SPADE在数学、科学、代码、推理等八项基准上平均提升5.3分,在工具使用基准上最高提升13.9分,且提升幅度随模型规模增大而增大(4B为5.2,30B为8.1)
Table 1: Training the Reasoning Agent on diverse synthetic games improves held-out reasoning and code benchmarks at every backbone scale. The eight held-out benchmarks probe four capability families: competition math (AIME 2025/2026, Avg@32), science reasoning (GPQA-Diamond, accuracy), code generation (LiveCodeBench-v6, Pass@1), and procedural reasoning across four cognitive skills (Reasoning-Gym, win rate at hard). Both fixed-environment baselines are retrained per backbone from the same base model for 400 training iterations; Fixed-env RLVE follows the official RLVE sampling and curriculum settings. Avg is the unweighted mean over the eight benchmarks; green subscripts denote absolute pp gain over the same-model base. Best per column within each backbone block in bold, second best underlined.
ModelAIME’25AIME’26GPQA-DLCB-v6Reasoning-Gym (Stojanovski et al. 2026)Δ vs Base
(MAA)(MAA)(Rein et al. 2023)(Jain et al. 2024)RG-MathRG-Algo.RG-Cog.RG-LogicAvg
Qwen3 backbones: fixed-environment baselines and SPADE (game environment design)
Qwen3-4B-Instruct-250747.458.355.935.131.611.816.454.738.9
Fixed-env GRPO47.158.656.235.434.013.518.156.339.9+1.0
Fixed-env RLVE49.662.157.335.938.616.321.059.142.5+3.6
+ SPADE (Games)48.9+1.560.2+1.958.1+2.237.2+2.144.6+13.019.8+8.023.1+6.760.8+6.144.1+5.2
Qwen3-8B67.171.259.446.347.219.624.863.149.8
Fixed-env GRPO67.471.059.946.849.821.926.564.651.0+1.2
Fixed-env RLVE69.675.061.647.452.725.031.067.953.8+3.9
+ SPADE (Games)68.8+1.773.1+1.962.9+3.549.4+3.157.3+10.129.2+9.633.8+9.069.7+6.655.5+5.7
Qwen3-30B-A3B-Instruct-250761.573.570.443.245.018.023.067.050.2
Fixed-env GRPO61.273.870.943.748.120.324.668.451.4+1.2
Fixed-env RLVE56.969.869.842.555.824.730.973.753.0+2.8
+ SPADE (Games)62.8+1.374.4+0.975.8+5.447.3+4.163.3+18.332.1+14.137.7+14.772.8+5.858.3+8.1
Table 2: Synthetic tool-use environments match dedicated data-synthesis systems and surpass them where multi-step interaction matters most. Per-domain results on BFCL v4 multi-turn (Patil et al. 2025), τ2-bench (Barres et al. 2025), and ACEBench-Agent (Chen et al. 2025a). Reference rows are transcribed from the cited papers. For our rows, Avg is the unweighted mean of the shown subcolumns and the final Avg averages the three benchmarks, computed before rounding. For reference rows, Avg is likewise the unweighted mean of the shown subcolumns, or the cited paper’s own aggregate where the subcolumns are not reported; Agent-World and AWM print τ2 aggregates of 61.8/65.4 and (task-weighted) 33.5/39.0, and we print the means of the shown domains for cross-row consistency. The final Avg is omitted because each reference system skips at least one benchmark. ‘–’ = not reported by the cited paper. SPADE rows in bold.
BFCL v4 (multi-turn)τ2-benchACEBench-Agent
ModelBaseMiss FuncMiss ParamLong CtxAvgRetailAirlineTelecomAvgMulti StepMulti TurnAvgAvgΔ
Synthetic-environment agents (per-split numbers as reported by the cited papers)
AgentScaler-30B-A3B (Fang et al. 2025a)70.260.055.361.860.0
Agent-World-8B (Dong et al. 2026)44.572.840.050.954.6
Agent-World-14B (Dong et al. 2026)53.974.552.056.160.9
AWM-8B (Wang et al. 2026b)45.041.238.523.534.4
AWM-14B (Wang et al. 2026b)51.963.631.517.837.6
EnvScaler-4B (Song et al. 2026)51.034.028.039.038.080.061.170.6
EnvScaler-8B (Song et al. 2026)55.536.035.041.041.985.060.072.5
Ours: SPADE post-training on Qwen3 backbones (tool-use environment design)
Qwen3-4B-Instruct-250734.016.012.525.522.043.032.018.031.055.041.748.433.8
+ SPADE ♠ (Tool Use)46.026.522.034.732.3+10.347.235.621.534.8+3.865.049.557.3+8.941.4+7.7
Qwen3-8B52.030.024.035.635.434.026.518.026.263.356.760.040.5
+ SPADE ♠ (Tool Use)58.036.030.043.241.8+6.437.829.521.229.5+3.373.065.069.0+9.046.8+6.2
Qwen3-30B-A3B-Instruct-250766.044.038.048.049.062.050.035.049.070.054.062.053.3
+ SPADE ♠ (Tool Use)72.050.044.052.954.7+5.765.553.538.852.6+3.682.069.875.9+13.961.1+7.7
Table 3: The full adaptive configuration outperforms every partial and frozen-designer control. Games setting, Qwen3-30B-A3B-Instruct-2507. Best checkpoint per variant on suite average; Avg is the unweighted mean over the same eight benchmarks as Table 1; full trajectories in Figure 11. Best in bold, second best underlined.
ComponentsBenchmarks
SettingED designED trainedCorpus groundingEnv. memoryAIME’25AIME’26GPQA-DLCB-v6RG-MathRG-Algo.RG-Cog.RG-LogicAvg
Qwen3-30B-A3B-Instruct-250761.573.570.443.245.018.023.067.050.2
SPADE ♠Self62.874.475.847.363.332.137.772.858.3
w/o memorySelf59.375.072.345.749.122.930.770.953.2
w/o corpus groundingSelf61.174.171.846.351.622.332.468.753.5
w/o ED training and memorySelf59.473.565.839.122.510.07.646.040.5
Fixed Environment Designer (GPT-5.5)GPT-5.559.972.874.242.651.224.330.768.053.0
Table 4: Symbols used throughout the paper.
SymbolDescription
MDP and environment
𝒮State space
𝒜Action space
T⁡(s′∣s,a)Transition function
R⁡(s,a)Reward function
ρ0Initial state distribution
s,s′,aState, next state, action
Space of valid (executable Python) environments
e∈ℰA single environment instance
ebThe b-th environment in a generation batch
Policy and roles
πθShared LLM policy with parameters θ
πDPolicy in Environment Designer role, πθ(⋅∣role=D)
πAPolicy in Reasoning Agent role, πθ(⋅∣role=A)
role=DSystem-prompt switch selecting Environment Designer role
role=ASystem-prompt switch selecting Reasoning Agent role
Hints and rewards
hPrivileged hint (strategy / partial solution / key observation)
hbHint for the b-th environment
y,yiReasoning Agent response (rollout)
yi′Reasoning Agent rollout sampled with the privileged hint in context
rA​(y∣e)Per-rollout correctness reward (without hint)
rA​(y∣e,h)Per-rollout correctness reward conditioned on hint
r¯A​(e)Average Reasoning Agent return on e without hints
r¯A​(e∣h)Average Reasoning Agent return on e with hint h
rD​(e)Environment Designer reward: hint-based regret r¯A​(e∣h)−r¯A​(e)
GRPO and training
xPrompt / input sequence (generic GRPO notation)
ℒ⁡(θ)GRPO clipped-surrogate training objective
πold,πrefBehavior policy (importance ratio) and KL reference policy
Table 5: Training hyperparameters. Shared across the three games-setting SPADE backbone runs; per-model exceptions appear in parentheses.
HyperparameterValue
ModelsQwen3-4B-Instruct-2507, Qwen3-8B, Qwen3-30B-A3B-Instruct-2507
Learning rate1×10−6 (constant)
OptimizerAdam, β=(0.9,0.98), weight decay 0.1
KL penalty βKL0 (0.005 for 8B)
Clipping εlow/εhigh0.20/0.28
Truncated importance samplingyes
Reward normalizationoutcome-only, per-game z-score
Rollout batch24
Global batch192 (dynamic)
Group size G16
Total rollouts400
Environments per rollout24 (8×3 active skills of 6, round-robin)
Regeneration interval k4 rollouts
Environment Designer temperature0.6
Environment Designer max tokens16,384 (20,000 for 8B)
Reasoning Agent temperature0.6
Reasoning Agent max tokens8,192
Max turns per episode25
Max context length32,768 (49,152 later in the 4B run)
Environment Designer reward blendplateau 0.6, band [0.4,0.6] ([0.2,0.4] later for 4B)
+ floored regret 0.4
Regret scale (normalizer)0.15
Plateau ramp width0.25
Delayed Environment Designer update4 rollouts
Corpus grounding15k docs (10k math, 5k science)
Environment memoryon
Table 6: Full ablation breakdown (games setting, Qwen3-30B-A3B-Instruct-2507). Best checkpoint per variant on the suite average. AIME reports Avg@32; GPQA-D accuracy; LCB-v6 Pass@1; Reasoning-Gym (RG) win rate at hard; GEM the overall win rate across the GEM game suite (Liu et al. 2025c). Best in bold.
SettingCkptAIME’25AIME’26GPQA-DLCB-v6RG-MathRG-Algo.RG-Cog.RG-LogicGEMAvg
Qwen3-30B-A3B-Instruct-250761.573.570.443.245.018.023.067.041.050.2
SPADE ♠30362.874.475.847.363.332.137.772.850.258.3
Environment Designer w/ learning potential62.474.174.246.157.827.933.371.147.455.9
2-skill curriculum39960.671.371.744.753.626.730.570.746.053.7
w/o corpus grounding11161.174.171.846.351.622.332.468.745.153.5
w/o memory11159.375.072.345.749.122.930.770.942.453.2
w/o Environment Designer training and memory27159.473.565.839.122.510.07.646.026.440.5
Fixed Environment Designer (GPT-5.5)17559.972.874.242.651.224.330.768.045.653.0
Table 7: Environment quality over training. Learnability nearly doubles while well-posedness, verifiability, and structural richness hold constant: the quality gains come from sharper difficulty targeting rather than simpler environments. Win-rate rows use the released per-step evaluation logs.
Quality signalEarly (0–40)Mid (150–250)Late (340–396)
Learnable-band fraction (win-rate ∈[0.2,0.8])0.160.160.31
Reasoning Agent win-rate0.300.460.62
Well-posed (LLM rubric)0.980.970.97
Verifiable terminal answer (LLM rubric)0.900.910.93
Interaction depth (turns / episode)8.88.29.8
Program length (lines of code)316333321
Hidden state variables13.013.313.4
Table 8: Corpus ablations collapse environment diversity. Vendi Score per 100 environments (SBERT embeddings; mean over 20 balanced draws) on the verified-matched 30B-A3B runs: identical backbone, skill set, and Environment Designer system prompt, differing in the listed ablations. The identical analysis under TF-IDF/LSA embeddings reproduces the corpus/no-corpus separation (0.53/0.58/0.48/0.05). A fifth run with a static pre-generated environment pool (Reasoning Agent-only training, no live Environment Designer) is excluded as a different generation protocol; its fixed pool measures Vendi/n=0.12.
RunSampleVendi/n ↑Mean pairwise dist. ↑Reading
SPADE (full)3,3100.680.94diverse
w/o memory3,7460.690.94diverse
w/o Environment Designer training, w/o memory4,9290.700.94diverse
w/o corpus8660.040.34collapsed

为什么重要

人工编写或固定的自动生成题库总有用完的一天,而SPADE展示了模型可以随着自身能力提升不断生成难度适配的新任务。这为AI系统在没有持续人工提供数据的情况下实现自我持续进步提供了一个具体的实现路径。

本文术语

  • 自我对弈(Self-Play) · 让同一个模型扮演互动的两个角色,通过相互作用实现自我提升的训练方式
  • GRPO · 一种通过比较一组采样回答的相对优劣来更新策略的强化学习方法
  • 马尔可夫决策过程(MDP) · 用状态、动作、奖励和状态转移来描述序贯决策问题的数学框架
  • 基于提示的后悔值 · 衡量提示对智能体表现帮助程度的指标,用来判断任务难度是否合适
  • Gym风格接口 · 强化学习环境的标准格式,用reset()给出初始状态,用step()执行动作并返回下一状态和奖励

无法转载的图表

  • Figure 2: SPADE generates an adaptive, multi-turn curriculum. Four environments the Environment Designer produces over one 30B-A3B run, from step 0 (early) to step 384 (late); each card shows the agent’s first observation, the generated Python environment, and the designer-written hint. Every environment is a complete MDP with a reset()/step() interface, and the tasks shift toward state-gated, multi-turn interaction as the Reasoning Agent improves. Unlike a fixed human-curated pool or a frozen synthetic generator, this curriculum keeps moving with the learner.
  • Figure 4: The SPADE framework. Top: the Environment Designer conditions on the environment memory M and pretraining corpus C to emit an executable environment e and a privileged hint h. Bottom: the Reasoning Agent plays e with and without h; the return gap is the Environment Designer’s hint-based regret rD​(e) (Eq. 3) and task correctness is the Reasoning Agent reward. Both rewards update the shared policy πθ via GRPO.
  • Figure 5: How a privileged hint changes Reasoning Agent play. Two positive-regret examples from the canonical 30B games run. Left: each environment’s task prompt and privileged hint, quoted verbatim (ellipses mark elided text; the standardized answer-format sentence is omitted from the hint). Right: one logged Reasoning Agent rollout per arm, condensed while preserving action order, feedback, and values; elided turns are marked and named. The two arms are independent plays with independently seeded resets, so board layouts and probe outcomes differ across arms. The dashed box on each environment card reports the two displayed rollout returns and their single-pair gap; the Environment Designer reward in Equation 3 is instead the difference of the arm means over all logged rollouts (0.00→1.00 for the fiber task, 0.30→0.65 for the audio task). An expanded task–hint set appears in Appendix J.1.1.
  • Figure 6: Training on diverse synthetic games improves science reasoning, code generation, and procedural reasoning while competition math is preserved (games setting, Qwen3-30B-A3B-Instruct-2507). Top row: competition math (AIME 2025/2026 Avg@32), science reasoning (GPQA-Diamond accuracy), and code generation (LiveCodeBench-v6 Pass@1). Bottom row: procedural reasoning across four cognitive skills (Reasoning-Gym win rate at hard). Markers denote logged evaluation checkpoints; the dashed line marks the untrained base model.
  • Figure 7: Full SPADE raises the learnable share of its environment budget to roughly a third by the end of training; component ablations decline or collapse. Share of each rollout’s 24 environments that is learnable, defined as Reasoning Agent win rate in [0.2,0.8] and weighted by the number of valid environments generated in each 16-step window. Matched 30B-A3B settings over a common 400-step budget; unfilled rollout capacity contributes zero by construction.
  • Figure 9: Trained Environment Designer environments stop revealing the solution method in the prompt. Physics environments from one 30B-A3B run at steps 20, 192, and 384; the step-20 environment retains the scaffold’s default class name. The formula-reveal rate (percentage on each panel) falls from 25% to 5% over 473 environments. Rightmost (red): over steps 290–312 the no-corpus ablation emits the same RotatingMazeEnv task 41 consecutive times. The complete source of the step-384 environment, together with one further exemplar, appears in Appendix J.3.2.
  • Figure 10: From front-loaded derivation to evidence-first interaction. Reasoning Agent episodes from one 30B-A3B run at steps 0, 200, and 300. At step 0 the agent derives in advance and cannot recover from format errors; by step 200 it tests short hypotheses and revises on evidence; by step 300 it probes first and derives once. Benchmark gains of late checkpoints (Table 1) confirm the model keeps its long-form derivation ability. Transcripts verbatim (math glyphs transliterated to ASCII; environment feedback abridged); token counts use the backbone’s tokenizer.
  • Figure 11: Removing Environment Designer training and memory together drops self-play below base; removing either one alone has an above-base selected checkpoint but peaks early and can fall below base late. One curve per variant of Table 3 (Qwen3-30B-A3B-Instruct-2507, games setting). Top row: AIME 2025/2026 Avg@32, GPQA-Diamond accuracy, and LiveCodeBench-v6 Pass@1; bottom row: the four Reasoning-Gym categories; the dashed line marks the untrained base model.
  • Figure 12: Rewarding the Environment Designer matters more than which reward is used, but regret still leads. Averaged trajectories over GPQA-Diamond, LiveCodeBench-v6, and the four Reasoning-Gym categories (Qwen3-30B-A3B-Instruct-2507, games setting); the dashed line marks the corresponding untrained base. Eight-benchmark checkpoint results are reported in Table 6.
  • Figure 13: SPADE’s average gain over base grows with model size, from +5.2 at 4B to +8.1 at 30B-A3B, while matched-budget Fixed-env GRPO stays near +1.2. Left: average gain over each backbone’s own base across the eight benchmarks of Table 1 (large markers), the eight per-benchmark gains beside each mean, Fixed-env GRPO in gray. Right: Environment Designer hint-based regret over training (dark: EMA-smoothed; light: per-step). Only the 30B-A3B estimate stays positive; at 4B and 8B it dips below zero for long stretches, where the finite-sample estimate turns negative even though regret is non-negative at the optimum (Section 4). Both smaller backbones still gain over base (+5.2, +5.7), so the environments help even where the signal is noisy.
  • Figure 14: Curriculum breadth accounts for most of the gain. Suite average (eight benchmarks of Table 1), six-skill vs. two-skill curriculum. Per-benchmark panels: Figure 15.
  • Figure 15: The full 6-skill curriculum lifts held-out benchmarks more than the restricted 2-skill variant; curriculum breadth drives the gains. Qwen3-30B-A3B-Instruct-2507, games setting. Top row: AIME 2025/2026 Avg@32, GPQA-Diamond accuracy, and LiveCodeBench-v6 Pass@1. Bottom row: the four Reasoning-Gym categories; the dashed line marks the untrained base model. Discussed in Section 8.
  • Figure 16: SPADE improves a second backbone family: all four Reasoning-Gym categories end above the untrained Nemotron-30B-A3B-BF16 base (RG-Cognition +9.6, RG-Algorithmic +9.3, RG-Math +2.6, RG-Logic +3.2). Reasoning-Gym win rate across checkpoints; the dashed line marks the untrained base model. Gains arrive after an initial dip early in training, consistent with the Environment Designer initially generating environments too hard for the Reasoning Agent, as observed on the Qwen backbones.
  • Figure 17: Reward granularity increases over training. Left: mean distinct reward levels per environment, including strictly partial levels. Right: early-to-late change in distinct levels overall and by domain (canonical 30B games run).
  • Figure 18: Per-skill learning (canonical SPADE-30B run). (a) Per-skill Reasoning Agent win rate over training (EMA over ∼26 logged points/skill). (b) Win-rate gain (last 25% minus first 25%): Logical Deduction and Spatial Reasoning improve most; Causal Inference, which starts high, declines slightly.
  • Figure 19: Environment-diversity dynamics across the verified-matched runs. Windowed Vendi score (40-step windows, subsampled to exactly 24 environments; mean ± s.d. over 12 draws). The corpus-grounded variants hold the mixed-population reference level for their full run lengths; the no-corpus run starts near-collapsed, peaks at Vendi ∼5.2 near step 100, where its best evaluation checkpoint (111) also falls, and re-collapses as optimization continues. Environment counts differ across runs with run length and acceptance rate; the windowed score uses fixed 24-environment subsamples, so counts do not bias the curves.
  • Figure 20: Task context makes hint utility legible. Four same-record, positive-regret task–hint pairs from the canonical 30B games run. The task summaries retain the goal, hidden information, and usable interaction while removing generic runtime scaffolding. Hint excerpts omit only the standardized answer-format sentence and runtime wrapper. In each header, the two values report the mean return without hint / with hint.
在原文中查看图表 →

论文原文摘要(英文)

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 on average across eight held-out math, science, code, and reasoning benchmarks, and lifts the tool-use setting by +5.7 on BFCL-v4 multi-turn and +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.

作者 · Bo Liu

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道