让大模型在数学推理中同时实现自由探索与严格验证。
HERMES: Towards Efficient and Verifiable Mathematical Reasoning in LLMs
- 用正式证明框架交叉检查非形式化推理过程,防止逻辑偏差。
- 在AIME和HARDMath2上提升40%准确率,推理计算量减少80%。
- 适合需要高可靠性数学推理的AI系统开发者或研究者。
非形式化数学推理在现代大语言模型中占据核心地位,具有灵活性和高效构建论证的优势。然而,纯非形式化推理易出现难以发现和修正的逻辑漏洞。相比之下,形式化定理证明提供严谨可验证的数学推理,每一步推论均由可信编译器校验,但缺乏非形式化问题解决的探索自由。这种矛盾导致现有基于大模型的数学智能体无法系统结合两种范式的优点。本文提出Hermes,首个显式交替使用非形式化推理与形式化验证(在Lean中)的工具辅助代理。该框架通过中间形式检查防止推理漂移,并采用记忆模块保持多步推理链中的证明连续性,兼顾探索与验证。我们在四个具有挑战性的数学推理基准上评估了Hermes,涵盖从小模型到前沿系统的多种参数规模的大模型。所有设置下,Hermes均显著提升基础模型的推理准确性,同时大幅降低推理令牌消耗与计算成本。在AIME和HARDMath2等困难数据集上,Hermes@1 最多实现40%的准确率提升,总推理浮点运算量减少80%。测试时扩展至Hermes@5进一步提升准确率20%。代码与实现已公开于https://github.com/aziksh-ospanov/HERMES。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。