TL;DR
This paper introduces TRICE, a full-pipeline recipe for teaching large "thinking" models to naturally interleave natural-language reasoning with code execution (Tool-Integrated Reasoning). By carefully managing data curation, identifying an optimal "substance-focused" SFT checkpoint, and applying stable on-policy reinforcement learning, the authors achieve state-of-the-art math reasoning performance (e.g., 99.2% on AIME 2025) without degrading the models' native text-only capabilities.
What Problem Does This Paper Address?
Large language models with deep reasoning capabilities (like long Chain-of-Thought models) excel at complex tasks but struggle with precise numerical computation, symbolic manipulation, and systematic case enumeration. While giving these models access to a code executor (like a Python sandbox) seems like an obvious fix, naively doing so often breaks their internal reasoning logic.
Instead of seamlessly interleaving text and code, models either ignore the tool entirely or use it as a "final-pass verifier" at the very end of a flawed reasoning chain—a phenomenon known as the "delayed-code" pattern. This paper addresses how to successfully inject natural, multi-turn tool-use behavior into strong thinking models without causing catastrophic forgetting of their text-only reasoning skills.
Methods
The authors propose a comprehensive pipeline spanning three main stages:
- Data Engineering: They select a teacher model (GPT-OSS-120B) that demonstrates a high-frequency, lightweight tool-use pattern (short, incremental code snippets) rather than a heavyweight, self-contained program style, finding the former much more learnable for student models. They filter for "tool-advantaged" problems and mix tool-use trajectories with text-only trajectories to preserve native reasoning capabilities.
- Stage Coordination: They discover that SFT training follows a distinct form-substance-noise progression. Instead of picking a checkpoint based on the lowest training loss, they use
pass@kand response length to identify the exact moment the model has mastered the "substance" of tool use before it starts overfitting to teacher-side noise. - Stable Reinforcement Learning: To prevent training collapse under sparse, outcome-based rewards, they implement a stable Reinforcement Learning with Verifiable Rewards (RLVR) stage using Group-Sorted Policy Optimization (GSPO). Crucially, they use fully on-policy updates and Rollout Routing Replay ($R^3$) to handle the off-policy nature of external tool returns.
Datasets
- SFT Training: Curated from Nemotron-Math-v2 (~347K mathematical problems), filtered down to high-quality subsets (16K–32K trajectories) based on tool advantage and length constraints (<16K tokens).
- RLVR Training: A newly constructed dataset of 4,325 challenging, IMO-level math QA examples designed to provide a strong functional incentive for tool invocation.
- Evaluation Benchmarks: Evaluated on five competition-level math benchmarks: AIME 2025, HMMT 2025, BeyondAIME, IMOAnswerBench, and APEX 2025.
- Generalization Benchmarks: FrontierScience (scientific computation), GPQA-Diamond (knowledge-intensive QA), and LiveCodeBench (coding).
Key Insights and Ideas
- The "Delayed-Code" Trap: Naive models treat code executors as an afterthought rather than an active reasoning partner, often hard-coding flawed assumptions into a final verification step.
- Form $\rightarrow$ Substance $\rightarrow$ Noise: During SFT, models first mimic the form of tool use (leading to inefficient loops and drops in accuracy), then internalize the substance (where accuracy peaks), and finally overfit to teacher noise (increasing train-inference mismatch).
- Code as a Cognitive Tool: Analysis reveals that the code executor isn't just used as a calculator; in over 50% of solved cases, it is used for empirical discovery (pattern finding) and algorithmic search, which parameter scaling alone cannot replicate.
Key Results
- State-of-the-Art Performance: The resulting models, TRICE-4B and TRICE-30B, achieve state-of-the-art performance among open-source models of similar scale. TRICE-30B achieved an outstanding 99.2% on AIME 2025 and 92.5% on HMMT 2025, outperforming significantly larger text-only models like DeepSeek-V3.2-Thinking.
- Token Efficiency: TRICE consistently yields shorter overall responses than text-only baselines because code execution cleanly compresses lengthy manual arithmetic into concise snippets.
- Cross-Domain Generalization: Despite being trained only on math, TRICE showed strong performance gains on non-math benchmarks, including a +14.5% boost on FrontierScience for the 4B model.
Limitations and Future Work
This work primarily focuses on competition-level mathematics where outcomes are easily verifiable. The authors note that broader agentic settings—such as software engineering workflows and web interactions—remain underexplored. Additionally, the study was limited to 4B and 30B model scales; scaling up to substantially larger models might introduce different training dynamics or stability issues that require further systematic study.
Summary updated