Skip to main content
QUICK REVIEW

[Paper Review] ToRA: A Tool-Integrated Reasoning Agent for Mathematical Problem Solving

Zhibin Gou, Shao Zhi-hong|arXiv (Cornell University)|Sep 29, 2023
Topic ModelingComputer Science20 citations
TL;DR

ToRA integrates natural language reasoning with tool-based computation to solve math problems, achieving state-of-the-art results among open-source models across 10 datasets, and rivaling or surpassing some closed models on key benchmarks.

ABSTRACT

Large language models have made significant progress in various language tasks, yet they still struggle with complex mathematics. In this paper, we propose ToRA a series of Tool-integrated Reasoning Agents designed to solve challenging mathematical problems by seamlessly integrating natural language reasoning with the utilization of external tools (e.g., computation libraries and symbolic solvers), thereby amalgamating the analytical prowess of language and the computational efficiency of tools. To train ToRA, we curate interactive tool-use trajectories on mathematical datasets, apply imitation learning on the annotations, and propose output space shaping to further refine models' reasoning behavior. As a result, ToRA models significantly outperform open-source models on 10 mathematical reasoning datasets across all scales with 13%-19% absolute improvements on average. Notably, ToRA-7B reaches 44.6% on the competition-level dataset MATH, surpassing the best open-source model WizardMath-70B by 22% absolute. ToRA-Code-34B is also the first open-source model that achieves an accuracy exceeding 50% on MATH, which significantly outperforms GPT-4's CoT result, and is competitive with GPT-4 solving problems with programs. Additionally, we conduct a comprehensive analysis of the benefits and remaining challenges of tool interaction for mathematical reasoning, providing valuable insights for future research.

Motivation & Objective

  • Motivate enabling open-source models to perform advanced mathematical reasoning by coupling reasoning with external tools.
  • Curate interactive tool-use trajectories and train models via imitation learning and output space shaping.
  • Demonstrate that interleaving rationales with programmatic tool use yields substantial gains over prior approaches.

Proposed method

  • Design interleaved reasoning format that combines natural language rationales with program-based tool use (interleaved r and a, with tool outputs o).
  • Collect interactive tool-use trajectories on GSM8k and MATH using GPT-4 to create ToRA-Corpus.
  • Train models via imitation learning on ToRA-Corpus to predict next rationale/program/output given a problem.
  • Apply output space shaping by sampling and correcting trajectories using a teacher model to diversify and correct tool-use behavior.
  • Fine-tune LLaMA-2 and CodeLLaMA models across 7B–70B parameters to obtain ToRA and ToRA-Code series.
  • Evaluate on 10 mathematical reasoning datasets (GSM8k, MATH, GSM-Hard, SVAMP, TabMWP, ASDiv, SingleEQ, SingleOP, AddSub, MultiArith).

Experimental results

Research questions

  • RQ1Does interleaving natural language rationales with program-based tool use improve mathematical reasoning on open-source LLMs?
  • RQ2Can imitation learning plus output space shaping close the gap to closed-source models on standard math benchmarks?
  • RQ3How does tool integration affect performance across model scales (7B–70B) and problem domains?
  • RQ4What are the main failure modes and challenges in tool-driven mathematical reasoning?

Key findings

  • ToRA and ToRA-Code consistently outperform prior open-source models across all scales on 10 math datasets, with 13%-19% absolute gains on average.
  • ToRA-70B outperforms WizardMath-70B on MATH by 22% absolute and is competitive with GPT-4 solutions that use code.
  • ToRA-Code-34B exceeds 50% accuracy on the MATH dataset, beating GPT-4 CoT results and competing with GPT-4 with code.
  • Output space shaping (sampling and correction) yields substantial gains, especially for smaller models, and improves MATH accuracy by up to 4.5% absolute.
  • The interleaved reasoning format (rationale + program + tool output) consistently outperforms rationale-only or program-only baselines, with notable gains across subtopics like Algebra and Precalculus.
  • ToRA achieves fast zero-shot inference with an average of 1.02 tool interaction rounds per problem.

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.