HERMES: Towards Efficient and Verifiable Mathematical Reasoning in LLMs
Azim Ospanov, Zijin Feng, Jiacheng Sun, Haoli Bai, SHEN XIN, Farzan Farnia
Abstract
Informal mathematics has been central to modern large language model (LLM) reasoning, offering flexibility and efficient construction of arguments. However, purely informal reasoning is prone to logical gaps and subtle errors that are difficult to detect and correct. In contrast, formal theorem proving provides rigorous, verifiable mathematical reasoning, where each inference step is checked by a trusted compiler, but lacks the exploratory freedom of informal problem-solving. This mismatch leaves current LLM-based math agents without a principled way to combine the strengths of both paradigms. In this work, we introduce Hermes, the first tool-assisted agent that explicitly interleaves informal reasoning with formally verified proofs in Lean. The framework performs intermediate formal checking to prevent reasoning drift and a memory module for proof continuity across multi-step reasoning chains, enabling both exploration and verification. We evaluate Hermes on four challenging mathematical reasoning benchmarks using LLMs of varying parameter scales, from small models to state-of-the-art systems. Across all settings, Hermes reliably improves the reasoning accuracy of base models while substantially reducing reasoning token usage and computational cost compared to reward-based approaches. On difficult datasets such as AIME and HARDMath2, Hermes@1 achieves up to a 40% accuracy improvement while using 80% fewer total inference FLOPs. When scaled at test time, Hermes@5 boosts accuracy further by 20%. The implementation and codebase are publicly available at https: //github.com/aziksh-ospanov/HERMES .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 1277b51a-ba67-469d-99c6-9c696cffe6c1Builds on17
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Let's Verify Step by StepHunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards et al.ICLR 2024 · 3,045 citations
- MetaMath: Bootstrap Your Own Mathematical Questions for Large Language ModelsLonghui Yu, Weisen Jiang, Han Shi, Jincheng Yu et al.ICLR 2024 · 637 citations
- miniF2F: a cross-system benchmark for formal Olympiad-level mathematicsKunhao Zheng, Jesse Michael Han, Stanislas PoluICLR 2022 · 342 citations
Related papers
- APOLLO: Automated LLM and Lean Collaboration for Advanced Formal ReasoningAzim Ospanov, Farzan Farnia, Roozbeh MohitNeurIPS 2025 · 49 citations
- LeanAgent: Lifelong Learning for Formal Theorem ProvingAdarsh Kumarappan, Mo Tiwari, Peiyang Song, Robert Joseph George et al.ICLR 2025
- Hilbert: Recursively Building Formal Proofs with Informal ReasoningSumanth Varambally, Thomas Voice, Yanchao Sun, Zhifeng Chen et al.ICLR 2026 · 62 citations
- ImProver: Agent-Based Automated Proof OptimizationRiyaz Ahuja, Jeremy Avigad, Prasad Tetali, Sean WelleckICLR 2025
- AgentMath: Empowering Mathematical Reasoning for Large Language Models via Tool-Augmented AgentHaipeng Luo, Huawen Feng, Qingfeng Sun, Can Xu et al.ICLR 2026 · 22 citations
