Abstract
Provably correct distributed protocols, which are a critical component of modern distributed systems, are highly challenging to design and have often required decades of human effort. These protocols allow multiple agents to coordinate to come to a common agreement in an environment with uncertainty and failures. We formulate protocol design as a search problem over strategies in a game with imperfect information, and the desired correctness conditions are specified in Satisfiability Modulo Theories (SMT). However, standard methods for solving multi-agent games fail to learn correct protocols in this setting, even when the number of agents is small. We propose a learning framework, GGMS, which integrates a specialized variant of Monte Carlo Tree Search with a transformer-based action encoder, a global depth-first search to break out of local minima, and repeated feedback from a model checker. Protocols output by GGMS are verified correct via exhaustive model checking for all executions within the bounded setting. We further prove that, under mild assumptions, the search process is complete: if a correct protocol exists, GGMS will eventually find it. In experiments, we show that GGMS can learn correct protocols for larger settings than existing methods.
Introduction: The Challenge of Distributed Protocol Design
Distributed protocols, such as Paxos or Two-Phase Commit, are the backbone of modern cloud infrastructure, ensuring that multiple machines can reach a consensus even in the face of hardware failures or network instability. Designing these protocols is notoriously difficult because they must be mathematically guaranteed to work under every possible failure scenario. A protocol that fails even 0.1% of the time is unacceptable for critical systems like financial ledgers or distributed databases.
Traditional AI approaches, such as those used in AlphaGo, struggle in this domain. Reinforcement learning typically optimizes for expected rewards, whereas distributed protocols require strict worst-case correctness. Furthermore, standard Monte Carlo Tree Search (MCTS) faces a "superposition problem": when multiple valid protocol designs exist, the AI often attempts to merge them, resulting in a broken hybrid that fails verification. This research introduces GGMS, a framework designed to synthesize provably correct protocols from scratch without human-provided examples.
Methodology: Guided Global Monte Carlo Tree Search (GGMS)
The authors formulate protocol design as a two-player game with imperfect information. In this game, the "protocol player" selects state machine transitions to achieve agreement, while an "adversary" attempts to break the protocol by choosing initial states and triggering message drops or machine crashes.
To navigate this complex space, GGMS integrates several key components:
- MCTS with a Transformer Encoder: A transformer-based model explores the vast space of potential state machine transitions.
- Global Depth-First Search (DFS): To resolve the superposition problem, GGMS explicitly "freezes" ambiguous transitions. If the model is undecided between two valid paths, GGMS forces a commitment to one. If that path eventually fails, the system backtracks systematically.
- Guided Sampling (Curriculum Learning): Training begins on simpler scenarios (e.g., failures occurring only in late rounds) before gradually introducing more complex, early-round failures.
- Model Checking as a Hard Oracle: Candidate protocols are passed to an exhaustive verifier. Any failure found by the verifier generates a counterexample that is fed back into the training loop to refine the model.
Experimental Results
The GGMS framework was evaluated on bounded versions of two classic distributed problems: synchronous consensus and synchronous atomic commit. The system generates its own training data through self-play and model checking, requiring no human-labeled datasets.
As shown in the experimental data, GGMS achieved a 100% success rate in finding correct protocols across nearly all tested configurations, including complex settings with 4 processes and 3 failures. In contrast, standard MCTS and MCTS+DFS baselines often failed entirely on harder tasks. Notably, GGMS independently rediscovered the classic FloodSet algorithm for consensus and discovered a novel, provably correct protocol for synchronous atomic commit—a domain where well-known human-designed solutions are less prevalent.
Discussion and Future Work
The success of GGMS demonstrates that zero-knowledge synthesis of distributed protocols is possible. By identifying the "superposition problem" as a primary bottleneck and introducing a DFS-enhanced search, the authors have created a system that is mathematically guaranteed to find a correct protocol if one exists within the bounded setting.
However, limitations remain. The current approach assumes synchronous networks and broadcast-only communication. Furthermore, the model checker verifies correctness for a fixed number of processes rather than providing a general proof for any $N$. Future research aims to integrate GGMS with Large Language Models (LLMs). While LLMs are adept at proposing general code structures, they lack rigorous verification capabilities. Fusing the generative power of LLMs with the hard verification and systematic exploration of GGMS could enable the automated design of more complex, real-world distributed systems.
Summary updated