SpireMind-Defect-2B-SFT: out-of-combat decision making for Defect in Slay the Spire 2
2 min read
The model is built on Qwen3.5-2B (2.21 billion parameters) and fine-tuned using SFT (supervised fine-tuning) to make out-of-combat strategic decisions for the Defect character in Slay the Spire 2 (version v0.113.1). It handles card rewards, shops, events, rest sites, map routes, and card choices, but does not play actual combats—the combat phase is handled by a separate AlphaDefect model. The model was created by distillation from the teacher AlphaDefect PPO (reinforcement learning policy) training policy and matches its choices in 92.0% of cases. This release is useful for developers of AI agents for turn-based strategy games, automation enthusiasts, and model distillation researchers.
Key features
- Narrow specialization: trained exclusively on non-combat decisions for the Defect character at Ascension 10 difficulty.
- High accuracy: matches the teacher model's choices in 92.0% of test situations and recovers about 95% of the teacher's win rate in simulations.
- Specific format: works only with the custom SpireMind project renderer, which converts the game state into a text prompt.
- Open base: weights are distributed under the Apache-2.0 license following the base Qwen model.
What you can do
- Run full game simulations: test the model on the
Sts2Headlesssimulator for automated out-of-combat run progression. - Integrate with vLLM: deploy the model locally to generate responses with constraints on allowed answer token letters.
- Evaluate and compare: run evaluation scripts from the SpireMind repository to check matches with the teacher on fixed seeds.
Example
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
repo = "yutengz/SpireMind-Defect-2B-SFT"
tok = AutoTokenizer.from_pretrained(repo)
llm = LLM(repo, max_model_len=16384, enable_prefix_caching=True, limit_mm_per_prompt={"image": 0, "video": 0},
max_logprobs=64, logprobs_mode="processed_logprobs")
text = "..." # один отрендеренный игровой шаг
letters = "ABCD" # допустимые варианты выбора
prompt = tok.apply_chat_template([{"role": "user", "content": text}], tokenize=False,
add_generation_prompt=True, enable_thinking=False)
ids = [tok.encode(L, add_special_tokens=False)[0] for L in letters]
out = llm.generate([prompt], SamplingParams(max_tokens=1, temperature=0.0, logprobs=len(ids), allowed_token_ids=ids))
print(out[0].outputs[0].text)Read more
Details• Dataset: 1,028,146 decisions from 10,000 games played by the teacher.
• Training: 1 epoch, 4,017 steps, batch size 256, lr 1e-5, bf16.
• Hardware: 8 × NVIDIA L40S, FSDP2.
• Limitations: works only for game version v0.113.1, requires a purchased copy of the game client to extract data tables.










Comments