arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.04072cs.AI
收藏

KG增强的可执行思维链用于数学编码

KG-Augmented Executable CoT for Mathematical Coding

Xingyu Chen, Junxiu An, Jun Guo, Li Wang, Jingcai Guo

AI总结:

提出KGA-ECoT框架,结合知识图谱与可执行代码,通过结构化任务图和GraphRAG提升数学推理与代码生成的准确性,在多个基准上显著优于现有方法。

摘要:

近年来,大型语言模型(LLMs)在自然语言处理任务中表现出色,但在数学推理和代码生成等复杂推理任务中面临重大挑战。为了解决这些局限性,我们提出了KG增强的可执行思维链(KGA-ECoT),这是一种新颖的框架,通过知识图谱增强代码生成,并通过可执行代码改进数学推理。KGA-ECoT将问题分解为结构化任务图,利用高效的GraphRAG从数学库中进行精确知识检索,并生成可验证的代码以确保计算准确性。在多个数学推理基准上的评估表明,KGA-ECoT显著优于现有的提示方法,实现了从几个百分点到超过十个百分点不等的绝对准确率提升。进一步分析证实了GraphRAG在提高代码质量和外部代码执行在确保精度方面的关键作用。这些发现共同确立了KGA-ECoT作为复杂数学推理任务中一个稳健且高度可泛化的框架。

英文摘要:

In recent years, large language models (LLMs) have excelled in natural language processing tasks but face significant challenges in complex reasoning tasks such as mathematical reasoning and code generation. To address these limitations, we propose KG-Augmented Executable Chain-of-Thought (KGA-ECoT), a novel framework that enhances code generation through knowledge graphs and improves mathematical reasoning via executable code. KGA-ECoT decomposes problems into a Structured Task Graph, leverages efficient GraphRAG for precise knowledge retrieval from mathematical libraries, and generates verifiable code to ensure computational accuracy. Evaluations on multiple mathematical reasoning benchmarks demonstrate that KGA-ECoT significantly outperforms existing prompting methods, achieving absolute accuracy improvements ranging from several to over ten percentage points. Further analysis confirms the critical roles of GraphRAG in enhancing code quality and external code execution in ensuring precision. These findings collectively establish KGA-ECoT as a robust and highly generalizable framework for complex mathematical reasoning tasks.

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

↑