Making Mathematical Reasoning Adaptive

Zhejian Lai, Xiang Geng, Zhijun Wang, Yang Bai, Jiahuan Li, Rongxiang Weng, Jingang Wang, Xuezhi Cao, Xunliang Cai, Shujian HuangarXiv 2025 · DOI

Abstract

Large Language Models (LLMs) frequently solve mathematical problems by memorizing superficial patterns rather than internalizing underlying logic—a phenomenon termed "spurious reasoning." This paper introduces AdaR (Adaptive Reasoning), a framework designed to foster robust mathematical understanding. By synthesizing logically equivalent problems with varied numerical values and employing Reinforcement Learning with Verifiable Rewards (RLVR), AdaR compels models to rely on invariant algebraic logic. Experimental results demonstrate a significant performance boost, with an average improvement of +8.50 points across benchmarks and a leap from 42.84% to 75.90% on the challenging MATH dataset.

Introduction

Despite their prowess, mathematical LLMs remain brittle. A minor numerical change in a word problem can lead to failure, even when the logic remains constant. This brittleness stems from spurious reasoning: models often bypass the causal logical path ($L$) from variables ($x$) to answers ($y$), instead jumping directly from text features to a predicted result. AdaR addresses this by forcing models to identify the "rules" of the problem that persist across numerical variations.

The AdaR Framework

The AdaR framework utilizes a multi-stage pipeline to transition models from pattern matching to logical reasoning.

Data Synthesis and Logic-to-Code

To ensure ground-truth accuracy across variations, AdaR employs a teacher LLM to translate natural language reasoning into executable Python code. This code represents the immutable problem-solving logic ($L$). By perturbing variables within a defined range (e.g., $\pm \alpha\%$), the system generates a suite of logically identical but numerically distinct problem variants.

Rigorous Sanity Checks

To maintain data quality, three validation steps are performed:

  1. Variable Alignment (VA): Ensures consistency between text and code variables.
  2. Executable Code (EC): Verifies the Python script correctly reproduces the original answer.
  3. Existence of Valid Solution (EVS): Cross-validates variants with an independent LLM to ensure they remain solvable.
Overview of the AdaR framework, illustrating the transition from spurious to adaptive reasoning through logic-based data synthesis and reinforcement learning.

Reinforcement Learning with Verifiable Rewards (RLVR)

The core of AdaR's training is a comparative RLVR approach. By training on batches containing both the original query and its perturbed variants, the model is penalized for spurious logic that fails on variants and rewarded for adaptive logic that succeeds across the entire set.

Experimental Results

AdaR was evaluated using 9,000 synthetic instances derived from ORCA-MATH across diverse benchmarks, including GSM8K, MATH, and AIME 2025.

Performance and Generalization

The framework achieved state-of-the-art robustness, outperforming existing synthesis methods like MetaMATH. Notably, on the Out-of-Domain MATH benchmark, the Qwen2.5-MATH-7B base model improved its score by over 33 percentage points.

Analysis shows that accuracy improves as the diversity of numerical perturbations ($\alpha$) and the sampling frequency increase. Furthermore, the model exhibits strong scaling behavior, where In-Domain (ID) and Out-of-Domain (OOD) performance both rise predictably with data size.

Analysis of accuracy trends relative to perturbation intensity, sampling frequency, and training data size.

Discussion: The Shift to Algebraic Thinking

Training with AdaR induces a fundamental shift in model behavior. The presence of structural, code-like reasoning steps increased from 55% to 90%, suggesting models began treating numbers as variables. This is further supported by the Influence to Logical Order (ILO) metric; AdaR models showed significantly higher sensitivity to the sequence of reasoning steps, proving a stricter adherence to logical flow.

Conclusion

AdaR demonstrates that high-quality, logically-grounded synthetic data is a powerful lever for improving LLM reasoning. By prioritizing "algebraic thinking" over pattern memorization, the framework significantly enhances both robustness and generalization. Future work will focus on scaling the complexity of the underlying logic ($L$) itself to handle even more sophisticated mathematical challenges.

Summary updated

BibTeX
@misc{lai2025making,
  author = {Zhejian Lai and Xiang Geng and Zhijun Wang and Yang Bai and Jiahuan Li and Rongxiang Weng and Jingang Wang and Xuezhi Cao and Xunliang Cai and Shujian Huang},
  title = {{Making Mathematical Reasoning Adaptive}},
  year = {2025},
  eprint = {2510.04617},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.04617},
}
Figure