AoA: A New AST-Based Agent for Efficient Theorem Proving

Discover AoA, a new agent that cuts API costs by 2.3x using AST-based proof representation, reducing tokens and tool calls for efficient interactive theorem

sábado, 25 de julio de 2026 • 3 min read • Q2BSTUDIO Team

Cómo AoA reduce el consumo de tokens y costes de API

Interactive theorem proving is a cornerstone of software verification and formalized mathematics, but its manual nature limits scalability. LLM-based proof agents promise to ease this effort, yet their heavy token consumption and API cost remain a major obstacle. Recent research traces this cost to a shared root: current agents operate on serialized concrete syntax, emitting proofs as source text and recovering proof states through separate, line-number-based queries. Every edit shifts later lines, forcing repeated relocation of errors and states. This same dependence on concrete syntax also blocks the adoption of Minilang, a state-of-the-art proof language that is too new for LLMs' training corpora.

To overcome these limitations, the concept of Agent over AST (AoA) emerges, lifting the agent off source text and onto the abstract syntax tree (AST). Instead of working with concrete syntax, the model supplies proofs as JSON representations of Minilang's AST — a format native to tool-calling LLMs — and drives the prover through a tree-edit model that fuses proof operations and states into one proof tree. Each operation carries its own subgoal's state, readable directly off the tree. This eliminates the need to re-query text lines and drastically reduces token manipulation.

The results of AoA are compelling. Compared to Amazon's Isabelle Agent on the miniF2F and NTP4VC-Pearl common success sets, AoA cuts API cost by 2.3–4.7x (normalized input-cache accounting), uses 2.9–6.9x fewer tokens, 3.9–8.9x fewer tool calls, and finishes 1.4–2.0x faster. It also solves far more problems on the harder verification benchmark. This breakthrough not only demonstrates the efficiency of working with AST but also opens the door to a new generation of lighter, cheaper AI agents.

The lesson is clear: knowledge representation matters as much as the underlying model. By decoupling agent logic from concrete syntax, we achieve efficiency that benefits any domain where LLMs interact with structured environments. This includes code generation, business process automation, cloud infrastructure management, and cybersecurity.

At Q2BSTUDIO, as a software development and technology company, we understand that optimizing AI agents is critical for competitiveness. Our team creates custom AI solutions that leverage efficient architectures, reducing operational costs and improving response speed. Just as AoA transforms theorem provers, we apply similar principles to develop custom software that integrates intelligent agents for predictive analytics, natural language processing, or complex task automation.

Cybersecurity is another area where efficient AI agents make a difference. An intrusion detection agent processing real-time events must minimize token consumption to be cost-effective in cloud environments like AWS or Azure. Our cloud AWS/Azure services include deploying scalable infrastructures that support lightweight AI agents, ensuring both security and performance. In Business Intelligence, AST-based agents can interpret natural language queries on Power BI dashboards, generating precise responses without processing large volumes of textual data.

The application of this philosophy extends beyond theorem proving. Any system requiring interaction between an LLM and a structured environment — such as code editors, design assistants, or automation platforms — can benefit from an AST-based approach. At Q2BSTUDIO, we develop custom applications that incorporate these patterns, helping companies reduce API costs, improve latency, and scale their AI solutions without compromising quality.

Token efficiency is not only an economic issue but also an ecological one. Fewer tokens mean less energy and a smaller carbon footprint. By adopting architectures like AoA, organizations can align innovation goals with sustainability. Our technology consulting team advises on selecting optimal models and representations for each use case, whether in cloud, on-premise, or hybrid environments.

In summary, the Agent over AST represents a paradigm shift in how LLMs interact with complex systems. The software industry is moving toward more specialized and efficient agents, and companies like Q2BSTUDIO are at the forefront, integrating these innovations into custom software, AI, cybersecurity, cloud, and BI solutions. The question is no longer if an agent can be optimized, but how to do it intelligently — and the answer, as in AoA, lies in abstraction over syntax.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.