SysMoBench: Evaluating AI on Formally Modeling Complex Real-World Systems

Qian Cheng, Ruize Tang, Emilie Ma, Finn Hackett, Peiyang He, Yiming Su, Ivan Beschastnikh, Yu Huang, Xiaoxing Ma, Tianyin Xu · OpenReview

Abstract

Formal models are essential to specifying large, complex computer systems and verifying their correctness, but are notoriously expensive to write and maintain. Recent advances in generative AI show promise in generating certain forms of specifications. However, existing work mostly targets small code, not complete systems. It is unclear whether AI can deal with realistic system artifacts, as this requires abstracting their complex behavioral properties into formal models. We present SysMoBench, a benchmark that evaluates AI's ability to formally model large, complex systems. We focus on concurrent and distributed systems, which are keystones of today's critical computing infrastructures, encompassing operating systems and cloud infrastructure. We use TLA+, the de facto specification language for concurrent and distributed systems, though the benchmark can be extended to other specification languages. We address the primary challenge of evaluating AI-generated models by automating metrics like syntactic and runtime correctness, conformance to system code, and invariant correctness. SysMoBench currently includes diverse system artifacts: the Raft implementation of Etcd and Redis, the Spinlock and Mutex in Asterinas OS, etc. SysMoBench enables us to understand the capabilities and limitations of today's LLMs and agents, putting tools in this area on a firm footing and opening up promising new research directions.

Introduction: The "Black Art" of Formal Modeling

Formal modeling—the process of writing mathematical specifications to describe system behavior—is often regarded as a "black art." While essential for verifying the correctness of critical infrastructure like cloud databases and operating systems, it is notoriously expensive and requires rare expertise.

Generative AI has demonstrated potential in writing small code snippets or function-level specifications. However, modeling a complete, real-world system represents a significantly higher bar. It requires an AI to not just translate code, but to abstract complex behaviors, reason about concurrency, and manage distributed states. Existing benchmarks often fall short by focusing on logic puzzles or small algorithms rather than the messy, low-level reality of production system code.

The SysMoBench Framework

To address these challenges, we introduce SysMoBench, a framework designed to automate the evaluation of AI-generated formal models, primarily in TLA+. To move beyond subjective "vibe-based" evaluations, SysMoBench employs four automated metrics:

  1. Syntax Correctness: Utilizing the SANY analyzer to verify if the model adheres to TLA+ grammar.
  2. Runtime Correctness: Using the TLC model checker to ensure the model executes without logical self-contradictions.
  3. Conformance to System Implementation: A novel approach using LLM-assisted mapping to verify if the model’s state transitions match execution traces from the actual system code.
  4. Invariant Correctness: Checking if the generated model satisfies "ground truth" safety and liveness properties, such as ensuring only one process holds a lock at a time.
The SysMoBench evaluation pipeline, detailing the automated metrics for syntax, runtime, conformance, and invariant correctness.

Benchmarking Real-World Systems

SysMoBench includes 11 diverse system artifacts drawn from prominent real-world projects, spanning distributed and concurrent domains. These artifacts provide a rigorous testbed for AI agents, requiring them to handle varying levels of complexity and source languages.

Overview of the 11 system artifacts included in SysMoBench, showing their types, source languages, and lines of code.

The dataset includes:

  • Distributed Systems: Raft implementations from Etcd and Redis, and the Fast Leader Election (FLE) from Apache ZooKeeper.
  • Concurrent Systems: Spinlock, Mutex, and Ringbuffer implementations from the Asterinas OS (a Rust-based OS).
  • Machine-Generated Systems: Artifacts synthesized by the PGo compiler to test how AI handles code lacking human-centric semantic clues.

Key Insights and Results

Our evaluation of state-of-the-art models, including Claude-Sonnet-4 and GPT-5, revealed several critical insights into the current state of AI-driven formal modeling:

Abstraction as a Bottleneck

AI is relatively proficient at "transliterating" code but struggles significantly with abstraction. For complex systems like Raft, LLMs often become bogged down in low-level implementation details (e.g., logging or debugging utilities) and lose sight of the core protocol logic. This is reflected in the performance drop on complex tasks; while Claude-Sonnet-4 achieved 100% on the simple Asterinas Spinlock, its conformance score for the Etcd Raft implementation was a mere 7.69% for the basic agent.

Translation vs. Intuition

We found that a Code Translation Agent (which follows a statement-by-statement translation approach) significantly outperformed a Basic Modeling Agent (which generates models directly). By rigorously following the control flow of the source code, the AI was less likely to "hallucinate" incorrect protocol logic. Conversely, the Trace Learning Agent—which attempted to build models solely from execution logs—failed almost entirely on complex systems, suggesting that code context is currently indispensable.

Liveness and Syntax Challenges

AI models were generally better at satisfying safety properties (what shouldn't happen) than liveness properties (what must eventually happen). Liveness requires complex temporal reasoning that remains a weak spot for current architectures. Furthermore, a "Syntax Wall" persists; even top-tier models frequently mix TLA+ with Python or C syntax.

Conclusion and Future Directions

While fully autonomous modeling of complex systems remains out of reach, AI-generated models have already shown practical utility, such as successfully reproducing five known bugs in Redis and Etcd. This suggests that AI can serve as a powerful "co-pilot" for human formal methods experts.

Future research will focus on improving agent designs to better handle abstraction, addressing token limits for large execution traces, and exploring ways to measure the "maintainability" of AI-generated formal models. SysMoBench provides the necessary foundation to track progress in this critical intersection of AI and formal verification.

Summary updated

BibTeX
@misc{cheng2025sysmobench,
  author = {Qian Cheng and Ruize Tang and Emilie Ma and Finn Hackett and Peiyang He and Yiming Su and Ivan Beschastnikh and Yu Huang and Xiaoxing Ma and Tianyin Xu},
  title = {{SysMoBench: Evaluating AI on Formally Modeling Complex Real-World Systems}},
  year = {2025},
  eprint = {2509.23130},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23130},
}

Loading related content...

Figure