Build, Don't Play: Self-Improving LLM Research Agents Develop a Hearthstone Battlegrounds AI That Rivals Top Players
Abstract: Can LLM agents carry a hard real-world problem from raw data to a system that holds its own against people? We study this in Hearthstone Battlegrounds, an eight-player auto-battler with stochastic shops and battles, hidden information and nearly a thousand interacting cards. We present AutoTavern, a self-improving research system: specialised LLM research agents share a typed research memory, every claim passes verification gates, and live games close the loop, so the agents improve the simulator, opponents and policy and, from the same feedback, their own research process; a human sets goals and rules on ambiguous mechanics. In 20 days AutoTavern built TavernGym, the first faithful, full-content reproduction of the live game, and delivered 23 versions of TavernAgent, trained with PPO against opponents calibrated to real games. TavernAgent plays complete games on the live ladder by itself: its rating rose from 6,000 to about 15,000 and, on the public leaderboard's measure, its last 20 records average a placement of 1.60 with 80% first places, better than the server's ten highest-rated players on every statistic (2.34, 59%). TavernBench, 960 tasks in 40 scenarios, shows that the system the agents built is the strongest player: TavernAgent answers 91% of the play tasks against at most 63% for frontier LLMs, and decides in 0.03 s where they need up to 26 s; within the second a live turn allows, it keeps 90% and no LLM more than 26%. LLM agents build far better than they play. We will open-source TavernBench and TavernGym at https://github.com/MCG-NJU/AutoTavern.
Paper Prompts
Sign up for free to create and run prompts on this paper.
Explain it Like I'm 14
1. What is this paper about?
This paper describes AutoTavern, a system that uses several AI “research assistants” to build an AI player for Hearthstone Battlegrounds.
In this game, eight players collect and arrange fantasy creatures. The creatures then fight automatically. Players must make many decisions, such as:
- Which creatures to buy or sell
- How to arrange their team
- When to upgrade the tavern
- Which special powers or cards to use
- How to prepare for unknown opponents
The researchers wanted to know whether AI agents powered by LLMs, could do more than answer questions or write code. Could they actually build a complete game-playing system that performs as well as top human players?
Their answer was largely yes.
2. What questions did the researchers ask?
The main research question was:
Can a group of LLM-based agents build a strong AI system for a difficult, changing, real-world game?
The researchers also explored several smaller questions:
- Can AI agents build an accurate computer version of the game?
- Can they train another AI to make good decisions in that game?
- Can the trained AI play the real online game?
- Can the system improve itself by learning from mistakes?
- Are LLMs better at building a game-playing AI than at playing the game directly?
The last question was especially important. The researchers compared ordinary LLMs, such as chatbot-style models, with the specialized AI that the LLM agents created.
3. How did they do the research?
Building a team of AI researchers
AutoTavern used several specialized AI agents. Each agent had a different job, much like members of a human research team:
- An environment agent built the game simulator.
- A training agent trained the game-playing AI.
- An opponent agent created computer opponents that behaved like human players.
- An evaluation agent tested whether changes actually helped.
- A deployment agent connected the AI to the real game.
- A research leader decided what problem to work on next.
The agents shared a carefully organized research memory. This memory stored experiments, discoveries, mistakes, corrections, and rules about the game.
Creating TavernGym
The agents built TavernGym, a computer simulation of Hearthstone Battlegrounds. A simulator is like a practice version of a game where a computer can play thousands of matches quickly.
TavernGym included:
- All 978 game objects in the selected game version
- The buying phase and the automatic battle phase
- Heroes, minions, spells, trinkets, and special effects
- Hidden information, such as what opponents might be planning
- The same legal actions available in the real game
The simulator could run about 190 to 280 complete eight-player games per second on one computer processor. This allowed the AI to practice far more quickly than a person could.
Training TavernAgent
The researchers then trained TavernAgent, the game-playing AI.
They used a method called reinforcement learning. In everyday terms, this is like training a player by letting it try many actions, seeing how well it finishes, and rewarding actions that lead to better results.
The AI received a reward based mainly on its final position:
- 1st place was best.
- 8th place was worst.
The researchers used PPO, a reinforcement-learning method that helps an AI improve without changing its behavior too wildly after each training session.
The AI played against computer-controlled opponents based on statistics from strong human players. These opponents were repeatedly adjusted using information from real games.
Testing and checking the system
AutoTavern used several safety checks, called verification gates. These were designed to stop the agents from believing results that were caused by bugs or luck.
For example:
- Code had to pass tests before being used.
- A model had to be matched with the exact simulator version it was trained on.
- New versions had to be tested with different random starting conditions.
- A model had to be tested on situations it had not been selected on.
- Successful models had to play real online games.
This is similar to testing a science experiment several times instead of trusting one lucky result.
Learning from real games
The AI played real games on the live ladder. The researchers compared what happened in the real game with what the simulator predicted.
When the two did not match, the agents investigated the problem. During the project, they made 184 fixes to game rules, card information, input formats, computer opponents, and the controller connecting the AI to the game.
4. What did they find?
The AI became a very strong player
Over 20 days, the system created 23 versions of TavernAgent.
In simulated games, its first-place rate improved from 1.9% for the first version to 41.5% for the final version. Its average finishing position also improved from 3.40 to 2.33.
When playing the real online ladder, the AI’s rating rose from about 6,000 to about 15,000. The researchers reported that its recent results were better than those of the server’s ten highest-rated human players on several measures.
For its last 20 reported games:
| Measure | TavernAgent | Top 10 human players |
|---|---|---|
| Average placement | 1.60 | 2.34 |
| First-place rate | 80% | 59% |
These results suggest that the specialized AI was capable of playing at, or even above, the level of top players during the tested period.
The specialized AI was much better than general LLMs at playing
The researchers created TavernBench, a test containing 960 game-related tasks across 40 situations.
TavernAgent answered 91% of the play tasks correctly. The best general-purpose LLM tested scored 63%, while other models scored between 22% and 53%.
The specialized AI was also much faster:
- TavernAgent: about 0.03 seconds per decision
- General LLMs: about 1.4 to 26 seconds per decision
This speed matters because a real game turn does not allow unlimited thinking time.
LLMs understood rules but struggled to choose the best move
The general LLMs were often good at answering questions such as:
“What does this card do?”
However, they were much worse at questions such as:
“Which action should you take now to give yourself the best chance of winning?”
This is an important difference. Knowing the rules of chess is not the same as knowing the best chess move. Similarly, knowing what every card does is not enough to manage a complete Battlegrounds game.
Using a simulator helped LLMs
When general LLMs were given access to TavernGym as a tool, their performance on some combat questions improved greatly. This suggests that computers are often better than LLMs at performing complicated calculations and testing many possible outcomes.
The agents discovered important mistakes
The self-checking process found several problems that would have made the results misleading.
For example:
- A copied game accidentally kept information about future random events. This allowed the AI to “see the future.”
- Choosing the best result from many experiments made improvements look larger than they really were.
- The simulator and the real game sometimes described the same situation differently.
- Some computer opponents did not behave enough like the opponents the AI met online.
- A version that looked better in simulation actually performed worse on the real ladder.
These discoveries show why testing only inside a simulator can be dangerous. A simulator may contain hidden mistakes, just as a flight-training program would be unsafe if its controls did not match those of a real airplane.
5. Why are these findings important?
The paper’s main message is:
LLM agents can be much better at building a specialized AI system than at directly doing the task themselves.
A general LLM may be slow and make mistakes when asked to play every turn. But it can still help create:
- A realistic simulator
- Training programs
- Testing systems
- Opponent models
- Error-checking procedures
- A fast specialized game-playing AI
The research also shows the value of a reality loop. This means repeatedly comparing the computer’s predictions with what happens in the real world. When the results disagree, the system fixes itself and updates its methods.
The approach could be useful beyond games. Similar systems might help build AI for:
- Robotics
- Traffic planning
- Business simulations
- Scientific experiments
- Software engineering
- Complex decision-making tasks
However, the results should not be treated as proof that AI can solve every problem automatically. The study tested one game, one game version, and one period of online play. Human researchers still set goals, resolved unclear rules, and helped with deployment. The system also depended on a carefully built simulator and many computer experiments.
Conclusion
AutoTavern used a group of LLM-based research agents to build a realistic Hearthstone Battlegrounds simulator and a specialized AI player. The agents performed thousands of experiments, found and corrected many mistakes, and improved the AI by testing it in both simulation and real games.
The resulting TavernAgent played very strongly and was faster and more accurate than general-purpose LLMs when making game decisions.
The most important lesson is that an AI LLM does not have to be the best player itself to build a very good player. In this study, LLMs were better at organizing research, writing software, testing ideas, and improving a specialized system than at directly playing the entire game.
Practical Applications
Immediate Applications
The paper’s artifacts and engineering practices can support the following uses now, provided licensing, game-provider rules, and reproducibility are addressed.
- Game-AI research and benchmarking — Academia / software
- Use
TavernGymas a reproducible environment for reinforcement learning, partial-observability, multi-agent planning, opponent modelling, and stochastic decision-making. - Use
TavernBenchto evaluate models on action selection, combat reasoning, strategy, latency, and simulator-verified outcomes rather than text-only explanations. - Build course assignments and research baselines around PPO, entity transformers, legal-action masking, seeded evaluation, and game replay.
- Dependencies: The released code and game data must be legally redistributable and maintained across patches. Results may not transfer directly to other games because the study targets one patch and one title.
- Use
- Decision-support tools for human players — Consumer software / gaming
- Develop an advisory assistant that displays recommended purchases, positioning, combat targets, upgrade timing, and Hero Power use during a turn.
- Use
TavernGymfor fast “what-if” analysis, such as comparing alternative purchases or positioning choices through thousands of simulated combats. - A safer product form would be a post-game analyst or opt-in training coach rather than an autonomous ladder player.
- Dependencies: The tool must comply with the game publisher’s terms of service, plugin rules, anti-cheating policies, and limits on automation. Simulator fidelity must be revalidated after every content update.
- Automated game testing and regression detection — Game development / quality assurance
- Apply the engine’s seeded randomness, invariant checking, fuzzing, exact save/restore, and replay comparison to test new cards, interactions, combat rules, and client updates.
- A workflow could generate legal action sequences, replay them across engine versions, and flag changes in state transitions, damage, offers, or card effects.
- The reality loop can be adapted to compare telemetry from production games with predictions from a test simulator.
- Dependencies: Access to authoritative game data and sufficiently detailed telemetry is required. Automated tests cannot resolve mechanics that are ambiguous or hidden from available logs.
- Research-agent orchestration for software engineering — Software / enterprise R&D
- Replicate AutoTavern’s division of labor with specialized agents for environment construction, training, evaluation, deployment, and monitoring.
- Use a typed, versioned research memory containing findings, corrections, experiment metadata, unresolved questions, and persistent lessons.
- Apply gates analogous to:
- build and test validation;
- model–environment compatibility;
- same-version comparisons;
- evaluation on unseen seeds or held-out data;
- production or field validation.
- This could support autonomous experimentation in simulation, recommender systems, robotics, or infrastructure optimization.
- Dependencies: Human oversight remains necessary for ambiguous requirements, safety constraints, resource allocation, and interpretation of real-world failures. LLM-generated code and conclusions still require independent review.
- Reproducible machine-learning experimentation — Academia / industrial ML
- Adopt the paper’s practice of tying each model to an environment or data version through hashes and refusing incompatible checkpoints.
- Maintain immutable findings and record corrections as new entries rather than overwriting earlier conclusions.
- Register experiments, seeds, resource budgets, successors, and selection criteria to reduce winner’s curse, leakage, and retrospective cherry-picking.
- Dependencies: Teams need disciplined experiment tracking and sufficient compute for repeated evaluation. These controls improve reliability but do not eliminate hidden confounding or measurement error.
- Fast simulation for planning and lookahead — Robotics, logistics, and operations research
- Reuse the engine design principles—cheap serializable states, deterministic seeds, batched simulation, legal-action masks, and exact restoration—for domains such as warehouse scheduling, fleet dispatch, inventory control, and robot task planning.
- A policy can evaluate candidate actions in a simulator while a separate controller enforces legality and safety.
- Dependencies: The simulated environment must accurately reflect operational constraints. Real-world validation is essential because optimizing an inaccurate simulator can produce the same proxy-drift failure observed in the paper.
- Real-time policy inference — Edge AI / interactive systems
- The contrast between TavernAgent’s approximately
0.03 sdecisions and slower general-purpose LLMs supports using compact specialized policies for latency-critical actions. - Potential products include game agents, interactive tutoring policies, adaptive interfaces, and control systems where a LLM performs offline research but a smaller policy executes decisions.
- Dependencies: The action space must be sufficiently structured, legal actions must be known, and the policy must be monitored for distribution shift.
- The contrast between TavernAgent’s approximately
- Benchmarking tool use in LLMs — Academia / model evaluation
- Use TavernBench-style tasks to test whether an LLM can use an external simulator or planning tool, distinguishing rule recall from effective sequential decision-making.
- Evaluate both accuracy and deadline-constrained performance, since a correct answer delivered too late may be unusable.
- Dependencies: Benchmark prompts, labels, and simulator versions must remain hidden or carefully controlled to prevent contamination. Scores are domain-specific and should not be treated as general intelligence measures.
- Policy and governance guidance for autonomous AI experiments — Public policy / research administration
- Use the paper as a practical example of why autonomous research systems need provenance, approval gates, audit logs, held-out tests, and deployment feedback.
- Organizations can require that agent-produced claims be linked to code, data, configuration, evaluation seeds, and evidence of external validation before entering a shared knowledge base.
- Dependencies: Governance must define who is accountable for agent actions, how incidents are reported, and when human authorization is mandatory.
Long-Term Applications
These applications require further research, broader validation, legal agreements, or substantial engineering beyond the study’s demonstrated scope.
- General-purpose self-improving research laboratories — Academia / industrial R&D
- Extend AutoTavern from a game-specific system to domains such as drug discovery, materials science, chip design, energy optimization, and climate modelling.
- The agents could iteratively improve simulators, candidate solutions, evaluation suites, and research procedures while periodically comparing predictions with laboratory or field measurements.
- Dependencies: Domain simulators must be sufficiently accurate; experiments may be expensive or slow; safety and regulatory review are required. In high-stakes domains, a game-style autonomous deployment loop is not adequate by itself.
- Robotics policies trained in simulation and corrected from field data — Robotics
- Build reality-anchored loops in which simulation-trained policies are tested on robots, discrepancies are replayed in simulation, and updated policies are evaluated before redeployment.
- Typed memory and verification gates could track hardware configurations, sensor encodings, controller versions, and safety constraints.
- Dependencies: Sim-to-real transfer, hardware wear, sensor noise, physical safety, and rare failure modes are much more consequential than in a game. Deployment should require sandboxing, human supervision, and formal safety checks.
- Adaptive industrial control and energy management — Energy / manufacturing
- Apply fast simulators and calibrated opponent or demand models to optimize battery storage, grid balancing, production scheduling, or building energy use under uncertainty.
- Real-time telemetry could continuously recalibrate demand models, while unseen scenarios and safety constraints gate policy updates.
- Dependencies: Reliable sensor data, stable interfaces, cybersecurity, and hard operational constraints are essential. Optimizing average performance must not compromise grid reliability, equipment safety, or service continuity.
- Autonomous financial decision systems — Finance
- The framework could inform portfolio execution, market-making simulation, fraud-response planning, or stress testing by combining scenario generation, versioned experiments, and out-of-sample evaluation.
- Reality-loop validation could compare simulated market behavior with observed execution and adverse events.
- Dependencies: Markets are non-stationary, adversarial, and strongly affected by an agent’s own actions. Historical or simulated results can be misleading; deployment would require regulatory compliance, risk limits, explainability, and independent model validation.
- Personalized education and tutoring policies — Education
- A simulator could model learner states, misconceptions, engagement, and intervention outcomes, allowing an agent to select exercises or explanations under a time and attention budget.
- The paper’s distinction between knowing rules and making effective sequential decisions suggests evaluating tutors by long-term learning outcomes rather than answer quality alone.
- Dependencies: Student models are uncertain and ethically sensitive. Real-world trials, privacy safeguards, teacher oversight, and fairness analysis are required; synthetic learners cannot substitute for educational evidence.
- Clinical decision-support systems — Healthcare
- A carefully constrained version could simulate treatment pathways, compare possible interventions, and use structured verification gates before recommending actions.
- The reality-loop principle could support post-deployment monitoring for discrepancies between predicted and observed outcomes.
- Dependencies: This is a high-risk extension. Clinical validation, prospective trials, medical-device regulation, privacy protection, interpretability, and clinician responsibility are mandatory. The paper does not demonstrate medical validity and provides no basis for autonomous treatment.
- Continually updated agents for changing environments — Software / online services
- The patch-overlay model and rule hashes could inspire agents that remain operational as APIs, policies, product catalogs, or business rules change.
- A deployment controller could reject models trained on incompatible schemas and trigger retraining when live observations diverge from simulation.
- Dependencies: Continuous updates can introduce silent regressions, feedback loops, or specification drift. Organizations need rollback mechanisms, compatibility testing, staged deployment, and explicit change approval.
- Autonomous multiplayer or competitive game agents — Gaming / entertainment
- A fully autonomous Battlegrounds agent could become a commercial coaching product, tournament participant, accessibility tool, or adaptive non-player opponent.
- The same approach could extend to other games with hidden information, stochastic rewards, and changing content.
- Dependencies: Publisher authorization, anti-cheat safeguards, fair-play rules, privacy protections, and transparent disclosure are necessary. Performance on one patch and one ladder does not establish robust superiority across patches, player populations, or games.
- Formalized “research-process learning” systems — AI safety / meta-research
- The paper’s lessons-to-gates mechanism could evolve into systems that automatically identify recurring methodological errors and add new checks to future experiments.
- Such systems could maintain a machine-readable audit trail of why a conclusion changed, which assumptions failed, and which tests were added.
- Dependencies: Automatically generated gates may encode incorrect assumptions or become overly conservative. Human auditors must review process changes, especially when the system is allowed to influence its own evaluation criteria.
- Standardized reality-anchored evaluation infrastructure — Cross-sector policy and academia
- A future platform could provide reusable components for deterministic simulators, live-data replay, held-out evaluation, model–environment contracts, latency measurement, and deployment monitoring.
- This would help compare autonomous agents in robotics, finance, healthcare, and industrial control using both simulated and real-world evidence.
- Dependencies: Cross-domain standards for data access, safety, reproducibility, privacy, and responsible deployment must be established. Directly transferring the paper’s metrics or gates across sectors would require domain-specific adaptation.
Glossary
- Auto-battler: A multiplayer strategy game in which players build teams that fight automatically. “Blizzard's eight-player auto-battler”
- Auxiliary head: An additional neural-network output used to predict a related task during training. “a value head and an auxiliary placement head share the trunk”
- Calibration: Adjustment of a model or simulated opponents so that their behavior matches real-world observations. “recalibrated, turn by turn, to the opponents the agent actually met in live games”
- Checkpoint: A saved state of a model, typically including its learned parameters, that can be used for evaluation or further training. “from the same checkpoint and with the same budget”
- Closed loop: A system in which outputs or observations from deployment are fed back into later development and decision-making. “in a closed loop of training, research and live games”
- Contract gate: A verification condition ensuring that a model is used only with the environment or simulator version for which it was trained. “G2~contract: every model is tied to the simulator build it was trained on”
- Curriculum: An ordered training strategy that presents increasingly complex tasks or environments to a learning system. “A training agent designs recipes and curricula”
- Embeddings: Learned vector representations that encode the properties or meaning of inputs for a neural network. “a card is represented by an identity embedding”
- Entity transformer: A transformer architecture that represents individual game entities as tokens and processes their relationships. “TavernAgent is an entity transformer”
- Evaluation gate: A procedural or computational checkpoint that a candidate system must pass before being accepted. “each passing an evaluation gate”
- Fuzzing: Automated testing that generates many varied or random inputs to expose implementation errors and invariant violations. “unit tests, fuzzing with invariant checks after every action”
- Game horizon: The number of sequential decisions or time steps over which an agent acts before an outcome is determined. “a horizon of hundreds of decisions with a reward only at the end”
- Hidden information: Information relevant to the game that is not observable by the agent. “hidden information about seven opponents”
- Input encoding: The representation or formatting used to convert an environment state into a model’s input. “fixes of rules, input encodings and opponent models”
- Invariant: A property that should remain true throughout execution, regardless of the actions taken. “fuzzing plays random legal actions and checks state invariants after every action”
- KL anchor: A regularization mechanism that constrains a new policy from diverging too far from an earlier policy using Kullback–Leibler divergence. “starts from the previous stage under a KL anchor”
- Legal-action mask: A representation that identifies which actions are valid in a given state and prevents invalid actions from being selected. “The RL interface exposes 245 discrete actions with an exact legal mask”
- Lookahead: Planning that evaluates the consequences of possible actions by simulating future states. “one-step lookahead”
- Monte Carlo tree search: A search algorithm that explores possible future actions through repeated simulations and tree expansion. “built a Monte Carlo tree search assistant”
- Opponent model: A computational representation of how other players or agents behave. “an opponent agent builds human-like opponents from human statistics and live games”
- Partially observable stochastic game: A multi-agent sequential decision problem with random transitions and incomplete observation of the full state. “We model a game as a partially observable stochastic game”
- Policy: A function or model that maps observed states to actions or action probabilities. “the policy decides every operation”
- Policy gradient: A reinforcement-learning approach that directly optimizes the parameters of a policy according to expected returns. “It is trained with PPO”
- Pointer head: A neural-network output module that assigns scores to selectable items or actions, often by pointing to elements in an input sequence. “a pointer head produces the 245 masked action logits”
- Proxy drift: The divergence between improvements on a surrogate evaluation objective and improvements in real-world performance. “Proxy drift: improves while does not”
- Proximal Policy Optimization (PPO): A reinforcement-learning algorithm that updates a policy while restricting excessively large changes between successive policies. “We use a standard learner, PPO”
- Reality loop: An iterative process that compares simulated behavior with real-world behavior and uses discrepancies to improve the simulator or agent. “AutoTavern answers the first with a reality loop”
- Reinforcement learning: Machine learning in which an agent learns actions through interaction with an environment and feedback from rewards. “The RL interface exposes 245 discrete actions”
- Reward shaping: Modification or structuring of learning rewards to encourage useful intermediate behavior. “with a terminal placement utility”
- Self-play: A training method in which an agent learns by competing against copies or versions of itself. “Rather than self-play, the learner faces seven library seats”
- Selection bias: Systematic distortion caused by selecting observations or results in a non-representative way. “a reading that reflects noise, a leak or selection is recorded as a result”
- Stochastic: Involving randomness or probabilistic variation. “The game combines stochastic shops and battles”
- Surrogate objective: An approximate objective optimized in place of a difficult or expensive real-world objective. “Inside the loop the agents can only improve a proxy”
- Terminal utility: A reward assigned at the end of an episode or complete sequence of actions. “with a terminal placement utility”
- Transformer: A neural-network architecture that uses attention mechanisms to process relationships among input elements. “with a transformer”
- Typed research memory: A shared information store in which entries conform to predefined data types or schemas. “Agents never talk directly; they read and write versioned, typed stores”
- Unseen seeds: Random-number-generator initializations withheld from model selection and used for evaluation on new stochastic realizations. “re-check on seeds it was not selected on”
- Value head: A neural-network output that estimates the expected future reward or value of a state. “a pointer head scores the 245 masked actions; a value head and an auxiliary placement head share the trunk”
- Winner’s curse: The tendency for the best result selected from many trials to overestimate its true performance. “Winner's curse. The best of many snapshots overstated its gain”
- Zero-shot: Performance on a task without task-specific training or adaptation. “the system the LLM agents built is the strongest player”






