Slay the Spire: Hypergraph Deck Synergies

I trained hypergraph neural networks over 12,500+ runs to discover higher-order card combos, expose the math behind why static tier lists fail, and identify contextual trap picks.

Intro

In roguelike deckbuilders (Slay the Spire, Balatro, Monster Train), card value is completely non-linear:

Corruption alone exhausts your few defenses and gets you killed. Dark Embrace alone is 2 wasted energy without exhaust outlets. Dead Branch alone generates chaotic hands. Together, they form an infinite card-draw and block engine that solves the game.

Corruption
Corruption Skills cost 0; exhaust
+
Dark Embrace
Dark Embrace Draw on exhaust
+
Dead Branch
Dead Branch Random on exhaust
=
Infinite Loop +11.6 flr surge

Standard graph neural networks assume pairwise edges (u ↔ v). But combinatorial synergy is fundamentally a hyperedge connecting arbitrary subsets of cards and relics simultaneously (k ≥ 3).

1

Encode decks as hypergraphs with k-body edges connecting cards across global, archetype, and cost sets.

2

Prove why static tier lists fail: linear models mathematically cancel out deck context (w_A - w_B is constant).

3

Decompose 1-way, 2-way, and 3-way Shapley interactions to isolate super-additive synergy and contextual trap picks.

The Leaky Metric Trap

Before training deep architectures, we benchmarked simple heuristics on 5,556 Ironclad runs. We immediately found a critical methodological flaw in how deck models are typically evaluated:

Parsed Runs 12,524

Ascension 0–20 across 4 public archives

Ironclad Subset 5,556

4,444 train / 1,112 test held-out split

Floor MAE 3.78 flr

Survival prediction R² = 0.891 across 56 floors

Model Suite 10 models

Heuristic, linear, tree, set, graph, and hypergraph baselines

A trivial 1-feature heuristic that simply counts len(relics) achieves 0.921 ROC-AUC. In roguelikes, survival leaks directly into inventory size: dying on Floor 8 leaves you with 2 relics; beating Floor 56 leaves you with 18.

Predicting overall victory is artificially easy. The genuine modeling challenge is conditional drafting: given your current deck, which offered card maximizes expected survival?

Diagram contrasting pairwise GNN graphs with hypergraph multi-card hyperedges
Figure 1. Pairwise graphs decompose interactions into additive 2-body links. Hyperedges capture joint combinatorial explosions (k ≥ 3).

Model Architecture

We formulate deck state S as an incidence matrix H ∈ {0, 1}|V| × |E| across global, functional archetype, and energy-cost hyperedges.

Diagram of the Hypergraph Neural Network architecture for Slay the Spire
Figure 2. Two-stage message passing (Node → Hyperedge → Node) over combinatorial deck structures.

Incidence Matrix H

Connects items across global deck, functional archetypes (Exhaust, Strength, Block), and cost tiers.

Hypergraph Conv

Two-stage propagation computes multi-body message aggregation in a normalized dense matrix multiplication.

Multi-Task Readout

Jointly predicts continuous floor survival (MAE 3.78 flr) and counterfactual pick rank deltas.

Category Architecture Features / Formulation ROC-AUC Accuracy F1 (Wins) Note
Heuristic Relic Count Only Single scalar: len(relics) 0.921 85.9% 0.531 Leaky baseline: surviving longer collects more relics
Heuristic Deck Length Only Single scalar: len(cards) 0.714 81.7% 0.239 Weak signal without item identity
Tree XGBoost (GBDT) 150 trees, depth 5, multi-hot counts 0.942 89.2% 0.691 Strong tabular baseline
Linear Logistic Regression L2-regularized Bag-of-Cards 0.947 89.1% 0.698 High ROC, but 0% context sensitivity in drafting
Deep Set Set Transformer Multi-head Self-Attention + PMA 0.951 89.4% 0.735 Permutation-invariant card pooling
Deep Graph Pairwise GCN Cosine Adjacency + Multi-head Pool 0.955 90.1% 0.770 Pairwise card-to-card graph convolutions
Deep Hypergraph Hypergraph Neural Net Multi-edge message passing (Ours) 0.953 89.8% 0.739 Captures k-body combinatorial interactions

Why Card Tier Lists Are Broken

Every community tier list assigns each card a static score wi. In any linear formulation, the difference in value between card A and card B is:

Compare Δ(A, B | S) = logit(S ∪ {A}) − logit(S ∪ {B})
Expand = (wTxS + wA) − (wTxS + wB)
Result = wA − wB

S disappears. The ranking cannot react to the deck you already have.

The existing deck S completely cancels out. A linear model or tier list will recommend the exact same card on Floor 2 as on Floor 50, regardless of whether your deck needs immediate damage or boss scaling.

Act 1 Starter Core (Needs Tempo)
Strike Strike
Defend Defend
Bash Bash
Optimal Pick: Armaments (+1.01 flr)
Act 3 Block Core (Needs Boss Scaling)
Barricade Barricade
Entrench Entrench
Body Slam Body Slam
Optimal Pick: Demon Form (+0.26 flr)
Model Act 1 Starter Deck (5 Strikes, 4 Defends, Bash) Act 3 Turtle Block Deck (Barricade, Entrench) Context Sensitivity
Logistic Regression (Linear / Tier List) Demon Form (+0.0129 logit) Demon Form (+0.0129 logit) 0% (Deck context completely cancels out)
Hypergraph Neural Network (Ours) Armaments (+1.01 flr advantage) Demon Form (+0.26 flr advantage) Dynamic Reversal (Adapts to survival vs scaling needs)

In Act 1, Armaments upgrades basic cards to survive Gremlin Nob. In Act 3, Demon Form provides the necessary scaling to defeat the Awakened One. The Hypergraph model correctly reverses its recommendation; linear models cannot.

