MathPrompter: Mathematical Reasoning using Large Language Models

Shima Imani, Liang Du, Harsh Shrivastava
3/4/2023
cs.CLcs.AI

No official code found. Best implementation: RamonKaspar/MathPrompter (17 stars, MIT, last commit 2025-04-12).

Abstract

Large Language Models (LLMs) have limited performance when solving arithmetic reasoning tasks and often provide incorrect answers. Unlike natural language understanding, math problems typically have a single correct answer, making the task of generating accurate solutions more challenging for LLMs. To the best of our knowledge, we are not aware of any LLMs that indicate their level of confidence in their responses which fuels a trust deficit in these models impeding their adoption. To address this deficiency, we propose `MathPrompter', a technique that improves performance of LLMs on arithmetic problems along with increased reliance in the predictions. MathPrompter uses the Zero-shot chain-of-thought prompting technique to generate multiple Algebraic expressions or Python functions to solve the same math problem in different ways and thereby raise the confidence level in the output results. This is in contrast to other prompt based CoT methods, where there is no check on the validity of the intermediate steps followed. Our technique improves over state-of-the-art on the MultiArith dataset ($78.7\%\rightarrow92.5\%$) evaluated using 175B parameter GPT-based LLM.

View on arXivView PDF

Code Implementations(1)

MIT

MathPrompter Implementation: This repository hosts an implementation based on the 'MathPrompter: Mathematical Reasoning Using Large Language Models' paper by Microsoft Research. The code replicates the methods discussed in the paper.

173PythonApr 29, 20241 years agoMIT
arithmetic-reasoninglarge-language-modelsmathematical-reasoningmathprompter

Similar Papers

Cite this paper

@article{imani2023mathprompter,
  title  = {MathPrompter: Mathematical Reasoning using Large Language Models},
  author = {Shima Imani and Liang Du and Harsh Shrivastava},
  year   = {2023},
  eprint = {2303.05398},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.05398v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.05398.svg)](https://codeofpaper.com/paper/2303.05398)

Discussion