MathFimer: Enhancing Mathematical Reasoning by Expanding Reasoning Steps through Fill-in-the-Middle Task
On the map: LLM reasoning → Mathematical reasoning
Abstract (arXiv)
Mathematical reasoning represents a critical frontier in advancing large language models (LLMs). While step-by-step approaches have emerged as the dominant paradigm for mathematical problem-solving in LLMs, the quality of reasoning steps in training data fundamentally constrains the performance of the models. Recent studies have demonstrated that more detailed intermediate steps can enhance model performance, yet existing methods for step expansion either require more powerful external models or incur substantial computational costs. In this paper, we introduce MathFimer, a novel framework for mathematical reasoning step expansion inspired by the ''Fill-in-the-middle'' task from code reasoning. By decomposing solution chains into prefix-suffix pairs and training models to reconstruct missing intermediate steps, we develop a specialized model, MathFimer-7B, on our carefully curated NuminaMath-FIM dataset. We then apply these models to enhance existing mathematical reasoning datasets by inserting detailed intermediate steps into their solution chains, creating MathFimer-expanded versions. Through comprehensive experiments on multiple mathematical reasoning datasets, including MathInstruct, MetaMathQA and etc., we demonstrate that models trained on MathFimer-expanded data consistently outperform their counterparts trained on original data across various benchmarks such as GSM8K and MATH. Our approach offers a practical, scalable solution for enhancing mathematical reasoning capabilities in LLMs without relying on powerful external models or expensive inference procedures.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 44 of its 53 references that are in the map. First posted on arXiv 17 Feb 2025.
Builds on
44 of 53 references.
Closest ancestors · 10
Same direction, newest first
- 2025UGMathBench: A Diverse and Dynamic Benchmark for Undergraduate-Level Mathematical Reasoning with Large Language Models23 Jan
- 2025rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinking8 Jan
- 2024Unleashing LLM Reasoning Capability via Scalable Question Synthesis from Scratch24 Oct
- 2024Omni-MATH: A Universal Olympiad Level Mathematic Benchmark For Large Language Models10 Oct
- 2024OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction Data2 Oct
- 2024Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMs26 Jun
- 2024JiuZhang3.0: Efficiently Improving Mathematical Reasoning by Training Small Data Synthesis Models23 May
- 2024OpenMathInstruct-1: A 1.8 Million Math Instruction Tuning Dataset15 Feb
- 2024InternLM-Math: Open Math Large Language Models Toward Verifiable Reasoning9 Feb
- 2023OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text10 Oct
Other references · 34
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2023Let's Verify Step by Stepcited by 3,598
- 2023GPQA: A Graduate-Level Google-Proof Q&A Benchmarkcited by 2,748
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 1,980
- 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameterscited by 1,928
- 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,767
22 more
- 2024OlympiadBench: A Challenging Benchmark for Promoting AGI with Olympiad-Level Bilingual Multimodal Scientific Problemscited by 1,099
- 2024Qwen2.5-Math Technical Report: Toward Mathematical Expert Model via Self-Improvementcited by 1,057
- 2024Large Language Monkeys: Scaling Inference Compute with Repeated Samplingcited by 946
- 2023Math-Shepherd: Verify and Reinforce LLMs Step-by-step without Human Annotationscited by 895
- 2023MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Modelscited by 724
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 551
- 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 550
- 2023MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuningcited by 483
- 2025The Lessons of Developing Process Reward Models in Mathematical Reasoningcited by 402
- 2023Alphazero-like Tree-Search can Guide Large Language Model Decoding and Trainingcited by 291
- 2024Inference Scaling Laws: An Empirical Analysis of Compute-Optimal Inference for Problem-Solving with Language Modelscited by 282
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2024Are We Done with MMLU?cited by 178
- 2024AlphaMath Almost Zero: Process Supervision without Processcited by 160
- 2024The Impact of Reasoning Step Length on Large Language Modelscited by 152
- 2023Don't throw away your value model! Generating more preferable text with Value-Guided Monte-Carlo Tree Search decodingcited by 59
- 2024MathOdyssey: Benchmarking Mathematical Problem-Solving Skills in Large Language Models Using Odyssey Math Datacited by 51
- 2025UGPhysics: A Comprehensive Benchmark for Undergraduate Physics Reasoning with Large Language Modelscited by 45
- 2024Autonomous Data Selection with Zero-shot Generative Classifiers for Mathematical Textscited by 26
- 2024Can LLMs Solve longer Math Word Problems Better?cited by 22
- 2024S^3cMath: Spontaneous Step-level Self-correction Makes Large Language Models Better Mathematical Reasonerscited by 17
- 2024Can We Verify Step by Step for Incorrect Answer Detection?cited by 15
Built on by
Citing papers per year: 2025: 3; 2026: 2.
5 papers.
- 2025Let LRMs Break Free from Overthinking via Self-Braking Tuningcited by 27
- 2025GSM8K-V: Can Vision Language Models Solve Grade School Math Word Problems in Visual Contextscited by 8
- 2025Mind the Gap: Bridging Thought Leap for Improved Chain-of-Thought Tuningcited by 2
- 2026Pause or Fabricate? Training Language Models for Grounded Reasoningcited by 2
- 2026Imbuing Large Language Models with Bidirectional Logic for Robust Chain Repaircited by 0
- 2026Imbuing Large Language Models with Bidirectional Logic for Robust Chain Repair3 Jun 2026
- 2026Pause or Fabricate? Training Language Models for Grounded Reasoning21 Apr 2026
- 2025GSM8K-V: Can Vision Language Models Solve Grade School Math Word Problems in Visual Contexts29 Sep 2025
- 2025Mind the Gap: Bridging Thought Leap for Improved Chain-of-Thought Tuning20 May 2025
- 2025Let LRMs Break Free from Overthinking via Self-Braking Tuning20 May 2025
Similar, not cited
Close in wording, no citation either way
- 2024Step Guided Reasoning: Improving Mathematical Reasoning using Guidance Generation and Step Reasoning
- 2025A Survey on Large Language Models for Mathematical Reasoning
- 2026Mathematical Reasoning in Large Language Models: Benchmarks, Architectures, Evaluation, and Open Challenges
- 2025MathFusion: Enhancing Mathematical Problem-solving of LLM through Instruction Fusion
- 2024MATHSENSEI: A Tool-Augmented Large Language Model for Mathematical Reasoning
- 2025Step-KTO: Optimizing Mathematical Reasoning through Stepwise Binary Feedback
- 2024MathCoder2: Better Math Reasoning from Continued Pretraining on Model-translated Mathematical Code
- 2025A Survey on Feedback-based Multi-step Reasoning for Large Language Models on Mathematics