Lean4Agent: Formal Modeling and Verification for Agent Workflow and Trajectory
Quick Answer
Lean4Agent introduces a formal framework using Lean4 for modeling and verifying agent workflows, enhancing performance by 11.94% on average compared to failing workflows.
Quick Take
Lean4Agent introduces a formal framework using Lean4 for modeling and verifying agent workflows, enhancing performance by 11.94% on average compared to failing workflows. Its extension, LeanEvolve, further boosts SWE performance by 7.47%, establishing a new paradigm in agent behavior verification.
Key Points
- Lean4Agent is the first framework using Lean4 for agent behavior verification.
- FormalAgentLib enables modeling of agent workflows' semantic consistency.
- Verification-passing workflows outperform failing ones by an average of 11.94%.
- LeanEvolve improves SWE performance by an average of 7.47%.
- The framework lays groundwork for formal methods in agent systems.
Article Content
From source RSS / original summaryarXiv:2606. 06523v1 Announce Type: new Abstract: Equipping Large Language Models (LLMs) to execute reliable multi-step workflows has become a central challenge in artificial intelligence. Despite recent advances in LLMs' agentic capabilities, most agent systems still lack formal methods for specifying, verifying, and debugging their workflow and execution trajectories.
This challenge mirrors a long-standing problem in mathematics, where the ambiguity of natural languages (NLs) motivates the development of formal languages (FLs). Inspired by this paradigm, we propose **Lean4Agent**, to the best of our knowledge, the first framework that uses Lean4, a dependent-type FL to model and verify agent behavior.
**Lean4Agent** launches **FormalAgentLib**, an extensible Lean4 library for formally modeling and verifying agent workflows' semantic consistency under explicit assumptions, and enabling localization of execution-time failures revealed by trajectories. Building on **FormalAgentLib**, we further develop **LeanEvolve**, which applies results in **FormalAgentLib** to revise workflows to enhance its capability.
Extensive experiments on a hard problem subset of -Verified and a subset of ELAIP-Bench across 5 leading LLMs indicate that the verification-passing workflows outperform the failing ones by an average of **11. 94%**, and **LeanEvolve** further improves SWE performance by **7. 47%** on average. Furthermore, **Lean4Agent** establishes a foundation for a new field of using expressive dependent-type FL to formally model and verify agent behavior.
Reader Mode unavailable (could not extract clean content).
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from arXiv cs.AI
See more →The Sim-to-Real Gap of Foundation Model Agents: A Unified MDP Perspective
This paper addresses the sim-to-real gap for foundation model agents by framing it within a Markov Decision Process (MDP) structure. It advocates for established solutions like domain randomization to enhance agent robustness, aiming to create standardized benchmarks for reliable real-world applications.