This paper presents a novel approach to training reinforcement learning (RL) agents for the complex deck-building roguelike Slay the Spire 2 (STS2). The authors demonstrate that a relatively small model can achieve competitive performance at high difficulty levels without using any lookahead or tree search during gameplay, provided it is trained with a specialized "failure-driven" curriculum.
TL;DR
The authors develop a 6.6M-parameter "entity transformer" that plays Slay the Spire 2 with zero-search inference, achieving a 15.6% win rate on the highest difficulty (A10) for the Ironclad character. Their core innovation is a failure-driven restart curriculum that uses a headless game host to force the agent to practice specifically in the late-game scenarios where it most frequently loses.
What Problem Does This Paper Address?
Reinforcement learning in games like STS2 faces two major hurdles: long horizons and sparse rewards. A single winning run requires hundreds of decisions, but the most critical "make-or-break" moments often occur in late-game boss fights.
Standard RL agents spend the vast majority of their training time in the early game (Act 1), which is relatively easy. Consequently, they rarely reach the late-game "bottlenecks" (Act 3 bosses) often enough to learn how to beat them. Furthermore, many late-game losses are actually caused by poor deck-building choices made much earlier, creating a difficult credit-assignment problem.
Methods
The researchers built a custom training infrastructure and a novel curriculum:
- Headless .NET Host: Instead of a reimplementation, they run the actual game assembly (v0.107.1) in a headless environment. This ensures 100% behavioral fidelity and allows for exact state reproduction using game seeds and action prefixes.
- Entity Transformer: The agent uses a 6.6M-parameter transformer (Figure 1) that treats game objects—cards, relics, enemies, and orbs—as typed tokens. This allows the model to handle the variable number of entities present in any game state.
- Failure-Driven Restart Curriculum: This is the paper's key contribution. The system maintains a "failure map" that tracks where runs are lost. It then uses the headless host's replay capability to restart training episodes directly from these high-failure situations (e.g., starting Act 3 or a specific boss fight) in proportion to their difficulty.
- Zero-Search Inference: Unlike previous state-of-the-art agents that use Monte Carlo Tree Search (MCTS) to simulate thousands of moves before acting, this agent makes every decision with a single forward pass of the network (taking only ~25ms).
Datasets
- Held-out Canonical Seeds: Evaluation was performed on 12,800 games across five characters at Ascension 10 (A10), using a fixed set of random seeds to ensure reproducibility.
- Cross-Agent Benchmark: The authors established a common panel of 512 seeds to compare their agent against AlphaSpire, Spire Mentor, and frontier LLMs.
Key Insights and Ideas
- Exact Replay as a Training Tool: By leveraging the game's own code for a headless host, the authors turned a "black box" game into a perfectly reproducible environment where they could "save-scum" for the sake of training efficiency.
- The "Bottleneck" Hypothesis: The study confirms that late-game bosses are the primary barrier to high win rates. Interestingly, they found that for many losses, even re-playing the entire last Act with perfect hindsight couldn't save the run, suggesting that the "decisive errors" often happen during early-game deck-building.
- LLMs Struggle with Tactical Depth: Despite their reasoning capabilities, frontier models like GPT-6 Astra failed to win a single game at A10 in this study. This highlights the gap between general reasoning and the precise, long-term resource management required by STS2.
Key Results
The zero-search agent achieved impressive results compared to both search-based agents and other zero-search models:
- High-Difficulty Performance: At A10, the released policies averaged an 8.05% win rate. The Ironclad reached 15.6%, the highest reported for a zero-search agent (Figure 3).
- Efficiency: The agent requires only 21–27 ms per decision on a single CPU core, making it orders of magnitude faster than MCTS-based agents like Spire Mentor, which can take minutes per run.
- Comparison to Search: In a head-to-head test on identical seeds, the zero-search agent (8.2% avg) performed nearly as well as Spire Mentor's search-based approach (8.8% avg) (Figure 5).
- Curriculum Impact: The failure-driven curriculum provided a consistent boost for the "Regent" character, outperforming uniform restarts by 3.6 percentage points.
Limitations and Future Work
- Combat Gap: The authors note that their agent's primary weakness compared to search-based agents is tactical combat sequencing in the final boss fights. They suggest that distilling search into the policy (using MCTS to generate training targets) could close this gap.
- Character Variance: The failure-driven curriculum was highly effective for some characters (Regent) but showed negligible effects for others (Silent), suggesting the "failure map" heuristic may need refinement for different playstyles.
- Credit Assignment: While restarts help with late-game practice, they don't fully solve the problem of identifying which Act 1 card pick caused an Act 3 loss. Future work could explore more sophisticated attribution methods.
Summary updated