Dora and Dave: Learning to Synthesize Verified Broadcast Algorithms

Diogo Vaz, David R. Matos, Miguel L. Pardal, Miguel CorreiaarXiv 2026

TL;DR

Designing fault-tolerant distributed algorithms by hand is notoriously brutal—tweak one failure assumption and your entire protocol can break. This paper introduces Dora and Dave, a pair of agents that team up to automatically invent and formally verify efficient broadcast algorithms from scratch, without needing a massive pretrained neural network. Within 24 hours, they discover provably correct protocols that match—and occasionally outperform—classic human-designed textbook algorithms.

What Problem Does This Paper Address?

Getting a cluster of independent computers to agree on a shared reality when machines crash or drop messages is the bedrock of distributed computing. We rely on foundational building blocks called Broadcast protocols to make sure messages reach everyone reliably. However, crafting these protocols is painstaking work; shifting from simple crash failures to omission failures (where nodes selectively drop messages) often forces designers back to the drawing board.

Researchers have tried automating algorithm synthesis, but the combinatorial search space quickly explodes into tens of millions of candidate programs. Brute-force and constraint-solving methods usually choke unless restricted to tiny, toy systems or half-finished code templates. Recent reinforcement learning approaches showed promise, but remained narrow in scope and struggled with sample efficiency. The authors ask: Can we build a general, sample-efficient system that learns to synthesize both correct and communication-efficient distributed protocols from scratch?

Methods

Instead of relying on an offline, pretrained Large Language Model (which can hallucinate unconstrained, broken code), the authors frame algorithm design as a single-player game called BGame, solved entirely online during test-time.

The "board" is a three-event protocol template (Broadcast, Receive, and Timeout), and the "moves" are grammar-constrained if-condition-do-instruction rules (like relaying messages to neighbors once a threshold of identical messages arrives). Two specialized agents play this game in a tight feedback loop:

System architecture showing how Dora's parallel generators and central learner interact with Dave's formal verifiers.
  • Dora (The Generator): Uses Monte Carlo Tree Search (MCTS)—the classic tree-exploration engine behind AlphaGo—to incrementally build candidate algorithms, pruned by 12 domain heuristics. Crucially, Dora uses root parallelization: multiple independent Generators explore the tree in parallel while periodically syncing their experience with a central Learner.
  • Dave (The Verifier): Takes Dora's completed candidates and puts them through a formal mathematical wringer using the SPIN model checker (testing properties written in Linear Temporal Logic, such as Agreement and Validity).
  • Flexible Verifiable Rewards: Rather than handing Dora a harsh, binary pass/fail grade, Dave provides a nuanced reward. Incorrect algorithms are penalized proportionally to how many formal properties they violate, nudging MCTS toward "less wrong" territory. Once an algorithm is 100% correct, the reward shifts to penalizing communication bloat (messages sent, thresholds waited on, and message types used), pushing Dora to optimize for speed and efficiency.
How Dora uses four-stage Monte Carlo Tree Search to build and score candidate algorithms.

Datasets

Not discussed in the paper. Because Dora uses online test-time search rather than offline training, there are no training datasets. Instead, the system is evaluated directly on four classic distributed computing problems across synchronous and asynchronous timing models:

  • Asynchronous Crash-tolerant Reliable Broadcast (RB)
  • Asynchronous Crash-tolerant Uniform Reliable Broadcast (URB)
  • Synchronous Crash-tolerant Terminating Reliable Broadcast (TRB)
  • Synchronous Omission-tolerant Terminating Reliable Broadcast (TRB)

Key Insights and Ideas

  • Skipping human abstractions uncovers cleaner protocols: Human engineers love modularity—to solve Terminating Reliable Broadcast (TRB), textbooks typically bolt a Best-Effort Broadcast onto a heavy Consensus module. Dora doesn't care about modular abstractions; it just optimizes raw message costs. As a result, it discovered a sleek, flooding-based TRB strategy that cuts worst-case communication complexity compared to standard modular designs.
  • Graded failure signals matter: Moving from a static -1 failure penalty to a flexible penalty (scaled by the number of broken properties) generated 11% more correct algorithms while exploring 5% fewer states. Knowing how close you are to a working protocol makes tree search noticeably sharper.
  • Test-time search beats pure RL here: Over 90% of candidate algorithms in this space are flat-out wrong, even after applying domain heuristics. Combining strict grammar constraints with parallel MCTS and formal model checking avoids neural unpredictability while navigating massive spaces ($>10^7$ states) while inspecting less than 1% of them.

Key Results

  • Outperforming prior ML synthesis: Under the same 1-hour time budget and state space, Dora discovers 3x to 18x more correct algorithms (for 1 to 12 parallel generators) than RBLearner (the prior Q-learning state-of-the-art), while exploring only ~3x more states and boosting top-3 algorithm efficiency rewards by up to 52%.
  • Beating human worst-case bounds: Within 24 hours on a 144-vCPU cluster, Dora synthesized optimal RB and URB protocols, plus synchronous TRB protocols that improve upon classic human baselines. For omission-tolerant TRB (configured at optimal resilience $F = N - 1$), Dora's algorithm drops worst-case total messages sent from $O(N^3)$ to $O(N^2)$, and messages needed to deliver from $O(N)$ to $O(1)$.
  • Near-linear parallel scaling: Scaling Dora from 1 to 12 Generators expanded unique states visited by ~9x (286 to >2,500) and unique algorithms generated by ~9.3x.

Limitations and Future Work

  • The Verification Bottleneck: Formal model checking is computationally hungry—88% of the authors' 144-vCPU cluster was dedicated solely to running SPIN, which still restricted verification to small, fixed node counts ($N \le 4$). The authors manually proved the general-$N$ correctness of their best discoveries in the appendix, and plan to integrate parametric verification (proving for all $N$ automatically) and fast ML classifiers to filter out bad candidates early.
  • Rigid Templates & Scope: Synthesis currently relies on a fixed three-event template, hand-crafted pruning heuristics, and benign faults (crashes and omissions). Future work aims to tackle malicious Byzantine failures, partially synchronous networks, harder problems like Consensus, and learned pruning to replace manual heuristics.

Summary updated

BibTeX
@misc{vaz2026dora,
  author = {Diogo Vaz and David R. Matos and Miguel L. Pardal and Miguel Correia},
  title = {{Dora and Dave: Learning to Synthesize Verified Broadcast Algorithms}},
  year = {2026},
  eprint = {2611.39410},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.39410},
}
Figure