AI and the World's Hard Problems · Theoretical computer science · arXiv · 2026-10-22
Lean4Agent: Formal Modeling and Verification for Agent Workflow and Trajectory

Lean4Agent uses Lean4 to formally model LLM agent workflows, verify their semantic consistency under explicit assumptions, and locate execution failures from trajectories. LeanEvolve then uses verification results to revise workflows. Experiments across five LLMs on subsets of SWE-Bench-Verified and ELAIP-Bench found that verification-passing workflows outperformed failing ones by an average of 11.94%, while LeanEvolve further improved SWE performance by an average of 7.47%.