TRICE: Bridging the Gap Between Thinking and Executing in Large Reasoning Models

Teaching Thinking Models to Reason with Tools: A Full-Pipeline Recipe for Tool-Integrated Reasoning

Qianjia Cheng, Yuchen Zhang, Zhilin Wang, Yuxin Zuo, Shunkai Zhang, Yuchen Fan, Yu Qiao, Bowen Zhou, Ning Ding, Yu Cheng, Yun Luo, Ganqu Cui
Summary
Problem
Method
Results
Takeaways
Abstract

This paper introduces TRICE, a full-pipeline recipe for Teaching thinking models Reasoning interleaved with Integrated Code Execution. By applying this systematic framework to Qwen3 models (4B and 30B), the authors achieve state-of-the-art results among open-source models, notably reaching 96.7% and 99.2% on AIME 2025.

TL;DR

The success of "thinking" models like DeepSeek-R1 and Qwen3-Thinking has proven that long Chain-of-Thought (CoT) is the key to complex reasoning. However, even the best models struggle with "formal" tasks like huge combinatorial searches or precise arithmetic. TRICE (Textual Reasoning Interleaved with Code Execution) provides the full-pipeline recipe to turn these thinkers into "doers." By interleaving natural language with Python execution, TRICE models reach a staggering 99.2% on AIME 2025, outperforming models nearly 10x their size.

The "Delayed-Code" Crisis: Why Thinking Models Underuse Tools

Most current models suffer from a fundamental bias: they treat code as an afterthought. Even when a Python sandbox is available, many models perform 10,000 tokens of fragile mental arithmetic only to call the tool at the very end to "verify" a likely incorrect answer.

The authors identify two core problems:

  1. Fragile Reasoning Chains: Prompting a strong thinking model with tool-use instructions often degrades its performance (the "text-only" accuracy drops).
  2. Pattern Improperly Learned: Models often "imitate" the form of tool-use (frequent calls) without understanding the substance (using execution results to pivot the reasoning).

Methodology: The TRICE Recipe

The paper's contribution is not just a model, but a systematic workflow for TIR (Tool-Integrated Reasoning).

1. Data Engineering: The Power of Lightweight Teachers

The authors discovered that teacher selection matters more than teacher accuracy. They compared "High-frequency, Lightweight" snippets (GPT-OSS-120B) against "Low-frequency, Heavyweight" programs (MiniMax-M2.7).

  • Insight: Lightweight snippets decompose complex problems into manageable steps that a 4B or 30B model can actually learn to generate and debug.
  • Tool-Advantaged Filtering: Only train on problems where tool-use actually outperforms text-only reasoning to ensure the model learns why it's using the tool.

2. The Form-Substance-Noise Progression

The paper provides a fascinating look into the SFT dynamics (see Image Below).

  • Stage 1 (Form): The model learns the syntax tool_code but fails the logic.
  • Stage 2 (Substance): Accuracy peaks. The model uses tools to solve sub-problems.
  • Stage 3 (Noise): The model starts overfitting to the teacher's idiosyncratic lengths, leading to RL collapse.

Model Architecture and Learning Stages Figure 1: Comparison between the "Delayed-Code" baseline (Left) and the TRICE interleaved pattern (Right).

3. Stabilizing RL for Tool Use

Training for TIR via Reinforcement Learning is notoriously unstable because the feedback from the sandbox (tool returns) is "off-policy" to the language model's weights.

  • Solution: Fully on-policy training combined with Rollout Routing Replay. This ensures the model doesn't "hack" the reward or collapse during multi-turn interactions.

Experiments: SOTA Achievement

TRICE models (4B and 30B) were tested on five competition-level math benchmarks.

SOTA Results Table Key Takeaway: TRICE-30B dominates the ~30B scale, significantly beating GLM-4.7-Flash and Nemotron-3-Nano.

Deep Insight: Code as a Cognitive Tool

The authors didn't just look at accuracy; they analyzed what the code does. They categorized tool use into:

  1. Empirical Discovery: Testing small cases to find a pattern.
  2. Algorithmic Search: Brute-forcing combinatorial spaces.
  3. Computation Offloading: Arithmetic and symbolic algebra.
  4. Conjecture Verification: Checking intermediate steps.

Discovery and Search are the biggest winners. TIR allows a 30B model to solve problems that a 235B model cannot, simply because some math problems require "searching" an area too wide for text-only simulation.

Conclusion & Limitations

TRICE proves that for "thinking" models, the tool is not just a calculator—it's an extension of the working memory and the "policy head." By following a rigorous pipeline of tool-advantaged SFT and stabilized RL, the reasoning frontier can be pushed much further without exponentially increasing parameter counts.

Limitations: The current recipe is math-heavy. Future work is needed to see if this "interleaved" pattern transfers to more subjective agentic tasks like web browsing or software engineering where "verifiable rewards" are harder to define.

Find Similar Papers

Try Our Examples

  • Search for recent papers that specifically address the 'delayed-code execution' or 'late-calling' problem in LLM-based tool use.
  • Examine the relationship between 'catastrophic forgetting' in reasoning models and the ratio of SFT data mixing for multi-modal reasoning tasks.
  • Identify recent studies that use 'rollout routing replay' or similar on-policy stabilization techniques for RL involving non-differentiable external environments.
Contents
TRICE: Bridging the Gap Between Thinking and Executing in Large Reasoning Models
1. TL;DR
2. The "Delayed-Code" Crisis: Why Thinking Models Underuse Tools
3. Methodology: The TRICE Recipe
3.1. 1. Data Engineering: The Power of Lightweight Teachers
3.2. 2. The Form-Substance-Noise Progression
3.3. 3. Stabilizing RL for Tool Use
4. Experiments: SOTA Achievement
5. Deep Insight: Code as a Cognitive Tool
6. Conclusion & Limitations