Mechanism

Supervises interleaved natural-language deduction and executable code/tool blocks: x→r1→a1(Python/SymPy/Bash)→obs1→r2→⋯→yx \rightarrow r_1 \rightarrow a_1 (\text{Python/SymPy/Bash}) \rightarrow \text{obs}_1 \rightarrow r_2 \rightarrow \dots \rightarrow y, masking environment execution outputs obst\text{obs}_t from the cross-entropy loss so the model learns when to offload symbolic/numerical computation and how to interpret stdout/stderr.

Practical Notes

Masking tool observation tokens (obs_t) during SFT is mandatory so the model does not learn to hallucinate fake interpreter outputs.

References

  1. ToRA: A Tool-Integrated Reasoning Agent for Mathematical Problem Solving ↗

    Zhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen, Yujiu Yang, Minlie Huang et al. · 2023

    All 8 authors

    Zhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen, Yujiu Yang, Minlie Huang, Nan Duan, Weizhu Chen

  2. OpenMathInstruct-1: A 1.8 Million Math Instruction Tuning Dataset ↗

    Shubham Toshniwal, Ivan Moshkov, Sean Narenthiran, Daria Gitman, Fei Jia, Igor Gitman · 2024