Skip to content

Repository files navigation

tlaps-bench

Formally Proving the Correctness of Complex Protocols and Systems
using TLA+ Proof System (TLAPS)

CI License: MIT

Check out TLAPS-Bench Leaderboard.

Our vision. To prove the correctness of any given critical protocols and systems using TLA+ Proof System (TLAPS)

TLAPS-Bench evaluates whether AI agents can formally prove (or disprove) the correctness of complex protocols and systems using TLAPS.

Each problem in TLAPS-Bench is a TLA+ specification (including the formal model and the invariants that specify correctness properties). AI agents are asked to prove that the formal model satisfies the invariants. We consider each task in TLAPS-Bench to formally prove one invariant of a given specification.

TLAS-Bench includes a sandboxed runtime for AI agents to faithfully prove the given specification without cheating. The runtime is equipped with extensive checks to prevent reward hacking. We have used the runtime to prove many specifications, such as 2PC, Paxos, TCP state machine, Byzantine Paxos, Byzantine broadcast, etc.

Historically, we had two types of problems: Proof-Completion and Proof-from-Scratch. We retired Proof-Completion as completing a well-structured proof is no longer a challenge for frontier AI. However, Proof-from-Scratch tasks, which AI has to invent the entire proof structure, are still nontrivial and take long-horizon efforts.

Current Problem Set

We currently focus on a few hard problems (due to token shortage).

Problems Type # Spec # Invariants
FLASH Cache coherence Protocol 1 15
ZooKeeper protocol Protocol 1 9
Cahill’s serializable snapshot isolation Protocol 1 1
Ivy TLB System 1 2
OpenAddressing System 1 5
etcd Raft System 1 8
HashiCorp Raft System 1 6
ZooKeeper implementation System 1 9
MongoDB distributed transactions System 1 1
Total 9 56

For more problems, check out the full problem set.

Retired Problems (Proofs Available)

We have retired the following problems from TLAP-Bench, because they are well proved (or disproved) by frontier AI models and thus are no longer capable of measuring the frontier. The problems can all be found in the repository, but we no longer run them for our leaderboard.

If you need the TLA+ proofs of these problems, contact us and we can share them.

Problems Type # Spec # Invariants
TCP state machine Protocol 1 3
Ivy protocols (alternating bit, reliable broadcast,
split queue, ticket, nested ticket)
Protocol 5 10
The German cache coherence protocols Protocol 2 7
Replicated counter convergence (CRDT) Protocol 1 3
SlateDB WAL (s3-wal-collection) Protocol 1 4
OSWALD WAL (s3-wal-collection) Protocol 1 3
Byzantine Paxos (Consensus, VoteProof,
PConProof, BPConProof)
Protocol 4 11
Byzantine broadcast Protocol 1 5
Bosco asynchronous Byzantine consensus Protocol 1 5
Sailfish BFT consensus Protocol 1 3
Nano cryptocurrency transaction Protocol 1 1
Misra graph reachability algorithm Protocol 2 2
Spanning tree (abstract model) Protocol 1 1
Spanning tree (message passing) Protocol 1 1
Dijkstra-Scholten termination detection Protocol 1 3
Dijkstra ring termination detection (EWD840_proof, SyncTerminationDetection_proof) Protocol 3 6
Termination detection Protocol 3 7
Kumar termination detection Protocol 1 1
Paxos (voting, consensus, commit, etc) Protocol 12 27
Two-phase commit (TwoPhase_proof, transaction commit) Protocol 3 4
Gray-Lamport transaction commit Protocol 1 1
B-tree System 1 5

Running TLAPS-Bench

Requirements

  • uv
  • Docker.
  • Windows users can run the benchmark using WSL2.

Recommended hardware

Proof checking can use substantial memory, especially for Isabelle-heavy tasks. A few of these tasks can use significantly more than 64 GB of RAM for one job.

We recommend the following hardware configurations

Profile vCPUs per job RAM per job Guidance
Recommended 8–12 96 GB Provides better memory headroom.
Lower-headroom 8–12 64 GB A starting point; some Isabelle-heavy tasks
may require more.

On a wimpy machine, start with --jobs 1. Increase the value after you monitor peak memory use.

Run the benchmark

git clone https://github.com/specula-org/tlaps-bench.git  
cd tlaps-bench  
export OPENAI_API_KEY=sk-...        # This step is optional: Codex is the default backend if no OpenAI key is provided.  
uv run tlaps-bench run --mode proof-from-scratch --filter Euclid/Euclid-Hyperbook/GCD.tla --jobs 1 # A small proof-from-scratch example

The above command builds a sandbox Docker image, with tlapm, SANY, and the proof checker bundled in and runs the task inside it (a firewall allows only the LLM API hosts and the benchmarks are mounted read-only). Later runs reuse this image. Results are stored in results/<mode>/<backend>/<timestamp>/.

uv run tlaps-bench run --mode proof-from-scratch --jobs 4  

How to set up an agent (--backend and --model) and its credentials, the full CLI reference, and native (--no-container) setup are described in our usage guide.

Acknowledgement

We are grateful to the generous support from

  • TLA+ Foundation
  • OpenAI
  • Anthropic (AI for Science Program)
  • Qingrong Chen

License

About

Formally Proving Complex Protocols and Systems using TLA+ Proof System (TLAPS)

Resources

Stars

32 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages