SPADE: Self-Play in Adaptive Synthetic Executable Environments
Why AI must write its own exams
Reinforcement learning (RL) post-training of large language models (LLMs) has long been constrained by human-written environments. High-quality internet text has been exhausted, and expert-designed test environments cannot keep pace with algorithmic iteration. SPADE addresses this by letting a single model act as both examiner and examinee: it writes runnable Python code as new virtual training worlds, then solves tasks within them, using a regret-based reward to keep difficulty precisely at the agent's capability frontier.
Evolution of self-play environments
1. SPIRAL (2024) — self-play within a few fixed, human-written zero-sum games; performance plateaus once the agent exhausts those games.
2. SPICE (2025) — questions mined from real document corpora; still limited to static text with no multi-turn interaction or state transitions.
3. SPADE (2026) — the model directly writes complete Python interactive environments (Gym-style, with reset() and step() interfaces, state machines, and validation logic). Any Markov Decision Process expressible in code becomes a training ground.
Hint-based regret reward
If left unconstrained, a self-designing examiner could produce trivial or unsolvable tasks. SPADE solves this with a Hint-Based Regret Reward:
- The designer builds an environment and withholds a secret hint.
- The agent attempts it with and without the hint, yielding scores \(R_{\text{hint}}\) and \(R_{\text{no\_hint}}\).
- Too easy (full marks without the hint): regret = 0, designer gets nothing.
- Unsolvable/broken (hint doesn't help): regret = 0, designer gets nothing.
- Just right (solvable with the hint, but at the agent's edge without it): designer gets maximum reward.
- *SPADE: Self-Play in Adaptive Synthetic Executable Environments* — Bo Liu (Benjamin Liu), University of Washington & Stanford University, August 14, 2026.
- Paper: https://huggingface.co/papers/2608.19197
- Code: https://github.com/spade-rl/spade
- Key claim: single-model designer/agent self-play with hint-based regret reward surpasses fixed-environment baselines by +5.3 at 30B scale, with up to +13.9 on multi-turn tool calling.
- Silver, D., et al. (Nature, 2017). *Mastering the game of Go without human knowledge (AlphaGo Zero)*. DOI: https://doi.org/10.1038/nature24270 — foundational work showing pure self-play can exceed accumulated human knowledge.
This anchors tasks in the agent's Zone of Proximal Development, continuously pushing difficulty forward as the agent improves.
Three essential pillars
Without safeguards, models "derail": in one experiment, an ungrounded model generated 41 identical rotation-maze environments over 41 consecutive training steps. SPADE's three pillars prevent this:
1. Corpus grounding — designers must draw on real-world documents (physics, finance, coding) for diversity. 2. Environment memory — a record of past environments prevents self-repetition. 3. Trained co-evolution — the designer must train alongside the agent; freezing the designer (even a stronger one) degrades results because a static examiner cannot track the learner's growth.
A t-SNE projection of generated environments shows the ungrounded version collapsing into a single dense cluster, while full SPADE spreads uniformly across the feature space (diversity score 0.68).
Results on agentic benchmarks
| Benchmark | Task | Base | + SPADE | Gain | | :--- | :--- | :---: | :---: | :--- | | BFCL v4 (multi-turn tool calling) | Function calls & API arguments | 49.0 | 54.7 | +5.7 | | tau^2-bench | Multi-turn interaction, state backtracking | 49.0 | 52.6 | +3.6 | | ACEBench-Agent | Long-horizon software operation & DB management | 62.0 | 75.9 | +13.9 |
Gains in tool calling are attributed to SPADE's multi-turn environments forcing the model to issue a request, read error feedback, revise assumptions, and call the next tool — acting on feedback rather than blind guessing.
Outlook
SPADE sketches a path beyond human-curated data: from pretraining on human text, to SFT on human answers, to RL in human-built environments — and finally to letting the model build its own training worlds, enabling open-ended self-evolution.