Lune

NeurIPS2025Top-tier venue

Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning

Honglin Lin, Qizhi Pei, Zhuoshi Pan, Yu Li, Xin Gao, Juntao Li, Conghui He, Lijun Wu

Abstract

Reasoning capability is pivotal for Large Language Models (LLMs) to solve complex tasks, yet achieving reliable and scalable reasoning remains challenging. While Chain-of-Thought (CoT) prompting has become a mainstream approach, existing methods often suffer from uncontrolled generation, insufficient quality, and limited diversity in reasoning paths. Recent efforts leverage code to enhance CoT by grounding reasoning in executable steps, but such methods are typically constrained to predefined mathematical problems, hindering scalability and generalizability. In this work, we propose Caco (Code-Assisted Chain-of-ThOught), a novel framework that automates the synthesis of high-quality, verifiable, and diverse instruction-CoT reasoning data through code-driven augmentation. Unlike prior work, Caco first fine-tunes a code-based CoT generator on existing math and programming solutions in a unified code format, then scales the data generation to a large amount of diverse reasoning traces. Crucially, we introduce automated validation via code execution and rule-based filtering to ensure logical correctness and structural diversity, followed by reverse-engineering filtered outputs into natural language instructions and language CoTs to enrich task adaptability. This closed-loop process enables fully automated, scalable synthesis of reasoning data with guaranteed executability. Experiments on our created Caco-1.3M dataset demonstrate that Caco-trained models achieve strong competitive performance on mathematical reasoning benchmarks, outperforming existing strong baselines. Further analysis reveals that Caco's code-anchored verification and instruction diversity contribute to superior generalization across unseen tasks. Our work establishes a paradigm for building self-sustaining, trustworthy reasoning systems without human intervention.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • STaR: Bootstrapping Reasoning With Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites PAL: Program-aided Language Models
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning cites MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Models
  • MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Models cites MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning
  • PAL: Program-aided Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. ChartVerse: Scaling Chart Reasoning via Reliable Programmatic Synthesis from ScratchZheng Liu, Honglin Lin, Xiaoyang Wang, Xin Gao et al.ACL 2026 · 6 citations
  2. Tracing the Roots: A Multi-Agent Framework for Uncovering Data Lineage in Post-Training LLMsYu Li, Xiaoran Shang, Qizhi Pei, Yun Zhu et al.ACL 2026 · 1 citation

Builds on24

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. STaR: Bootstrapping Reasoning With ReasoningEric Zelikman, Yuhuai Wu, Jesse Mu, Noah D. GoodmanNeurIPS 2022 · 1,126 citations
  3. PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon et al.ICML 2023 · 700 citations
  4. MetaMath: Bootstrap Your Own Mathematical Questions for Large Language ModelsLonghui Yu, Weisen Jiang, Han Shi, Jincheng Yu et al.ICLR 2024 · 637 citations
  5. MAmmoTH: Building Math Generalist Models through Hybrid Instruction TuningXiang Yue, Xingwei Qu, Ge Zhang, Yao Fu et al.ICLR 2024 · 558 citations

Related papers

  1. CoT-RAG: Integrating Chain of Thought and Retrieval-Augmented Generation to Enhance Reasoning in Large Language ModelsFeiyang Li, Peng Fang, Zhan Shi, Arijit Khan et al.EMNLP Findings 2025 · 11 citations
  2. CodeIO: Condensing Reasoning Patterns via Code Input-Output PredictionJunlong Li, Daya Guo, Dejian Yang, Runxin Xu et al.ICML 2025
  3. Revisiting Chain-of-Thought in Code Generation: Do Language Models Need to Learn Reasoning before Coding?Renbiao Liu, Anqi Li, Chaoding Yang, Hui Sun et al.ICML 2025
  4. Large Language Models Meet Symbolic Provers for Logical Reasoning EvaluationChengwen Qi, Ren Ma, Bowen Li, He Du et al.ICLR 2025
  5. Automatic Prompt Augmentation and Selection with Chain-of-Thought from Labeled DataKashun Shum, Shizhe Diao, Tong ZhangEMNLP Findings 2023 · 63 citations
Dusk over the sea between two cliffs drawn in fine vertical lines