AI
New AI theorem-proving agent slashes API costs by using syntax trees instead of source text
Researchers introduce a tree-based approach to help language models tackle formal proof problems more efficiently, cutting token usage and API expenses dramatically.
Interactive theorem proving—a foundational technique in program verification and formalized mathematics—has long required substantial manual effort, slowing adoption and scalability. Recent work by language-model-based proof agents has opened new possibilities for automation, but their economic drawbacks have proven hard to overcome: token consumption and API costs remain prohibitively high for many applications.
The root of the efficiency problem#
The core bottleneck lies in how existing agents operate. They work directly with serialized concrete syntax—the literal text of proofs—and emit their outputs as source code. To track progress, they must query the prover separately using line-number references. Every time the agent edits a proof, subsequent lines shift position, forcing the agent to repeatedly relocate errors and recompute proof states. This cascading inefficiency drives up token usage and API calls.
The challenge is compounded by new proof languages like Minilang, which recently achieved state-of-the-art results on LLM-based proving tasks. However, Minilang entered the field too recently to appear in LLMs' training corpora, making it inaccessible to current agents trained only on classical syntax.
A tree-based solution#
Researchers have proposed lifting agents off source text entirely and placing them directly onto the abstract syntax tree (AST)—the structural representation that underlies all code. Rather than outputting proofs as raw text, the model now produces proofs as JSON representations of Minilang's AST structure. These native representations align naturally with how tool-calling LLMs operate.
The system employs a tree-edit model that combines proof operations and their corresponding states into a single proof tree. Each operation carries its own subgoal's state, readable directly from the tree structure. This eliminates the need for separate state-recovery queries.
Real-world impact#
The research team implemented this design in a system called Agent over AST (AoA) and benchmarked it against Amazon's Isabelle Agent using two standard test suites: miniF2F and NTP4VC-Pearl. The results were striking:
- API costs cut by 2.3–4.7x (with input-cache accounting)
- Token usage reduced by 2.9–6.9x
- Tool calls decreased by 3.9–8.9x
- Execution time improved by 1.4–2.0x

