Specula: Scaling formal specifications for autonomous model checking of system code

Qian Cheng, Saad Mohammad Rafid Pial, Ruize Tang, Yiming Su, Emilie Ma +4 more
7/28/2026
1 citation
cs.SEcs.AIcs.DC

Official code: specula-org/Specula (608 stars, Python, Apache-2.0, last commit 2026-10-09).

Abstract

Specula is a push-button agentic system that generates high-quality formal specifications for large, complex system code and uses the specifications for highly effective model checking and bug finding. Specula employs large language model (LLM) based coding agents to autonomously develop TLA+ specifications, including invariants that describe correctness properties of the target system and formal models that describe the system implementation with the right level of abstractions.

Show full abstract

Specula is fully autonomous and thus eliminates the barrier of applying formal methods to real-world system code (as in traditional human-centric approaches). Meanwhile, Specula addresses limitations of LLM-driven techniques like reward hacking and hallucinations through self-evolving loops that iteratively improve specification quality by enabling the agents to deepen their understanding of system code and its behaviors. We have used Specula to check 48 open-source system projects; Specula found 249 bugs including many deep bugs that are hard to find by existing approaches. Specula has been used by several companies and is maintained at https://github.com/specula-org/Specula.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Specula: An agentic tool for finding deep bugs in system code using TLA+

60869Python, TLAJun 15, 20251 months agoApache-2.0

Similar Papers

Cite this paper

@article{cheng2026specula,
  title  = {Specula: Scaling formal specifications for autonomous model checking of system code},
  author = {Qian Cheng and Saad Mohammad Rafid Pial and Ruize Tang and Yiming Su and Emilie Ma and Finn Hackett and Ivan Beschastnikh and Yu Huang and Tianyin Xu},
  year   = {2026},
  eprint = {2607.25333},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.25333v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.25333.svg)](https://codeofpaper.com/paper/2607.25333)

Discussion