FM-Agent: Scaling Formal Methods to Large Systems via LLM-Based Hoare-Style Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
also in 1 more
Abstract (arXiv)
LLM-assisted software development has become increasingly prevalent, and can generate large-scale systems, such as compilers. It becomes crucial to strengthen the correctness of the generated code. However, automated reasoning for large-scale systems remains challenging due to code complexity. Hoare logic offers an approach to decomposing a large system into smaller components and reasoning about them separately (i.e., compositional reasoning). However, existing works still struggle to scale, because Hoare logic requires writing formal specifications for each function, imposing a heavy human burden. The problem is exacerbated when code is generated by LLMs, as developers lack a deep understanding of each function's expected behavior. This paper presents FM-Agent, the first framework that realizes automated compositional reasoning for large-scale systems. Leveraging LLMs, FM-Agent introduces a top-down paradigm to automatically generate function-level specifications. Specifically, FM-Agent derives the specification of a function from how its callers expect the function to behave, so the generated specifications can reflect the developer's intent of a function even if the implementation is buggy. Developers' intent is usually expressed in natural language, while existing verifiers only support formulas. Therefore, FM-Agent generalizes Hoare-style inference to reason about functions against natural-language specifications. Finally, to confirm bug existence and explain bug causes, FM-Agent automatically generates test cases to trigger potential bugs. In our evaluation, FM-Agent successfully reasons about large-scale systems within 2 days, each of which has up to 143k LoC. These systems have already been tested by their developers, but FM-Agent still finds 522 newly discovered bugs. These bugs can cause serious consequences, including system crashes and incorrect execution results.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 8 of its 54 references that are in the map. First posted on arXiv 13 Apr 2026.
Builds on
8 of 54 references.
References · 8
- 2023Verus: Verifying Rust Programs using Linear Ghost Types (extended version)cited by 50
- 2024AutoVerus: Automated Proof Generation for Rust Codecited by 46
- 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
- 2024Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languagescited by 16
- 2026VibeTensor: System Software for Deep Learning, Fully Generated by AI Agentscited by 6
- 2026Bespoke OLAP: Synthesizing Workload-Specific One-size-fits-one Database Enginescited by 5
- 2023Grove: a Separation-Logic Library for Verifying Distributed Systems (Extended Version)cited by 4
- 2025Sharpen the Spec, Cut the Code: A Case for Generative File System with SYSSPECcited by 4
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026SMetric: Rethink LLM Scheduling for Serving Agents with Balanced Session-centric Schedulingcited by 2
- 2026Agentic Model Checkingcited by 0
- 2026VeriGraph: Towards Verifiable Data-Analytic Agentscited by 0
- 2026Code-Augur: Agentic Vulnerability Detection via Specification Inferencecited by 0
- 2026Specula: Scaling formal specifications for autonomous model checking of system codecited by 0
- 2026SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctnesscited by 0
- 2026SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness5 Sep 2026
- 2026Specula: Scaling formal specifications for autonomous model checking of system code28 Jul 2026
- 2026SMetric: Rethink LLM Scheduling for Serving Agents with Balanced Session-centric Scheduling9 Jul 2026
- 2026Code-Augur: Agentic Vulnerability Detection via Specification Inference17 Jun 2026
- 2026VeriGraph: Towards Verifiable Data-Analytic Agents15 Jun 2026
- 2026Agentic Model Checking20 May 2026
Similar, not cited
Close in wording, no citation either way
- 2026Agentic Separation Logic Specification Synthesis
- 2025Guided Code Generation with LLMs: A Multi-Agent Framework for Complex Code Tasks
- 2025LLM Agents for Generating Microservice-based Applications: how complex is your specification?
- 2025A Survey on Code Generation with LLM-based Agents
- 2025Designing LLM-based Multi-Agent Systems for Software Engineering Tasks: Quality Attributes, Design Patterns and Rationale
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Future
- 2024Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
- 2026Developing LLM-based Multi-Agent Systems in Software Engineering: A Mixed-Method Experience Report