Lune

ICLR2024Top-tier venue

Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verification

Aojun Zhou, Ke Wang, Zimu Lu, Weikang Shi, Sichun Luo, Zipeng Qin, Shaoqing Lu, Anya Jia, Linqi Song, Mingjie Zhan, Hongsheng Li

Abstract

Recent progress in large language models (LLMs) like GPT-4 and PaLM-2 has brought significant advancements in addressing math reasoning problems. In particular, OpenAI's latest version of GPT-4, known as GPT-4 Code Interpreter, shows remarkable performance on challenging math datasets. In this paper, we explore the effect of code on enhancing LLMs' reasoning capability by introducing different constraints on the Code Usage Frequency of GPT-4 Code Interpreter. We found that its success can be largely attributed to its powerful skills in generating and executing code, evaluating the output of code execution, and rectifying its solution when receiving unreasonable outputs. Based on this insight, we propose a novel and effective prompting method, explicit code-based self-verification (CSV), to further boost the mathematical reasoning potential of GPT-4 Code Interpreter. This method employs a zero-shot prompt on GPT-4 Code Interpreter to encourage it to use code to self-verify its answers. In instances where the verification state registers as ``False'', the model shall automatically amend its solution, analogous to our approach of rectifying errors during a mathematics examination. Furthermore, we recognize that the states of the verification result indicate the confidence of a solution, which can improve the effectiveness of majority voting. With GPT-4 Code Interpreter and CSV, we achieve an impressive zero-shot accuracy on MATH dataset (53.9% →\to 84.3%).

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

54 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Large Language Models Cannot Self-Correct Reasoning Yet cites Large Language Models are Zero-Shot Reasoners
  • Large Language Models Cannot Self-Correct Reasoning Yet cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Language Models are Few-Shot Learners
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Measuring Massive Multitask Language Understanding cites Language Models are Few-Shot Learners
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites Measuring Massive Multitask Language Understanding
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites Large Language Models are Zero-Shot Reasoners
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • ToRA: A Tool-Integrated Reasoning Agent for Mathematical Problem Solving cites MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning
  • ToRA: A Tool-Integrated Reasoning Agent for Mathematical Problem Solving cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Large Language Models are Zero-Shot Reasoners cites Language Models are Few-Shot Learners
  • Large Language Models are Zero-Shot Reasoners cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning cites Measuring Massive Multitask Language Understanding
  • MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning cites MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning
  • MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning cites Large Language Models are Zero-Shot Reasoners
  • MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning cites Language Models are Few-Shot Learners
  • MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language Models cites Measuring Massive Multitask Language Understanding
  • QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers54

  1. Large Language Models Cannot Self-Correct Reasoning YetJie Huang, Xinyun Chen, Swaroop Mishra, Huaixiu Steven Zheng et al.ICLR 2024 · 858 citations
  2. MAmmoTH: Building Math Generalist Models through Hybrid Instruction TuningXiang Yue, Xingwei Qu, Ge Zhang, Yao Fu et al.ICLR 2024 · 558 citations
  3. ToRA: A Tool-Integrated Reasoning Agent for Mathematical Problem SolvingZhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen et al.ICLR 2024 · 289 citations
  4. MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical ReasoningKe Wang, Houxing Ren, Aojun Zhou, Zimu Lu et al.ICLR 2024 · 188 citations
  5. QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language ModelsYuhui Xu, Lingxi Xie, Xiaotao Gu, Xin Chen et al.ICLR 2024 · 179 citations

Builds on16

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  3. Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
  4. Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
  5. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations

Related papers

  1. SelfCheck: Using LLMs to Zero-Shot Check Their Own Step-by-Step ReasoningNing Miao, Yee Whye Teh, Tom RainforthICLR 2024 · 195 citations
  2. PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon et al.ICML 2023 · 700 citations
  3. On the self-verification limitations of large language models on reasoning and planning tasksKaya Stechly, Karthik Valmeekam, Subbarao KambhampatiICLR 2025
  4. Competition-Level Problems are Effective LLM EvaluatorsYiming Huang, Zhenghao Lin, Xiao Liu, Yeyun Gong et al.ACL Findings 2024 · 7 citations
  5. Reasoning in Large Language Models Through Symbolic Math Word ProblemsVedant Gaur, Nikunj SaunshiACL Findings 2023 · 10 citations
Dusk over the sea between two cliffs drawn in fine vertical lines