r/reinforcementlearning • u/Forkei0 • 5h ago
Exp PPO agent for Balatro ends on the same Pair build every run and stalls at 23% on the hardest stake. How do I get it to explore other builds?
PPO agent for Balatro: 95% wins on the easiest stake, 23% on the hardest (30,000 seeds), and every training run ends on the same build. It looks like an exploration problem but I can't prove it is one.
If you haven't played it: a run is 8 antes of 3 blinds, each a score target you beat by playing poker hands from your deck. Between blinds you shop for jokers (permanent modifiers that add chips or multiply your score) and cards that level up one hand type. A build is the hand type you commit to plus the jokers that scale it. Gold is the hardest of 8 difficulty levels.
Setup: transformer policy, about 7M parameters. PPO, 512 envs x 128 steps, gamma 0.999, GAE 0.95, entropy 0.003, a bit over a billion steps, trained on all stakes at once. Masked discrete actions: which cards to play or discard, what to buy, sell, use or skip. Reward is +1 for winning the run, no shaping.
It sees everything on screen plus the exact score each possible play would get. Which is computed from visible cards only, but a human would have to do the arithmetic (not cheating, trust). The simulator is 1:1, checked against the game's code, and the agent plays the game through a mod with the same results.
The build: it plays Pairs, levels Pair up, and takes whatever multiplier jokers the shop gives it. In the run in the video linked below, 50 of its 60 hands are Pairs.
Its single shop decisions hold up. At 500 shop decisions on Gold I tried every option, 128 redrawn futures each, with the same net playing on afterwards (earlier checkpoint). Overriding its choice with the best option gains +0.0003 win rate, 95% CI -0.0013 to +0.0018. I know that only shows each choice is the best one given how this net plays afterwards. It can't tell me whether a different plan across many shops would win more.
Tried so far, measured on Gold with paired seeds:
- Random starting jokers on a third of training episodes, so it gets to play other builds: +0.007 +/- 0.007, same build.
- Restarting 30% of episodes from its own mid-game states: -0.002 +/- 0.010.
- Cutting the per-blind progress reward it used to have to a quarter: +0.003 +/- 0.008, same build.
- Search inside a round, 16 sampled futures with policy rollouts: -0.013 +/- 0.013.
- Replaying each seed several times and training on the best line: -0.006 +/- 0.003. It learns moves that fit one deal.
- More steps: the last 320M bought under a point.
- Averaging the weights of six runs: about +1 point. The only thing that helped.
From a given state, about 60% of the win/loss variance on Gold comes from the hidden future, so the signal for any single choice is weak.
- I can't show that a better build exists for this agent. I only know that people win Gold with flushes, straights and scaling jokers. How would you test whether it's stuck in a basin, or whether nothing better is within its reach?
- Has anyone made exploration at the level of a whole strategy work with PPO in a game this noisy? I'm thinking of a per-episode latent with a diversity reward on the final build, or an archive of states keyed on build to restart from. My restarts used its own states, which are all Pair builds, so that probably explains that null.
