Understanding Tool-Integrated Reasoning

Heng Lin, Zhongwen Xu · DOI

Abstract

While Large Language Models (LLMs) have demonstrated impressive empirical gains when integrated with tools like Python interpreters, the theoretical basis for this improvement has remained under-explored. This paper provides a formal framework for understanding Tool-Integrated Reasoning (TIR), proving that tools fundamentally expand a model's "support"—the set of reachable reasoning paths. We introduce Advantage Shaping Policy Optimization (ASPO) to foster earlier and more frequent tool use. Our results on challenging mathematical benchmarks, including AIME and Omni-MATH, show that TIR models not only outperform pure-text baselines but also exhibit novel cognitive patterns like hypothesis testing and algorithmic offloading.

Introduction: Breaking the "Invisible Leash"

A significant challenge in Reinforcement Learning (RL) for LLMs is the "invisible leash" effect: RL typically improves a model's ability to navigate its existing reasoning space but struggles to help it discover entirely new strategies. This paper investigates whether tool integration can break this leash. By allowing models to interact with a deterministic environment (e.g., a code interpreter), we hypothesize that LLMs can access solutions that are statistically impossible to generate through pure text.

Theoretical Framework: Support Expansion and Token Efficiency

Support Expansion

We formally prove that TIR models benefit from Support Expansion. In a pure-text setting, a model is limited by the probability distribution of its training data. By introducing non-linguistic state transitions—where a tool's output becomes part of the context—the model can reach "correct" states that were previously outside its support.

Token Efficiency and Feasible Support

Beyond theoretical reachability, there is the practical constraint of Feasible Support. Many algorithmic tasks, such as large-scale searches or complex linear algebra, are theoretically possible in natural language but require a prohibitive number of tokens ($O(N)$ or higher). Tools allow these computations to be compressed into $O(1)$ token costs.

Comparison of token efficiency between programmatic and natural language reasoning.

As illustrated above, a programmatic approach maintains a constant token cost regardless of the problem's magnitude ($N$), whereas natural language reasoning scales linearly, eventually exceeding the model's context window and becoming intractable.

Methodology: Advantage Shaping Policy Optimization (ASPO)

To maximize the benefits of TIR, models must learn when to invoke tools. Traditional reward shaping—adding a fixed bonus for code usage—often leads to training instability. We propose Advantage Shaping Policy Optimization (ASPO). ASPO modifies the advantage function directly with a controllable bias, encouraging the model to "think with tools" earlier in the reasoning process without compromising the final accuracy of the solution.

Experimental Results

We evaluated our approach using the Qwen3-8B model on several rigorous benchmarks:

  • AIME 2024/2025: TIR models consistently outperformed pure-text baselines.
  • Omni-MATH-512: On this subset of highly difficult, abstract problems, the TIR model solved 15.4% of problems that were unsolvable by the pure-text model, demonstrating a clear expansion of capability.

Behavioral Shifts with ASPO

ASPO significantly altered the model's reasoning behavior. The average position of the first code call moved from 4,000 tokens to 1,000 tokens, and the number of code rounds per problem increased from 1.3 to 3.3. This shift transforms the model from a "late-stage calculator" into an "interactive partner" that uses the interpreter to test hypotheses and refine strategies mid-reasoning.

Cognitive Patterns in TIR

Our analysis identified three distinct ways models utilize tools:

  1. Insight-to-Computation: Applying a high-level mathematical theorem to simplify a problem before delegating the final calculation to code.
  2. Exploration & Verification: Using the interpreter as a sandbox to verify intermediate steps or test edge cases.
  3. Offloading: Delegating tedious, error-prone steps to the tool to maintain the coherence of the overall reasoning chain.

Conclusion

Tool-Integrated Reasoning is more than just a performance booster; it is a fundamental expansion of what LLMs can compute. By breaking the "invisible leash" through support expansion and token efficiency, and by utilizing stable training methods like ASPO, we can develop models that are more capable, interactive, and efficient at solving the world's most challenging abstract problems.

Summary updated

BibTeX
@inproceedings{lin2025understanding,
  author = {Heng Lin and Zhongwen Xu},
  title = {{Understanding Tool-Integrated Reasoning}},
  booktitle = {MATH-AI @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=FfNkH9Znm5},
}
Figure