Automating TLA+ Model Synthesis with Large Language Models and Formal Verification Pipelines (WIP)

Read full text Summarise with VIRAT
Authors: Brian Ortiz, Mohammed Abuhamad, TaiNing Wang, George K. Thiruvathukal, Konstantin Läufer
Cited by: 0

Summary

No summary yet. VIRAT can read this paper and write a plain-language summary of its aim, methods, key findings and limitations.

Summarise with VIRAT Free to try with your Science Catalogs account.

Abstract

FormaLLM is a research initiative focused on integrating Large Language Models (LLMs) with the TLA+ formal verification toolchain to automate the synthesis and checking of formal models. Formal methods like TLA+ are essential for ensuring the reliability of concurrent and distributed systems, yet they remain difficult for many practitioners to learn and apply. This work aims to bridge that gap by enabling the automated generation of TLA+ specifications from natural language prompts, effectively lowering the barrier to entry for formal verification in AI-assisted software development.Dataset SpecificationsThe repository includes a comprehensive benchmark dataset constructed from the official open-source TLA+ examples repository. This dataset is designed to evaluate and train LLMs on their ability to produce syntactically and semantically correct formal models.297 unique TLA+ model specifications.149 unique TLA+ model configurations.Approximately 49,700 lines of TLA+ code.Structured JSON Manifests: A custom Python pipeline extracts, cleans, and organizes these components—including .tla (specifications), .cfg (configurations), and .txt (extracted comments)—into a structured format suitable for prompt-target generation.Methodology and Automation PipelineThe project utilizes a custom evaluation framework to assess LLMs (such as StarCoder, CodeLlama, and DeepSeek-Coder) through the following workflow:Input: The system accepts a natural language specification as a prompt.Generation: An LLM generates a TLA+ specification file (.tla).Syntactic Validation: The generated code is analyzed by SANY, the TLA+ syntactic analyzer, to ensure the code is well-formed.Semantic Verification: If syntactically valid, the model is processed by TLC, the TLA+ model checker, which verifies the logic and behavior against the intended properties.Logging: Success rates and specific error logs are captured to facilitate model comparison and fine-tuning.Evaluation FrameworkThe evaluation setup is inspired by HumanEval-X, featuring expert-verified outputs and structured prompt-target pairs. Research focuses on both zero-shot (prompt-only) and few-shot (prompt plus examples) model synthesis. Key metrics include the Syntax Validity Rate (via SANY) and the Semantic Verification Success Rate (via TLC).Future DirectionsOngoing and planned developments for this project include:Supervised Fine-Tuning: Refining open-source code LLMs specifically for TLA+ generation.Multilingual Support: Expanding the framework to include other formal systems such as Z3 and Alloy for SMT-based verification.CI/CD Integration: Developing a modular framework that triggers automated TLA+ generation and validation during code commits or merge requests on platforms like GitHub.Data Usage Note: Users of this dataset should refer to the included JSON manifests for structured access to the TLA+ components and natural language pairings. One section of the raw research notes regarding Twitter hashtag analysis is unrelated to this formal methods dataset and should be disregarded for the purposes of TLA+ research.Loyola University Chicago AI4FM

Fields of Study & Subjects

Formal Methods in Verification Logic programming and type systems Software Engineering Research

Publication details

Journal / source
Figshare
Publication date
31 March 2026
Language
EN