arXiv:2610.01729cs.LGOct 2026

Manuscript Offprint

arXiv:2610.01729

Function-Structured Reinforcement Learning with Executable Verifiers for Mathematical Reasoning

Zihan Liu, Xurong Xie

ABSTRACT

Algorithmic mathematical reasoning requires reliable decomposition, computation, and aggregation. Final-answer rewards provide limited guidance on intermediate errors, while successful execution does not guarantee mathematical correctness. This work proposes Function-Structured Graph Reinforcement Learning (FSG-RL), connecting subproblem graphs and Python implementations with multi-verifier feedback. The policy first learns to generate code from function graphs through supervised fine-tuning (SFT). Group Relative Policy Optimization (GRPO) then optimizes the policy using answer-gated rewards and span-level credit assignment. The framework also supports teacher supervision and structured memory. A benchmark curated from Grade School Math 8K (GSM8K), MathQA, MATH, and Omni-MATH pairs public function graphs with private verification specifications. Under a unified evaluation protocol, GRPO improves final-answer accuracy from 43.25% to 67.50% and full solution success from 32.25% to 52.25% over SFT. Continued reinforcement learning (RL) with teacher supervision yields additional gains. The gains extend beyond producing correctly formatted code, supporting verifier-guided reinforcement learning for mathematical reasoning. Code is available at https://github.com/ZihanLiummyycc/FSG-RL.

Index Terms— reinforcement learning, mathematical reasoning, program verification, credit assignment, language agents

1. INTRODUCTION

This study examines mathematical problems that require reasoning and computation. Problems are selected from four datasets to cover different types and difficulty levels: multistep arithmetic in GSM8K [1], word problems involving mathematical operations in MathQA [2], algebra, number theory, counting, and probability in selected Level 1–3 MATH problems [3], and more demanding competition problems in Omni-MATH [4]. Solving these problems requires identifying useful subproblems, implementing their computations, and combining intermediate results into a final answer.

Prior work has improved how models organize complex reasoning. Least-to-most prompting [5] breaks a problem into simpler subproblems and solves them sequentially using earlier answers. Graph of Thoughts [6] extends this structure to graphs that support aggregation and refinement. These approaches make reasoning dependencies explicit but lack testable function interfaces for intermediate computations. DeepSeek-Prover-V2 [7] connects subgoal decomposition with formal verification in Lean. It demonstrates the value of checkable subgoals through formal proof verification, whereas this work checks the behavior of Python implementations.

Tool-integrated methods address the computational side of reasoning. PAL (Program-aided Language Models) [8] delegates computation to a Python interpreter, while ReAct (Reasoning and Acting) [9] interleaves reasoning and actions to incorporate environmental feedback. ToRA (Tool-integrated Reasoning Agents) [10] develops tool-integrated mathematical reasoning, and MathCoder [11] trains models on interleaved natural language, code, and execution results. ReTool [12] further uses outcome based reinforcement learning to learn when and how to invoke computational tools. These methods reduce the burden of computation and improve tool use. However, an execution result alone does not establish whether a function correctly implements the intended computation or whether its output is correctly combined with other results. This motivates checks of intermediate behavior and subproblem consistency.

A complementary line of work improves training feedback. DeepSeekMath [13] introduces GRPO for reinforcement learning in mathematical reasoning. Lightman et al. [14] show the value of supervising intermediate reasoning steps through learned reward models. Subproblem Curriculum Reinforcement Learning (SCRL) [15] constructs verifiable subproblems and assigns normalized advantages to their corresponding answer spans. These advances provide finer learning signals than a final outcome alone. For executable mathematical reasoning, the remaining question is how to connect such local credit to function behavior, dependency consistency, and final-answer correctness.

This paper proposes Function-Structured Graph Reinforcement Learning (FSG-RL), a framework that connects these elements. Subproblems form a typed dependency graph, with public Python interfaces for executable nodes and private verification specifications. Under this structure, the policy is first trained through SFT to construct function graphs and generate code, and then optimized with GRPO using rewards derived from program execution, unit and property tests, dependency checks, and final outcome verification. Answer gating reduces the weight of intermediate step rewards when the final answer is incorrect. Furthermore, Span-level credit assignment provides verification based learning signals for the corresponding code spans. Our contributions are threefold:

  • This paper proposes a novel function-structured framework for mathematical reasoning. It connects subproblem graphs, Python implementations, and multi-verifier feedback, integrating staged SFT-to-RL training with modular teacher supervision and structured memory.

• A curated benchmark for executable mathematical reasoning is released. Public function graphs and private verification specifications support an evaluation of interface compliance,

∗^{*}Corresponding author: Xurong Xie.

Figure

Fig. 1. Overview of FSG-RL. The core pipeline connects function graphs, executable solutions, and verifier-guided learning. Memory retrieval and teacher supervision provide modular extensions.

functional correctness, and complete solution success.

• The experiments show that verifier guided GRPO improves solution correctness beyond the interface compliance established by SFT. The trained Qwen3.5-9B policy outperforms the Qwen3.8-27B application programming interface (API) reference for all outcome metrics. Teacher supervision provides additional observed gains.