Abstract
Algorithm design and formal verification have traditionally been labor-intensive human endeavors, often requiring decades of incremental progress. This paper introduces LegoNE, a framework that enables Large Language Models (LLMs) to design and formally prove the performance of general-purpose algorithms. By bridging creative design with automated formal verification, LegoNE allowed an LLM to rediscover a state-of-the-art game theory algorithm in hours—a task that took human researchers 15 years—and discover a novel three-player game algorithm that surpasses existing human designs.
Introduction
In computer science, the challenge of algorithm design is twofold: creating a solution and proving its universality across all possible inputs. While AI has excelled at solving specific problem instances (existential tasks), general algorithm design remains a "universal" task that requires both creativity and mathematical rigor.
The authors focus on computing $\epsilon$-approximate Nash Equilibria (ANE), a core problem in game theory. Finding approximate versions is essential for complex games, but proving the "approximation bound"—the maximum possible regret a player might have—usually requires pages of intricate, error-prone mathematical proofs. This "proof complexity" crisis has historically hindered theoretical progress for decades.
The LegoNE Framework
LegoNE facilitates a human-machine collaborative loop through three main components:
1. The LegoNE Language
The framework utilizes a specialized, Python-like symbolic language. Instead of writing low-level code, humans provide "building blocks" that represent high-level strategic concepts such as BestResponse or UniformMixing. This allows the LLM to operate at a conceptual level rather than a syntactic one.
2. The Automated Analyzer
The "secret sauce" of the framework is an analyzer that translates any algorithm written in LegoNE into a fixed-size constrained optimization problem. It achieves this through two principles:
- Instantiation: It reduces the infinite space of possible strategies to a finite set actually used by the algorithm.
- Forgetting: It "forgets" the complex underlying structure of payoff functions, treating them as simple symbolic variables while maintaining necessary logical constraints.
3. The Discovery Loop
A human acts as a "theoretical architect," designing the building blocks. An LLM (e.g., DeepSeek-R1) then acts as an "explorer," combining these blocks into new algorithms. The analyzer provides immediate, rigorous feedback on the algorithm's performance bound, turning "proving a theorem" into a task for a numerical solver like Mathematica.
Universal vs. Existential AI
Most AI breakthroughs are "existential"—finding a single solution to a specific problem (like a move in Chess). LegoNE targets "universal" problems, seeking general rules that hold for all cases. This shift moves the human role to that of a "theoretical architect," defining symbols and constraints while the AI explores the combinatorial space of assembly. By converting logical proofs into optimization problems, the authors turned a creative bottleneck into a computational one.
Key Results
The framework was validated against two decades of game theory literature with remarkable results:
- Two-Player Games: The LLM rediscovered the current state-of-the-art approximation bound in just two rounds of interaction. This specific bound took the human research community 15 years to reach (from 2007 to 2022).
- Three-Player Games: The LLM discovered a novel algorithm with a bound of $0.5 + \delta$, significantly beating the best human-designed bound of $0.6 + \delta$. The LLM achieved this by identifying an asymmetric structure that treats sub-problems differently, a "native" multi-player design that humans often overlook due to symmetry bias.
- Efficiency: The automated analyzer proved complex bounds in under 80 seconds, replacing dozens of pages of manual mathematical derivation.
Conclusion and Future Directions
LegoNE demonstrates that LLMs, when paired with the right symbolic tools and verification engines, can outpace human experts in theoretical domains. While domain expertise is still required to define the initial symbolic language, the framework suggests a future where AI handles the tedious aspects of formal verification. Future work may adapt this framework to other fields with "infinite" inputs, such as proving cryptographic security or ensuring stability in complex robotic control systems.
Summary updated