arXiv:2505.20170cs.AI2025-05

用程序生成方程思路,让大模型解代数题更准

Program of Equations Thoughts to Solve Algebra Word Problems

  • 将推理拆成列方程和写代码两步,计算交给Python执行
  • 在PEN和ALG514数据集上准确率达95.3%和98.0%,新SOTA
  • 零样本模板可直接生成代码,适合快速部署到实际应用

解代数应用题已成为自然语言处理的重要任务。尽管大语言模型(LLMs)展现出强大的数学能力,但其自身计算能力有限,链式思维推理中易累积计算错误,导致最终答案出错。为此,我们提出程序方程思维(POET),将逐步推理转化为预测方程与生成代码的两阶段任务,将复杂计算交由Python解释器执行,避免大模型中的计算误差。此外,我们提出零样本POET,利用人工设计模板,使大模型能直接生成用于单步求解的Python代码。该方法在PEN和ALG514数据集上分别达到95.3%和98.0%的准确率,刷新了当前最优性能(SOTA)。零样本POET在DRAW-1K数据集上也取得了95.5%的SOTA结果。

原文摘要 · Abstract (English)

Solving algebraic word problems (AWPs) has recently emerged as an important natural language processing task. Recently, large language models (LLMs) have demonstrated powerful mathematical capabilities, and the Chain-of-Thought technique, which guides LLMs through step-by-step reasoning, has yielded impressive results. However, this reasoning ability is limited by the computational weaknesses of LLMs themselves, where calculation errors can accumulate, leading to incorrect final answers. To address this, we propose Program of Equations Thoughts (POET), which transforms the task of generating step-by-step reasoning answers into a two-stage task of predicting equations and generating code, offloading complex computations to a Python interpreter to avoid calculation errors in LLMs. Furthermore, we propose Zero-shot POET, which utilizes a manually designed template to enable LLMs to directly generate Python code for one-step solving. Our method achieves accuracies of 95.3% and 98.0% on the PEN and ALG514 datasets, respectively, setting a new state-of-the-art (SOTA). Zero-shot POET also achieves the SOTA result of 95.5% on the DRAW-1K dataset.

代数题大模型代码生成推理

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