Instructions to use Steven10429/laya-balatro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Steven10429/laya-balatro with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
laya-balatro β Laya fine-tuned to play Balatro (v1.3)
Laya is a 421M-parameter non-generative decision model
(ModernBERT-large backbone): it reads a state and scores a list of options. This checkpoint fine-tunes it to
play Balatro, where every decision is one choice question: the game state
as text (with every joker / boss / tag effect spelled out), the legal moves as options.
Code, logs and the write-up: github.com/StevenLi-phoenix/laya-balatro.
v1.3: a recorded real win β raw0056.pt on seed UP2YINZS
raw0056.pt beat real Balatro (Red Deck, White Stake) on seed UP2YINZS: 27 rounds, Ante 10, every click its own,
greedy; the simulator twin also reached 27. Video: media/laya_balatro_win_UP2YINZS.mp4 (4x, the win screen at
normal speed); the cover above is its win screen.
The seed was picked by the simulator. Real Balatro under Steamodded draws the boss with the same pseudoseed as the jackdaw simulator but indexes a pool built by iterating a hash table; with that order read from the game, all 646 recorded real boss sequences match the simulator. Of 2,592 fresh random seeds, raw0056 won 3 in the simulator; UP2YINZS held when replayed alone on the validator PC and then won in the real game, move for move. On random seeds the same weights still rarely win: 1 win in 541 earlier raw-click real runs, none in 9 recorded runs today.
Also in v1.3 (no new champion):
| experiment | result |
|---|---|
| Stage 3: computed consequences in the options (exact score of the selection, draw odds) | champions with notes 4.59β5.21 on the 128 fixed seeds; raw0056 without notes 5.63 |
| Stage 4: imitate the HF teacher again (500k clicks) | agreement 70.8% β 81.1%, ladder fell to 4.02β4.89 |
| hosted decision APIs, zero-shot, same 64 seeds (OpenRouter decisions endpoint) | TypeSafe Jev 1.13 0.02 rounds, OpenAI GPT-6 Luna Decisions 0.20, raw0056 6.06 |
media/compare_BXEMK4GS.mp4: GPT-6 Luna Decisions, raw0056 and Jev in real Balatro on one seed (5, 11 and 2 rounds).
v1.2: end of Stage 2 β raw0056.pt, and the first win raw0032.pt
Stage 2 ended after 65 RL iterations. From iteration 48 a quarter of self-play hand turns were also labelled by a simulator search (exact scores for every play, rollouts of candidate plays and discards on reshuffled decks; no draw order or RNG seen), taught within a trust region (soft targets: the playing distribution moved a step toward the search's clicks). Laya's interface stays raw clicks.
| checkpoint | simulator, same 128 fresh seeds (greedy) | real Balatro (random seeds) |
|---|---|---|
raw0032.pt |
β | first win: seed MST5TRB3, beat Ante 8, round 26 in endless |
raw0046 (last champion before search labels) |
5.70 rounds (median 3.5) | 5.7 rounds, 20 runs |
raw0056.pt (final Stage 2 champion) |
5.63 rounds (median 4); vs raw0046 β0.07, t β0.2 | 4.9 rounds, 60 runs, best 17 |
Search labels brought two promotions but no gain on the same-seed ladder: Laya's click distribution is nearly 0/1 and training did not move the clicks it disagreed with. Stage 2 (raw clicks) did not overtake Stage 1's real average.
Video: media/laya_balatro_v1.2.mp4 (raw0056 on seed IUVSM98K, picked as its best seed in the 128-seed simulator
evaluation where it reached 20 rounds; the real run diverged and ended at 14 rounds, Ante 5; 2x speed, every click subtitled). media/laya_balatro_first_win.mp4: raw0032's winning run.
v1.1 (Stage 2): raw clicks, pure RL β raw0008.pt
Laya now clicks like a player: each call is one choice question over primitive moves (select Kβ₯, deselect Kβ₯,
play selected, discard selected, use Strength on selected, shop / pack / blind moves); a decision takes several
calls. No pre-built combinations, hand labels or score estimates. The teacher is used once (kickoff imitation, 72.0%
click agreement); afterwards pure RL in the simulator with the PPO clipped surrogate and same-seed credit (each seed
played 4 times, decisions judged against siblings on the same deal). Each iteration the new weights play the champion
on the same fresh random seeds.
| checkpoint | simulator head-to-head (fresh random seeds) | real Balatro (random seeds) |
|---|---|---|
raw_init.pt (kickoff) |
2.25 | 0.25 rounds, 4 runs |
raw0002.pt |
5.88 vs 2.34 (t +5.3) | 5.33 rounds, 12 runs, best 12 |
raw0007.pt (PPO) |
6.09 vs 5.16 (t +2.8) | 9.0 rounds, 3 runs, best 11 |
raw0008.pt (PPO + same-seed credit) |
6.02 vs 5.20 (t +2.5) | validating (video run: 11 rounds, Ante 4) |
Video: media/laya_balatro_v1.1.mp4 (raw0008 in the real game, 1x speed, every click subtitled).
Use with LAYA_ACTIONS=raw (the default in the repo from v1.1).
Files
| file | what |
|---|---|
raw0056.pt |
v1.2 final Stage 2 champion (raw clicks), still the best; the v1.3 recorded win. Same format as below. |
raw0032.pt |
the checkpoint of the first real-game win (raw clicks). |
raw0008.pt |
v1.1 champion (raw clicks). Same format as below. |
sim0053.pt |
Stage 1 (v1.0) champion. Only the fine-tuned tensors (top 6 encoder layers, final norm, decision head); load on top of stock Laya with strict=False. |
media/laya_balatro_win_UP2YINZS.mp4 |
v1.3: raw0056 beats the real game on seed UP2YINZS (4x; cover: media/laya_balatro_win_UP2YINZS.png). |
media/compare_BXEMK4GS.mp4 |
v1.3: hosted decision APIs vs Laya in the real game, one seed, 2x2 grid. |
media/laya_balatro_v1.2.mp4 |
raw0056 playing the real game (seed IUVSM98K), clicks subtitled. |
media/laya_balatro_first_win.mp4 |
raw0032's winning run (seed MST5TRB3). |
media/laya_balatro_v1.1.mp4 |
raw0008 playing the real game, clicks subtitled. |
media/laya_balatro.mp4 |
v1.0: one real run (seed 71SHDI9E, 4x speed) with Laya's decisions as subtitles; reaches Ante 6. |
media/*.png |
Training and evaluation charts. |
Training
- Imitation of a heuristic teacher: makemake/5k-balatro-games (V68 heuristic in the Pylatro simulator, Blue Deck, 74.6% wins), decoded into the same text states and options.
- Self-play in jackdaw, a Python re-implementation of Balatro aligned with the real game seed-for-seed: outcome-weighted fine-tuning (reward-to-go per decision, unlikelihood on bad moves), 53 iterations.
Results (Red Deck, White Stake)
| simulator, 128 seeds | real Balatro, 81 random-seed runs | |
|---|---|---|
| imitation only | 7.50 rounds* | 7.8 rounds |
sim0053 |
9.01 rounds | 8.0 rounds, best 17 (Ante 6), 0 wins |
* 64 seeds. Simulator replays of the real runs' seeds matched the real round count in 73/81 runs.
Use
# pip install laya==0.3.21 ; git clone https://github.com/StevenLi-phoenix/laya-balatro
from huggingface_hub import hf_hub_download
from laya_player.policy import Policy
pol = Policy(hf_hub_download("Steven10429/laya-balatro", "raw0056.pt")) # LAYA_ACTIONS=raw
idx, probs = pol.choose("hand", state_text, options, greedy=True)
sim0053 (v1.0) was trained with the Stage 1 interface, where options are pre-built plays and discards with a hand type
and a score estimate (LAYA_ACTIONS=combo in the repo). v1.1 checkpoints (raw*.pt) use raw clicks.
Limitations
- Two real wins: raw0032 on a random seed, raw0056 on a seed the simulator picked. On random seeds it averages around Ante 2β3 (5β6 rounds), and half of all runs end in Ante 1β2.
- Imitating the teacher more closely made it worse in our simulator (160k more decisions: agreement 77% β 84%, simulator score 9.01 β 7β8.3), partly because the Stage 1 options could not express most of the teacher's card choices and an appended-teacher-option label leaked into 11% of hand examples. Details in the GitHub report.
Balatro is Β© LocalThunk / Playstack; this is an unaffiliated fan research project. No game assets are included.
v1.1 issue fixed in v1.2: targeted Arcana-pack tarots were never applied (now a two-step choice; Balatro spells The Hierophant c_heirophant).
- Downloads last month
- -
Model tree for Steven10429/laya-balatro
Base model
convaiinnovations/laya


