arXiv:2510.25975cs.CLcs.PL2025-10Conference of the …被引 5

用可验证代码解决数学题,让AI推理更可靠

SymCode: A Neurosymbolic Approach to Mathematical Reasoning via Verifiable Code Generation

  • 把数学题转成可执行代码,用符号引擎验证结果
  • 在MATH-500和OlympiadBench上最高提升13.6个百分点
  • 适合需要高精度的数学推理场景,如竞赛与学术研究

大型语言模型在复杂数学推理中常表现不佳,基于自然语言的生成方式难以验证且易出算术错误。现有提示策略如思维链仍依赖不可靠的文本媒介,缺乏确定性验证机制。为此,我们提出SymCode——一种神经符号框架,将数学问题求解重构为基于SymPy库的可验证代码生成任务。在MATH-500和OlympiadBench等挑战性基准上评估显示,相比基线模型,准确率最高提升13.6个百分点。分析表明,SymCode不仅更节省计算资源,还使模型错误从隐蔽逻辑谬误转变为清晰的程序错误。通过将语言模型推理锚定于确定性符号引擎,SymCode为形式化领域中的可信人工智能迈出了关键一步。

原文摘要 · Abstract (English)

Large Language Models (LLMs) often struggle with complex mathematical reasoning, where prose-based generation leads to unverified and arithmetically unsound solutions. Current prompting strategies like Chain of Thought still operate within this unreliable medium, lacking a mechanism for deterministic verification. To address these limitations, we introduce SymCode, a neurosymbolic framework that reframes mathematical problem-solving as a task of verifiable code generation using the SymPy library. We evaluate SymCode on challenging benchmarks, including MATH-500 and OlympiadBench, demonstrating significant accuracy improvements of up to 13.6 percentage points over baselines. Our analysis shows that SymCode is not only more token-efficient but also fundamentally shifts model failures from opaque logical fallacies towards transparent, programmatic errors. By grounding LLM reasoning in a deterministic symbolic engine, SymCode represents a key step towards more accurate and trustworthy AI in formal domains.

数学推理神经符号代码生成可验证

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