Skip to main content
QUICK REVIEW

[Paper Review] Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verification

Aojun Zhou, Ke Wang|arXiv (Cornell University)|Aug 15, 2023
Topic ModelingComputer Science18 citations
TL;DR

The paper analyzes GPT-4 Code Interpreter’s code generation/execution and proposes explicit code-based self-verification (CSV) plus verification-guided weighted majority voting to boost mathematical problem solving, achieving 84.32% on MATH with GPT-4 Code after combining CSV and voting.

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 extit{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 \uline{c}ode-based \uline{s}elf-\uline{v}erification~(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 extbf{(53.9\% $ o$ 84.3\%)}.

Motivation & Objective

  • Assess how code generation, execution, and self-debugging contribute to GPT-4 Code Interpreter’s math problem solving.
  • Investigate whether an explicit code-based self-verification (CSV) prompt improves correctness and robustness.
  • Develop a verification-guided weighted majority voting scheme to leverage verification states in aggregation.
  • Provide new instruction-following datasets (MATH-code, MMLU-Math-code) to aid open-source model tuning.

Proposed method

  • Systematic analysis of code usage in GPT-4 Code Interpreter under constrained prompts (no code vs. code allowed once vs. unrestricted).
  • Introduction of explicit code-based self-verification (CSV) prompting to have the model generate and verify code-based solutions and adjust reasoning when verification fails.
  • Implementation of verification-guided weighted majority voting that assigns weights to True/Uncertain/False verification states to improve final answer selection.
  • Evaluation on MATH, GSM8K, and MMLU-Math datasets showing performance gains, with ablations comparing code-based vs natural-language verification and varying code usage frequencies.
  • Public release of experimental data to enable replication and fine-tuning of open-source models.

Experimental results

Research questions

  • RQ1How does GPT-4 Code Interpreter’s code generation/execution contribute to solving complex math problems?
  • RQ2Does explicit code-based self-verification (CSV) improve answer accuracy and reliability?
  • RQ3Can verification-guided weighted majority voting further enhance final answer accuracy by leveraging verification states?
  • RQ4What are the effects of Code Usage Frequency on model performance across difficulty levels and datasets?

Key findings

  • GPT-4 Code with code usage substantially outperforms baselines on MATH (69.69% vs 53.90%).
  • Adding explicit code-based self-verification (CSV) raises MATH accuracy to 73.54%.
  • Combining CSV with verification-guided weighted majority voting reaches 84.32% on MATH (k=16 paths).
  • Code Usage Frequency positively correlates with accuracy, especially on harder problems.
  • Code-based verification outperforms natural-language verification in ablations across most subtopics.
  • The approach also achieves state-of-the-art results on GSM8K and MMLU-Math when combined with CSV and voting.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.