BackMATH: Towards Backward Reasoning for Solving Math Problems Step by Step

Shaowei Zhang, Deyi XiongCOLING 2025

Abstract

Large Language Models (LLMs) often struggle with multi-step mathematical reasoning, frequently falling victim to logical hallucinations where intermediate steps do not follow from premises. This paper introduces BackMATH, a novel framework designed to instill "backward reasoning" capabilities—the ability to verify solutions by working from the target answer back to the initial conditions. By developing a specialized dataset (BackMATH-Data) and a novel backward-reasoning process-supervision reward model (BackPRM), we demonstrate significant performance gains on GSM8K and MATH benchmarks, outperforming larger models like Llama-2-70B.

Introduction

While models like GPT-4 show impressive reasoning, they often lack a deep structural understanding of mathematical problems. These failures manifest as "hallucinations" or logical drift during long chains of thought. In contrast, humans often verify their work by working backward from an answer to see if the original conditions hold. Current LLMs lack this bidirectional capability, making them prone to errors in complex, multi-step scenarios. BackMATH addresses this by teaching models to think in reverse, treating the original answer as a condition and a starting condition as the goal.

Methodology

Dataset Construction (BackMATH-Data)

The researchers reformulated existing math problems by swapping the target answer ($y$) with one of the initial conditions ($x_k$). For example, if a forward problem asks for the total cost of items, the backward version provides the total cost and asks for the quantity of one specific item.

The BackMATH data generation pipeline, illustrating the transformation of forward problems into backward reasoning tasks through rule application and iterative refinement.

This process involved a "Check and Rewrite" loop to prevent the "Cheating LLM" phenomenon, where models would simply rephrase the problem semantically rather than performing a true logical swap. The resulting dataset contains approximately 14K backward reasoning problems and 100K reasoning steps, derived from GSM8K and MATH training sets.

The Three-Stage Training Framework

To integrate backward reasoning into the model, a three-stage framework was employed:

  1. Supervised Fine-Tuning (SFT): A Llama-2-7B model was fine-tuned on pairs of original and backward problems to learn the format and logic of bidirectional reasoning.
  2. Reward Model Training: Two distinct reward models were developed:
  3. PRM (Process-supervision Reward Model): Evaluates the correctness of individual steps in a forward solution.
  4. BackPRM (Backward-reasoning PRM): Specifically evaluates the quality and logical consistency of backward reasoning steps.
  5. Reinforcement Learning (PPO): The model was optimized using Proximal Policy Optimization, where the final reward was a weighted average of the forward (PRM) and backward (BackPRM) scores.
The comprehensive three-stage BackMATH framework, encompassing Supervised Fine-Tuning (SFT), dual Reward Model training (PRM and BackPRM), and PPO-based reinforcement learning.

Key Results

The BackMATH-LLM (based on Llama-2-7B) achieved state-of-the-art performance for its size, outperforming several much larger models:

  • GSM8K: Achieved 68.1% accuracy, surpassing MetaMath (66.5%) and WizardMath-13B (54.9%).
  • MATH: Achieved 21.9% accuracy, beating MetaMath (19.8%) and the much larger Llama-2-70B (13.5%).

An ablation study confirmed that the BackPRM module was a critical "force multiplier." A model trained with standard SFT and PRM reached 15.1% on the MATH benchmark, but the addition of backward process supervision pushed that accuracy to 21.9%.

Discussion and Future Work

The results suggest that training a model to reason backward forces a deeper understanding of mathematical relationships rather than simple pattern memorization. However, limitations remain; the model still struggles with abstract "Intermediate Algebra" problems (6.6% accuracy). Future work will explore applying backward reasoning to non-mathematical domains like code generation and formal logic, where "reverse execution" could serve as a powerful debugging and verification tool.

Summary updated

BibTeX
@inproceedings{zhang2025backmath,
  author = {Shaowei Zhang and Deyi Xiong},
  title = {{BackMATH: Towards Backward Reasoning for Solving Math Problems Step by Step}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
}
Figure