Benchmarking Large Language Models for Math Reasoning Tasks

Kathrin Seßler, Yao Rong, Emek Gözlüklü, Enkelejda Kasneci

TL;DR

This paper presents a comprehensive benchmark evaluating seven popular in-context learning (ICL) prompting strategies across five math datasets using four state-of-the-art LLMs. The core finding reveals a stark divide: while massive models like GPT-4o and LLaMA 3-70B are highly robust to prompt variations, smaller models are incredibly sensitive to the choice of strategy, highlighting critical trade-offs between accuracy, API costs, and local compute times.

What Problem Does This Paper Address?

While Large Language Models (LLMs) excel at natural language tasks, multi-step mathematical reasoning remains a significant hurdle. Researchers have developed numerous prompting strategies—such as Chain-of-Thought (CoT) and Program-Aided Language models (PAL)—to improve performance.

However, existing literature is fragmented. Most papers evaluate a single novel prompting method on limited datasets, completely ignoring the practical trade-offs between accuracy, computational runtime, and financial costs (API fees). This paper addresses this gap by providing a standardized, multi-dimensional benchmark to help engineers and researchers select the optimal model-prompt combination for their specific resource constraints.

Methods

The authors evaluate seven in-context learning methods, keeping the base model parameters frozen. They categorize these methods into three distinct paradigms:

  1. Prompt Engineering: Classic Chain-of-Thought (CoT) (few-shot step-by-step examples), Zero-Shot CoT (appending "Let's think step by step"), and Auto-CoT (automatically selecting diverse few-shot examples via clustering).
  2. Process Optimization: Complex-CoT (using highly complex examples to guide reasoning) and Self-Consistency CoT (running multiple chains and taking a majority vote).
  3. External Engines: Program-of-Thought (PoT) and Program-Aided Language models (PAL), which offload arithmetic calculations by forcing the LLM to generate executable Python code.
Fig. 2. Overview of the mathematical reasoning methods evaluated in the benchmark, categorized into three groups: Prompt Engineering, Process Optimization, and External Engine. The primary procedure for each method is outlined. Symbols denote the presence of few-shot examples (9), the use of an external engine (3), and the number of refinement iterations required (î).

Datasets

The benchmark spans five widely used datasets representing different difficulty levels and problem types:

  • GSM8K, SVAMP, Multi-Arith: Grade-school level math word problems.
  • MATH: High-school competition-level problems across domains like Algebra, Geometry, and Calculus.
  • AQuA: College-level multiple-choice word problems.
Summary of datasets used in the benchmark

Key Insights and Ideas

  • Scale Trumps Strategy: For frontier models (GPT-4o and LLaMA 3-70B), the specific prompting strategy matters surprisingly little. Their internal reasoning capabilities are robust enough to solve problems independently of the prompt style.
  • Small Models are Prompt-Sensitive: For smaller models like LLaMA 3-8B and GPT-3.5, the prompting strategy can make or break performance.
  • Prompts are Model-Dependent: There is no "one-size-fits-all" prompt. For instance, Auto-CoT yields the largest performance boost for LLaMA 3 models, whereas Zero-Shot CoT shines brightest on GPT-3.5.
  • The Code-Generation Trap: Offloading calculations to Python (PAL/PoT) works well for basic word problems but fails catastrophically on complex datasets like MATH (which require symbolic or geometric reasoning) and multiple-choice formats like AQuA.
  • The Verbosity Bottleneck: Highly capable models like GPT-4o can sometimes fail on complex tasks not due to poor logic, but because their highly verbose, detailed reasoning paths exceed maximum token limits.

Key Results

The benchmark evaluates robust performance using the pass@3 metric (the probability of getting the correct answer at least once in three attempts) alongside financial and time costs.

  • The Absolute Winner: GPT-4o consistently dominates across all datasets, achieving near-perfect scores on simpler grade-school datasets.
  • The Cost-Efficiency Sweet Spot: For budget-constrained applications, GPT-3.5 combined with Zero-Shot CoT is highly compelling. On the GSM8K dataset, it approaches GPT-4o's accuracy while being roughly 30x cheaper to run.
  • Local Deployment Choice: For open-source local hosting, LLaMA 3-70B with Auto-CoT provides the best trade-off, delivering robust accuracy at a computational cost of roughly 10 seconds per sample on dual A100 GPUs.
Fig. 3. Trade-off between performance and computational costs on the GSM8K dataset. The y-axis represents the pass@3 and the x-axis the computational costs. On the left side, the LLaMA foundation models are shown, based on the elapsed computation time, and on the right side, the GPT foundation models are compared based on the costs for the API calls.

Limitations and Future Work

The authors note that their study is limited to four foundational models. They plan to expand the benchmark codebase to include other state-of-the-art models like Mistral, Gemini, and Claude. Additionally, they intend to evaluate models that have been explicitly fine-tuned for mathematical tasks to see how prompting strategies interact with domain-specific weights.

Summary updated

BibTeX
@misc{seler2024benchmarking,
  author = {Kathrin Seßler and Yao Rong and Emek Gözlüklü and Enkelejda Kasneci},
  title = {{Benchmarking Large Language Models for Math Reasoning Tasks}},
  year = {2024},
  eprint = {2408.10839},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.10839},
}
Figure