MageZero: Pauper P1
The first format-wide policy-and-value network from MageZero, an
AlphaZero-style system by Will Wroble for Magic: The Gathering on the XMage
rules engine. One network for the 8-deck Pauper pool in XMage's Mage.MageZero/decks: Affinity, Burn, CawGates,
Elves, Faeries, Rally, Spy, Wildfire (Pauper-*.txt). It succeeds the Faeries-only
ver15, from which it was warm-started.
Files
model.pt.gz: gzippedtorch.savedict withmodel_state_dict,arch,feature_vocabandedge_vocab(leaf-feature and edge-label vocabularies),hide_opponent_hand(false) andepoch(3). Optimizer state removed; weights identical to MageZero'sexperiment_models/Pauper/P1.
Load it with MageZero's code (src/magezero, branch graph-encoder-test):
from huggingface_hub import hf_hub_download
from model import load_checkpoint # MageZero/src/magezero
model, vocab, edge_vocab = load_checkpoint(hf_hub_download("inkling616/MZ-Pauper-P1", "model.pt.gz"))
or serve it to XMage: python src/magezero/server.py --model <folder with model.pt.gz> --port 50052.
Input and outputs
Same as ver15. Input: the game-state graph from XMage's StateEncoder (typed internal nodes ROOT, PLAYER, ZONE,
STACK_OBJECT, PERMANENT, CARD, ABILITY; hashed leaf features; labelled child→parent edges), sent by
RemoteModelEvaluator. Outputs: priority logits per ABILITY node, target logits per CARD / PERMANENT / STACK_OBJECT /
PLAYER node (softmax over the legal candidates), choose-use logits and a tanh value for the deciding player.
NetGraph, 9.1M parameters: d256, 4 heads, FF 512, two bottom-up local passes (one attention layer per node type),
a 2-layer global transformer over [CLS, internal nodes].
Training
- Warm start: ver15 weights (fresh optimizer); the vocabulary grew from 1,556 to 1,566 leaf rows and 20 to 23 edge labels for the new decks' cards.
- Data (7.18M training states, both seats, every 5th game of each block held out):
- ver15 piloting each Pauper deck against XMage's offline heuristic MCTS playing each deck (8×8, 200 games each);
- ver15 self-play on all 36 deck pairings (200 games each);
- the Faeries data ver15 trained on (gen0 heuristic vs heuristic, gen1–gen3 games of earlier models).
- Targets: 300-simulation MCTS visit distributions (legal candidates only) and TD-0.92 value labels.
- Recipe: Adam lr 3e-5, batch 64, 3 epochs (112,172 steps each), MSE value loss, seed 0. This checkpoint is the end of epoch 3.
Held-out metrics
value MSE / priority KL / target loss / priority top-1 on non-pass moves:
| block | P1 | ver15 |
|---|---|---|
| 8×8 games (held out) | .039 / .049 / .052 / .621 | – |
| self-play games (held out) | .048 / .068 / .056 / .594 | – |
| Faeries model-vs-model blocks (mean of 5) | .0376 / .0524 / .0418 / .689 | .0386 / .0532 / .0424 / .687 |
Not yet tested in play. For reference, ver15 (Faeries-only) piloting each deck against the offline heuristic search won 64.4% over all 64 deck pairings, and lost the Burn (37.5%) and Wildfire (36.0%) mirrors.
Limitations
- Trained with the opponent's hand visible; expect weaker play with hidden information.
- XMage-specific input encoding; using it elsewhere needs that graph rebuilt from the other engine's state.
- Most non-Faeries data comes from one generation of games, so its play with those decks is less refined than with Faeries (non-pass accuracy ≈.59–.62 on the new decks vs ≈.69 on Faeries).