Results & Higher-Order Synergies

We computed combinatorial Shapley interaction indices across held-out runs to isolate 1-way, 2-way, and 3-way hyperedge values.

Bar chart of 1-way, 2-way, and 3-way combinatorial card synergy contributions
Figure 3. Higher-order synergy decomposition for Exhaust, Block, and Strength engines.

Result 1

Super-Additive Hyperedges

In the Exhaust engine, Corruption alone has a negative single value (-1.13 flr) due to exhausting starter skills.

When combined with Dark Embrace and Dead Branch, it yields a pure 3-way super-additive boost (+0.27 flr). Once the core is assembled, adding a payoff surges survival by +11.56 floors.

Scatter plot matrix contrasting early starter deck value against mature synergy value
Figure 4. The Trap Pick Matrix: Starter Deck Δ vs Mature Synergy Δ.

Result 2

The Trap Pick Landscape

Demon Form is the classic novice trap: spending 3 energy for 0 immediate output in early Act 1 yields a negligible +0.17 flr. In mature decks, it surges to +2.19 flr.

The model also discovered anti-synergies without human rules: pairing Clash with Ascender's Bane produces -0.18 flr because curses brick Clash.

Heatmap showing learned archetype clusters among Ironclad cards
Figure 5. Learned card affinity matrix extracted from hypergraph embeddings.

Result 3

Emergent Archetype Discovery

The intermediate representations cleanly partition cards into four functional game clusters: Exhaust, Strength, Block / Body Slam, and Strike / Aggro.

The network learns functional card roles entirely from survival correlations across 12,500 games.

Archetype Hyperedge Engines

The Exhaust Engine

Corruption
Corruption 0-Cost Skills -1.13 flr single
Dark Embrace
Dark Embrace Draw on Exhaust +2.29 flr single
Dead Branch
Dead Branch Random Gen +1.51 flr single
3-Way Attrib +0.27 flr
Engine Surge +11.56 flr

Adding the 3rd piece to Corruption + Dead Branch explodes survival straight into Act 3 contention.

The Block Infinite

Barricade
Barricade Block Retained +0.33 flr single
Entrench
Entrench Double Block +1.07 flr single
Body Slam
Body Slam Damage = Block +1.70 flr single
3-Way Attrib +0.03 flr
Engine Surge +3.33 flr

Barricade + Body Slam pairs defense into lethal burst damage.

The Strength Engine

Spot Weakness
Spot Weakness +3 Strength +2.02 flr single
Limit Break
Limit Break Double Strength +0.67 flr single
Heavy Blade
Heavy Blade 3x Str Scaling +1.25 flr single
3-Way Attrib +0.22 flr (pair)
Engine Surge +4.28 flr

Limit Break doubles base strength, scaling Heavy Blade into a one-hit finisher.

Card Type Win Rate Act 1 Starter Δ Mature Synergy Δ Divergence Diagnosis
Demon Form Demon Form
Power 28.7% +0.17 flr +2.19 flr +2.01 TRAP PICK (Act 1)
Limit Break Limit Break
Skill 31.5% +0.37 flr +1.52 flr +1.15 TRAP PICK (No Strength)
Searing Blow Searing Blow
Attack 17.5% +0.15 flr +0.20 flr +0.05 POOR IN ALL DECKS
Body Slam Body Slam
Attack 34.3% +0.63 flr +3.77 flr +3.14 SYNERGY ENABLER
Perfected Strike Perfected Strike
Attack 18.6% +0.80 flr +4.70 flr +3.90 ACT 1 TEMPO
Armaments Armaments
Skill 22.7% +1.18 flr +3.29 flr +2.11 UNIVERSALLY STABLE
Feed Feed
Attack 32.5% +0.73 flr +2.83 flr +2.10 SNOWBALL SCALING

Interactive Card Drafting

To evaluate card reward screens during live runs, we built an interactive pick evaluator (scripts/pick_evaluator.py). Below are two real decision points:

Scenario 1 • Act 1 Floor 5

Starter Deck looking for Elite survival

Current Deck: 5x Strike, 4x Defend, Bash, Carnage + Burning Blood (Base: 5.1 / 56)

Demon Form 🌟 TOP PICK
Floor Δ +0.55 flr

Boss scaling, but sluggish for Gremlin Nob

Battle Trance DECENT
Floor Δ +0.35 flr

Zero-cost draw 3 cards

Corruption ⚠️ TRAP PICK
Floor Δ -0.92 flr

Exhausts starter shields early

Takeaway: Drafting Corruption without skills or exhaust payoffs drops survival by nearly a full floor.

Scenario 2 • Act 2 Floor 24

Mature Exhaust Core with Dead Branch

Current Deck: Strikes, Defends, Shrug It Off, Corruption, Flame Barrier + Dead Branch (Base: 27.1 / 56)

Feel No Pain 🌟 TOP PICK
Floor Δ +11.56 flr

Infinite block engine with Dead Branch

Dark Embrace TOP TIER
Floor Δ +10.36 flr

Infinite draw engine

Demon Form DECENT
Floor Δ +6.78 flr

Solid, but inferior to exhaust payoffs

Takeaway: With Dead Branch in inventory, Feel No Pain catapults expected survival straight to Act 3 Bosses.

Discussion

Modeling deckbuilding requires moving beyond flat vector features and static tier lists. By modeling runs as hypergraphs and framing evaluation around counterfactual draft choices rather than leaky end-of-run win rates, neural networks can uncover deep strategic structure.

The useful result is not a marginal benchmark lead. It is a representation that changes its recommendation when the deck changes, exposes higher-order interactions, and separates cards that are broadly strong from cards that only become strong inside the right engine.

References