mlsanityData to 7 Oct 2026

Teaching Language Models to Think in Code

arXiv 2605.07237 ↗First posted 8 May 2026cs.CLcited by 1

On the map: LLM reasoning → Reasoning for agents, planning and code

also in 1 more
Abstract (arXiv)

Tool-integrated reasoning (TIR) has emerged as a dominant paradigm for mathematical problem solving in language models, combining natural language (NL) reasoning with code execution. However, this interleaved setup has three key limitations: code often acts as a post-hoc verifier, intermediate NL computations are error-prone, and NL and code play overlapping rather than clearly distinct roles. We propose ThinC (Thinking in Code), a framework in which code itself serves as the reasoner rather than as a tool invoked by NL. A ThinC trajectory begins with a brief NL planning step, after which all reasoning unfolds through code blocks connected only by their execution outputs. We distill 12.2k code-centric trajectories from a teacher model and train ThinC-1.7B and ThinC-4B with supervised fine-tuning followed by reinforcement learning. ThinC-4B consistently outperforms every TIR baseline on five competition-level math benchmarks and even surpasses the much larger Qwen3-235B-A22B-Thinking. Further analysis shows that ThinC reasons through code: 99.2% of its final answers are grounded in interpreter output, and the model recovers reliably from code execution failures without intermediate NL reasoning. Our code and models will be released soon.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 19 of its 24 references that are in the map. First posted on arXiv 8 May 2026.

Builds on

19 of 24 references.

Closest ancestors · 6

Same direction, newest first

  1. 2026ASTER: Agentic Scaling with Tool-integrated Extended Reasoning1 Feb
  2. 2025Demystifying Reinforcement Learning in Agentic Reasoning13 Oct
  3. 2025Tool-Star: Empowering LLM-Brained Multi-Tool Reasoner via Reinforcement Learning22 May
  4. 2025ReTool: Reinforcement Learning for Strategic Tool Use in LLMs15 Apr
  5. 2025OpenCodeReasoning: Advancing Data Distillation for Competitive Coding2 Apr
  6. 2024OpenAI o1 System Card21 Dec

Other references · 13

  1. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  2. 2025Qwen3 Technical Reportcited by 8,195
  3. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  4. 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,678
  5. 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 1,980
  6. 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,442
  7. 2025gpt-oss-120b & gpt-oss-20b Model Cardcited by 1,258
  8. 2022PAL: Program-aided Language Modelscited by 635
  9. 2025AIMO-2 Winning Solution: Building State-of-the-Art Mathematical Reasoning Models with OpenMathReasoning datasetcited by 165
  10. 2025Skywork Open Reasoner 1 Technical Reportcited by 161
  11. 2025Seed1.5-Thinking: Advancing Superb Reasoning Models with Reinforcement Learningcited by 159
  12. 2025rStar2-Agent: Agentic Reasoning Technical Reportcited by 54
1 more
  1. 2025Teaching Language Models to Reason with Toolscited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026Think Multilingual, Not Harder: A Data-Efficient Framework for Teaching Reasoning Models to Code-Switch
  2. 2026Exploring Extrinsic and Intrinsic Properties for Effective Reasoning with Code Interpreter
  3. 2025CoRT: Code-integrated Reasoning within Thinking
  4. 2025To Code or not to Code? Adaptive Tool Integration for Math Language Models via Expectation-Maximization
  5. 2025Code-enabled language models can outperform reasoning models on diverse tasks
  6. 2026Is Code Better Than Language for Algorithmic Reasoning
  7. 2026What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code
  8. 2025Understanding Tool-Integrated Reasoning