2025-10-14 · 专家 · 计算机视觉 · 自然语言处理 · 机器学习

CodePlot-CoT: Mathematical Visual Reasoning by Thinking with Code-Driven Images

该论文提出了一种基于代码驱动的思维链(CodePlot-CoT)范式,通过生成可执行的绘图代码来辅助数学问题的视觉推理,显著提高了视觉数学推理的准确性。

更新于 2025-10-14。作者:Chengqi Duan、Kaiyue Sun、Rongyao Fang、Manyuan Zhang、Yan Feng、Ying Luo、Yufang Liu、Ke Wang、Peng Pei、Xunliang Cai、Hongsheng Li、Yi Ma、Xihui Liu。

中文摘要

近期,大型语言模型(LLMs)和视觉语言模型(VLMs)在数学推理方面取得了显著进展,但它们在需要视觉辅助的问题上,如绘制辅助线或绘制函数来解决问题,仍面临一个关键的瓶颈。大多数LLMs和VLMs都局限于纯文本推理链,而能够生成交织文本和图像的多模态统一模型缺乏这类任务所需的精度和可控性。为此,我们提出了CodePlot-CoT,这是一种用于数学中“用图像思考”的代码驱动思维链范式。我们的方法利用VLM生成文本推理以及可执行的绘图代码,然后将这些代码渲染成图像作为“视觉思维”,以解决数学问题。为此,我们首先构建了Math-VR,这是第一个大规模、双语的数据集和基准,用于具有视觉推理的数学问题,包含178K个样本。其次,为了创建高质量的训练数据,我们开发了一种先进的图像到代码转换器,专门用于解析复杂的数学图形到代码。最后,使用这些训练数据,我们训练了CodePlot-CoT模型来解决数学问题。实验结果表明,我们的模型在新的基准测试中相对于基础模型实现了高达21%的提升,充分验证了我们提出的代码驱动推理范式的有效性。我们的工作为多模态数学推理开辟了新的方向,并为社区提供了第一个大规模数据集、全面的基准和强大的解决方案。为了促进未来的研究,我们将我们的数据集、代码和预训练模型公开发布在https://github.com/HKU-MMLab/Math-VR-CodePlot-CoT上。

英文摘要

Recent advances in Large Language Models (LLMs) and Vision Language Models (VLMs) have shown significant progress in mathematical reasoning, yet they still face a critical bottleneck with problems requiring visual assistance, such as drawing auxiliary lines or plotting functions to solve the problems. Most LLMs and VLMs are constrained to text-only reasoning chains, while multimodal unified models that can generate interleaved text and images lack the necessary precision and controllability for such tasks. To address this, we propose CodePlot-CoT, a code-driven Chain-of-Thought paradigm for "thinking with images" in mathematics. Our approach leverages the VLM to generate text reasoning as well as executable plotting code, which is then rendered into images as "visual thought", to solve mathematical problems. To achieve this, we first construct Math-VR, the first large-scale, bilingual dataset and benchmark for Mathematics problems with Visual Reasoning, comprising 178K samples. Second, to create high-quality training data, we develop a state-of-the-art image-to-code converter specialized for parsing complex mathematical figures into codes. Finally, using these training data, we train the CodePlot-CoT model for solving mathematical problems. Experimental results show that our model achieves up to 21% increase over base model on our new benchmark, fully validating the efficacy of our proposed code-driven reasoning paradigm. Our work opens a new direction for multimodal mathematical reasoning and provides the community with the first large-scale dataset, comprehensive benchmark, and strong approach for such problems. To facilitate future research, we make our datasets, code, and pretrained models publicly available at https://github.com/HKU-MMLab/Math-VR-CodePlot-CoT.

解读

一句话总结

该论文提出了一种基于代码驱动的思维链(CodePlot-CoT)范式,通过生成可执行的绘图代码来辅助数学问题的视觉推理,显著提高了视觉数学推理的准确性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt