arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.18760cs.AIcs.FL
收藏

HERMES: 迈向高效且可验证的LLM数学推理

HERMES: Towards Efficient and Verifiable Mathematical Reasoning in LLMs

Department of Computer Science \& Engineering, The Chinese University of Hong Kong;Huawei Foundation Model Department

Azim Ospanov, Zijin Feng, Jiacheng Sun, Haoli Bai, Xin Shen, Farzan Farnia

AI总结:

提出Hermes框架,通过将非正式推理与Lean形式化验证交替结合,并引入中间形式化检查和记忆模块,在提升推理准确性的同时显著降低计算成本。

摘要:

非正式数学一直是现代大型语言模型(LLM)推理的核心,提供了灵活性和高效构建论证的能力。然而,纯粹的非正式推理容易产生逻辑漏洞和细微错误,难以检测和纠正。相比之下,形式化定理证明提供了严谨、可验证的数学推理,其中每个推理步骤都由可信的编译器检查,但缺乏非正式问题解决的探索自由度。这种不匹配使得当前基于LLM的数学代理缺乏一种原则性的方法来结合两种范式的优势。在这项工作中,我们引入了Hermes,这是第一个明确将非正式推理与Lean中的形式化验证证明交替结合的工具辅助代理。该框架执行中间形式化检查以防止推理漂移,并配备一个记忆模块以在多步推理链中保持证明的连续性,从而同时实现探索和验证。我们在四个具有挑战性的数学推理基准上评估了Hermes,使用了不同参数规模的LLM,从小模型到最先进的系统。在所有设置中,Hermes可靠地提高了基础模型的推理准确性,同时与基于奖励的方法相比,显著减少了推理令牌使用量和计算成本。在AIME和HARDMath2等困难数据集上,Hermes@1实现了高达40%的准确性提升,同时总推理FLOPs减少了80%。在测试时扩展时,Hermes@5进一步将准确性提高了20%。实现和代码库公开于https://github.com/aziksh-ospanov/HERMES。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