arXiv:2502.07803cs.AIcs.LG2025-02ICML被引 15

让大模型的推理过程更可靠,通过代码与自然语言逻辑对齐提升准确率。

Reasoning-as-Logic-Units: Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignment

  • 将程序拆解为逻辑单元,用迭代对话对齐自然语言描述与代码逻辑。
  • 在GSM8K和MATH上超越现有方法,算法题准确率显著提升。
  • 适合需要高可信推理的数学、编程任务,提升可解释性。

链式思维(CoT)提示通过生成自然语言推理路径来增强大语言模型(LLM)的推理能力,但在数值计算方面表现不佳,促使程序辅助技术的发展。然而,一个持续存在的挑战是:模型报告的推理步骤与生成程序中的逻辑不一致,称为“推理幻觉”。这源于自然语言的模糊性和大模型的统计本质,常缺乏严格的逻辑一致性。为此,我们提出一种新的测试时扩展框架——推理即逻辑单元(RaLU),通过在生成程序与其对应的自然语言描述之间对齐逻辑单元,构建更可靠的推理路径。通过静态分析将初始生成的程序分解为离散逻辑单元,RaLU 与 LLM 进行迭代对话,判断、修正并解释每个单元。回溯修正机制确保每个单元中的代码语句与任务要求一致,最终形成基于程序逻辑的连贯推理路径,从而得出最终答案。实验表明,RaLU 在数学推理(GSM8K、MATH)和算法推理(HumanEval+、MBPP+)任务上显著优于现有基线,证明其在提升大模型推理与编程能力方面的潜力,兼具更高的准确率与可解释性。

原文摘要 · Abstract (English)

Chain-of-Thought (CoT) prompting has shown promise in enhancing the reasoning capabilities of large language models (LLMs) by generating natural language (NL) rationales that lead to the final answer. However, it struggles with numerical computation, which has somehow led to the development of program-aided techniques. Despite their potential, a persistent challenge remains: inconsistencies between LLM-reported reasoning steps and the logic in generated programs, which we term ``reasoning hallucinations." This stems from the inherent ambiguities of NL and the statistical nature of LLMs, which often lack rigorous logical coherence. To address this challenge, we propose a novel test-time scaling framework, Reasoning-as-Logic-Units (RaLU), which constructs a more reliable reasoning path by aligning logical units between the generated program and their corresponding NL descriptions. By decomposing the initially generated program into discrete units using static analysis, RaLU engages in an iterative dialogue with the LLM to judge, refine, and explain each unit. A rewind-and-correct mechanism ensures alignment between code statements and task requirements in each unit, ultimately forming a cohesive reasoning path under the program's logic, from which the model reaches a final solution. Our experiments demonstrate that RaLU significantly outperforms existing baselines in mathematical reasoning (GSM8K, MATH) and algorithmic reasoning (HumanEval+, MBPP+), underscoring its potential to advance LLM reasoning and programming by offering enhanced accuracy and interpretability.

大模型推理逻辑对齐程序辅助数学推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。