Large language models discover versatile game-playing algorithms automatically

Modular Discovery of General Game-Playing Algorithms with Large Language Models

Artificial IntelligenceComputer Science and Game TheoryMultiagent Systems

Summary

Playing many different kinds of games well with one program is hard because games need different tricks and decisions must be made quickly. The authors show that large language models, which can write and improve code, can create new game-playing methods from scratch without expert design. Their system evolves both general search strategies and game-specific hints using the game rules. These automatically discovered methods work well across hundreds of varied games, often beating existing well-known approaches and adapting even to new games or ones using neural networks.

What this means in practice

  • For game ai developers: Automatically generate adaptable algorithms for diverse game types without hand-crafting heuristics.
  • For simulation engineers: Create general-purpose procedural search methods to evaluate complex simulations with unknown rules.

Authors

Zun Li, John Schultz, Marc Lanctot, Daniel Hennes

Abstract

General Game Playing across arbitrary games from rules alone remains challenging due to differing algorithmic requirements across game classes and strict decision-time constraints. Rather than hand-designing search heuristics for specific domains, can we leverage Large Language Models (LLMs) to discover general game-playing algorithms? Because language models can propose and refactor structured code, they provide an expressive proposal engine for exploring the space of algorithmic designs. We introduce a multi-agent LLM meta-learning system to co-evolve game-agnostic procedural search mechanisms in C++ alongside domain heuristics synthesized directly from game rules. Controlling the compute budget, we benchmark the discovered mechanisms across more than 400 diverse environments, including OpenSpiel training and held-out games, procedural simulation engines, and games with deep neural policy-value representations trained via PPO. Evaluated via AlphaRank stationary distributions and Soft Condorcet Optimization (SCO) against 15 established MCTS baselines, the discovered search mechanisms consistently achieve top-tier ratings and pairwise ballot majorities over most baselines across independent evolutionary runs, generalizing to unseen human-designed and procedurally synthesized games and remaining competitive with baselines on frozen neural network representations.