Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning
Authors: Honglin Lin
Qizhi Pei
Zhuoshi Pan
Yu Li
Xin Gao
Juntao Li
Conghui He
Lijun Wu
Venue: NeurIPS 2025 poster ()
Keywords: Data Synthesis
Reasoning
Primary area: deep_learning

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 \texttt{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, \texttt{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 \texttt{Caco}-1.3M dataset demonstrate that \texttt{Caco}-trained models achieve strong competitive performance on mathematical reasoning benchmarks, outperforming existing strong baselines. Further analysis reveals that \texttt{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.

Scaling Code-Assisted Chain-of-Thought and Instructions for Model Reasoning
Honglin Lin! Qizhi Pei Zhuoshi Pan Yu Li,, Xin Gao 1.2,
Juntao Li Conghui He², Lijun Wu
Shanghai Jíao Tong University "Shanghai Artificial Intelligence Laboratory
Tsinghua University *Renmin University China *Soochow University
[linhonglin, juahhoggghhhhullljjjja//appaaaa www.:pjllb.......ommmmm
Abstract
Reasoning capability is pivotal for Large Language Models (LLMs) to solve com- plex tasks, yet achieving reliable and scalable reasoning remains challenging. While Chain-of- Theuughh (CoT) prompting has become 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 gen- eralizability. this work, we propose Caco (Code-Assistee Chain-of- Thhhgh,, novel framework that automates the synthesis of high-quality, verifiable, and diverse instruction-Ce CoT reasoning data through code-driven augmentation. Unlike prior work. Caco first fine-tunes programming solutions in unified code format, then scales the data generation large amount of diverse reasoning traces. Crucially, introduce automated validation via code execution and rule-based filtering to ensure logical correctness and structural diversity, followed by eeggeeeennineriing filtered outputs into nat- ural language instructions and language CoT's 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 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 es- tablishes a paradigm for building self sustainnn,,, trustworthy reasoning systems without human intervention.
aade-based CoT generator existing math and
Olympaid
Average
MettHooth
Dantovm
Mitsklot
bantiohh
67.7
$5.0
14.3
543
32
29.5
47.2
21.7
45
33.1
32
Figure 1: Overview of Caco results. Caco shows superior performance Olympiad Bench and on average than baseline methods.
Equal contribution. Corresponding author.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

Introduction
The advent of Large Language Models (LLMs) 44 32 35
has revolutionized domains requiring complex reasoning, such as mathematics, code, and algorithmic problem-solving [42 15 T
Recent
LLMs demonstrate remarkable capabilities in generating step-by-step solutions through Chain-of- prompting, where intermediate reasoning steps are explicitly articulated
Thought (CoT) 42 25
45]
before final answers. This paradigm has become instrumental in tasks like mathematical problem solving and program synthesis, where systematic logic decomposition is critical. A prevalent strategy involves generating long CoT sequences 22
to mimic human-like deliberation.
However, these CoT approaches predominantly rely on natural language reasoning traces, which suffer from several limitations. (1) Umverifiability, since natural language reasoning not executable, emoos in intermediate steps may propagate and lead to incorrect conclusions; (2) Scalability constraints, high-quality CoT data typically requires manual annotation, making it difficult to scale to diverse problem domains.
To address these issues, recent works have explored code-assisted reasoning [T] reasoning steps are grounded in executable code snippets (e.g.. Python codes or algorithm sketches). By translating natural language logic into formal code, these methods enable automatic verification through code execution. Preliminary studies [T] demonstrate that code-verified CoT can reduce hallucination and improve answer accuracy. However, existing implementations struggle generalize beyond predefined mathematical problems, limiting their adaptability and scalability [39] [0].
10) where
In this work, we introduce Caco, scalable cose-assisted CoT and instruction generation framework designed to automate the production of high-quality reasoning training data through code-anchored refinement. A core innovation of Caco lies in its fine-tuning of a base LLM on compact set of structured code CoT demonstrations, enabling the model to learn systematic code reasoning solutions. Leveraging this fine-tuned LLM, we generate large-scale candidate code-based CoT solutions, which are subsequently refined via an automated verification engine. This engine executes code snippets, verifies logical consistency, and enforces diversity in reasoning patterns. Finally, the validated code solutions are translated back into natural language instructions and the corresponding language CoTs, yielding perruction-aligned data pairs that establish bidirectional alignment between code and textual reasoning paths. The Caco generated natural language CoT offers several advantages. (1) Scalability: Through these model-generated synthetic code COT's, we eliminate reliance on manual annotation of the aligned language CoTs, enabling the creation of millions of high-quality reasoning traces (e.g.. our Caco- 1.3M dataset); (2) Verifiability: Not only are the answers guaranteed to be correct for the augmented instructions, but the executable and automatic validation of intermediate steps of Code CoT's also ensures the aligned language CoTs to be correct solutions. (3) Diversity: By harnessing the fine-tuned LLM's generative capacity and sampling mechanism, Caco produces varied reasoning paths well as the instructions, enhancing generalization across different problem types.
We evaluate Caco through extensive experiments on standard mathematical reasoning benchmarks. Models fine-tuned using our Caco- 1.3M dataset achieve strong competitive performance; for exam- ple, attaining 92.6% accuracy on GSM8K and 82.4% on MATH, significantly outperforming prior approaches. Caco also exhibits strong generalization, the trained model maintains 67.7% accuracy on average over multiple benchmarks, surpassing comparable methods by a margin exceeding 7.9%. Fur- ther analysis confirms that Caco-generated CoT data preserves high diversity and scalability. Beyond advancing superior performance in mathematical reasoning, our work establishes a generalizable framework for developing self-improving and verifiable LLMs across algorithmic domains.
2 Related Work
2.1 Data Augmentation for Mathematical Reasoning
A wide range of recent efforts have explored different strategies for constructing instruction-tuningg datasets tailored to mathematical reasoning 41 20 46). For example, WizardMath (25), Meta- Math [45]. Orca-Math (28). MMIQC [21], and MathFusion 30 enhance answers and rationales for seed problems through prompt engineering and reinforcement learning techniques. KPMath [16). MathScale (34), and ScaleQuest [8] generate new problems from scratch by extracting mathematical concepts and topical structures. MHmooTH2 [47] and Numina- Math [T8 construct instruction-tuning datasets by collecting and curating large-scale data from the web. DART-Math (38) applies rejection

---

Unifying Code CoT
Code CoT Filtration
Scaling Code CoT
Algoritim Solutions
Executobliitty
</>
Efficiency
Refoctor
</>
Length
Manhematical Proclems
CodeGen
AST Anclysis
Generate Code CoTs
Consistency
Instruction Reversal and CoT Generation
Caco Data Model
Symthesized Problems
Longuage Generation
VS
VS
Finstuning
Original
Consistencyy
Figure 2: An overview framework of Caco data generation, including unifying Code CO',, scaling Code CoT with CodeGen, and instruction reversal and language CoT generation.
sampling based problem difficulty to ensure the quality of generated solutions. Caco also falls within this scope and uses code as a scalable medium to generate diverse mathematical problems.
2.2 Code Integration for Enhanced Reasoning
LLMs often make calculation errors in complex mathematical reasoning (c.g., computing cigenvalues) when using CoT prompting 3 19. To address this, methods such Program of Thoughts (PoT) (3, Program-Aide Language models (PAL) [9], and Code-based Self- Verification (CSV) [50] are pro- posed to prompt LLMs generate executable code, leveraging external code interpreters for accurate computation. As open-source models improve, code-integrated data for post-training has gained attention. OpenMathInstruut- [39], TORA [TO] MathCoder [41 22],, MegaMath (51), and Dota- Math 17 embed code within natural language, enabling more robust reasoning. MAmmoTH [46] introduces MathInstruct, hybrid of CoT and PoT datasets, allowing for different reasoning strategies for different problems. rStar-Math [|] generates paired natural language rationales and Python code, keeping only verified executable steps. Codel/O [9 distills diverse reasoning patterns embedded in code by transforming it into a code input-output prediction format. MathGenie (23) synthesizes math problems and code-integrated solutions through solution augmentation, question back-translation. and verification- based filtering. Unlike previous works, our Caco leverages a code generation model ensure both scalability and verifiability, while additionally introducing algorithmic problem types to promote greater diversity in problem coverage.
3 Method
Overview. Figure presents the overall framework of Caco. We begin by abstracting each prob- lem's 's solution into an executable code template. Based on this, we fine-tune problem generation model (CodeGen) learn diverse reasoning strategies by extending these templates. Sampling from the trained model yields large number of new programs, each representing unique solution pattern for a particular family of problems. Each code pattern problems and corresponding step-by-ste solutions. Only the instances where the natural language answer matches the code output are retained. Details regarding the prompt formulations, model specifications, and the criteria for filtering Code CoT's are provided in Appendix A
taacssransltted into concrete mathematical
3.1 Unifying Code CoT
To improve the quality, consistency, and verifiability of CoT reasoning for math problems, we explore unified Code CoT representation. Motivated by prior findings that code data can enhance mathematical reasoning in language models 4 466, collect and standardize Code CoTs from both

---

mathematical and algorithmic domains. Specially, we use general LLM Gp-c:: P + C to map each problem p code and an executor that returns the correct answer a" upon running c. We retain only verified traces; namely, the seed set is Creed { pGp-eel) F(c) = a" This unified representation not only improves interpretability and execution fidelity but also lays the groundwork for scalable data generation and model training.
We collected broad set of mathematical problems from multiple sources to ensure diversity, such as the MATH dataset [44] (7.5K), DeepScaleR [26] (40K), and BigMath 2 (251K). These problems vary in complexity and format; some are accompanied by natural language CoT explanations, while others are not. To unify their representation, we convert each solution into structured Python program following a generic template (See Prompt[]. This template encodes problem inputs as dictionaries and defines problem-solving logic through explicit function calls. It supports wide range of reasoning types- arithmetti,,, algebraic, geometric, probabilistic-wve enabling direct execution for correctness verification.
Mathematical Problems.
For example, consider the problem:
George has an unfair six-sided die. The probability that it rolls a is 2. and the probubility that it rolls any other number is 10- What is the expected value of the number shown when this die is rolled?
We transform its solution into the following code representation:
def expactad_ value (prohabilities values): return aum (p for P. in asp(probabiiittes, values))
probabilities [1/10, 1/10, 1/10, 1/10, 1/10, 1/2] Probabilities for 1, 2, 3, 4, 5, 6
values [1, 2, 3, 4, 5, 6] a Values on the die
input = ("probabilitiess output expected, value print print (output)
probabilities, "values": valuea)
This standardized representation ensures structural consistency across different problem types and facilitates easier interpretation by both models and humans.
Algorithmic Problems. In parallel, we incorporate algorithmic problems as an additional source of structured reasoning. We sample 40K problems from the Kodcode 43 dataset, covering key algorithmic domains such as sorting, searching, and dynamic programming. These problems typically come with code-level solutions and brief natural language comments, providing native form of Code COT. To ensure consistency across data sources, we normalize all algorithmic solutions into the same Python-based template used for mathematical problems. This standardization enables joint training and evaluation under a single format. The conversion prompts are described in Prompt 2
Unified Seed Code CoTs. After Code CoT generation, we perform rigorous post-processing to ensure quality. Following the procedure described in Section A.4, we validate each code sample through execution: only programs that run successfully, produce correct outputs, and conform to standardized format are retained. This filtering yields a curated seed corpus of 146K high- quality Code CoT instances (122K Math + 24K Code). Among these, 109K problems originally had solutions, which we refer to as Seed1099 in the experiments. The resulting dataset provides a robust foundation for training models to enable effeccive generation of verifiable and scalable CoT reasoning in executable form Section
3.2 Scaling Code CoT with CodeGen
To scale the generation of high-quality code-based reasoning chains, we leverage the seed Code CoT dataset introduced previously to train a dedicated Code CoT generation model, CodeGen, so as to enable automated synthesis of executable, diverse, and logically coherent Code CoT's at scale. By training a model internalize the structure and logic of our unified format, we facilitate the creation of new reasoning traces without relying costly human annotations handcrafted solutions.

---

Problom: George unfair siz siz-sided The probability 50hs:1112/S probubility rolls number 1/ Whot expecsed masber shows when milled? Eugrear decwall
Safution: expected (111mec(21111011) ((rae(11(1011) 1(pon(11100()) (faae13(111(0) (frac(12(10(()) (frrc(1317200) (8ac(155(19) (bauedi4.5).
Code:
Generated Code:
dee expected valonpprebabiliies values): netum sumip "y for p, appprobabiliiis, values))
expec ted, wewaaaaaaaannllllllo expected value single overage possible outcomes a
ded
Define the probebilities and probabiltties 12/10, 1/10, 2/20, 1/20, L/D, 1/2) volues 2, 3,4, 6]H Volues on
unfair
expected, single sun(rorge(). 71)
expected
expected value
single rell muttippied the rumber rolls
expected, value, total expected_ennnke sergtoo__neee_rolllll rum_rells
CodeSen
expected_yolas yolue__u__ttto
input = p"poobbbllttes strobliiiesstsbbbiiiiiieee probabilities, "volued"' values) output a expected_ydllsse yaluedd_llll""/// irput)) print(uupput)
cutput a expected_ vollaoll""""""""u prinntoupput)
input = (num rolls': 33
CPS
Reversal
Reversal
Probion-lete leeed Angmonaatio::
Rephrose
Patter-leeed Augmontation:
Logic Reconstruct
A fair 10-iidedd die is modilteed sach that of faccr show number 6, and the other 5 focm show the mumiers i through rach appraring modyfidd What erpected
A fair 6 6-tided die is rolled maltipie times. What the expretedd value of the sun the mnlcomeee when the the rulied tizus?
vingle
Figure 3: A case of one problem with its Code COT. We demonstrate two augmentations, where problem-level augmentation refers to the original Code CoT can be back-translated into multiple question variants, and pattern-leee augmentation means our CodeGen capable of generating novel Code CoT's that generalize beyond the original seed patterns.
Training CodeGen on Unified Code CoTs We fine-tune unconditional CodeGen Up Cood to model the distribution of valid reasoning programs.
min [(0)
Σ
log polce cet).
CECaad
The resulting model, CodeGen, is designed generalize the reasoning patterns embedded in dataset and produce structurally consistent code-based CoT' for both mathematical and algorithmic problems. Fine-tuning is conducted using pretty simple prompt described in Appendix Table 3 Notably, training uses only Code CoTSs, without problem contexts or requirements, focusing on internalizing the reasoning trace space rather than specific problem-solution pairs. In this way, we aim to largely explore the diverse Code CoTs in the generation phase.
Large-Scale CoT Generation via Sampling. After fine-tuning, we employ CodeGen to generate a large number of new Code CoT samples Csamp = {c' ~ ). Using temperature sampling, we generate multiple candidate programs use prompt Appendix Table (same training CodeGen). This sampling-base based approach introduces stochasticity into the decoding process, allowing the model explore diverse set of reasoning paths and solution strategies. The result is scalable and flexible pipeline for synthesizing varied Code CoTS.
As illustrated in Figure 3 even for problem types the model has seen during training- -uchh as calculating the expected value of a biased die-the model is capable of restructuring the logic, e.g.. by decomposing the problem into multiple rolls and aggregating expected outcomes. This demonstrates that CodeGen supports two complementary modes of augmentation:
Problem-level Augmentation arises when natural language problems are synthesized from code by varying the situational context or rephrasing the same underlying logic in different stylistic forms. This introduces diversity in surface formulations (implemented in Section 3.3).
Pattern-level Augmentation arises when the CodeGen explores novel reasoning structures- such as problem decompositions or alternative solution strategies-thereby enriching the pool of underlying logic templates.
Together, these modes yield both surface-level diversity and deeper structural variability in the synthesized dataset. Additional representative samples along with training settings and sampling configurations are provided in Appendix A
Code CoT Filtration. To ensure the quality of generated Code CoTs, we apply the execution-based filtering criteria similar to the unified seed Code CoT's. The only difference is that at this stage, we do not enforce output matching with known answers, as consistency verification is deferred to the later mankstraaslttion stage. In total, we synthesize approximately 5.3M Code CoT samples. After filtering, we retain high-quality subset of around 4.6M executable and structurally valid programs.
5

---

This large-scale dataset forms the basis for the subsequent stage of problem synthesis, enabling us to bootstrap new question-solutionn pairs and further expand the reach of code-based reasoning.
3.3 Instruction Reversal and Language CoT Generation
Following the generation of a substantial set of executable code templates, we distill their underlying logic to synthesize natural language problems alongside their corresponding solutions, derived from the combined set Creed U Samp- As shown in Figure B this process significantly expands our dataset by producing diverse and high-quality problem-anse -nnswrr pairs.
Two-Stage QA Generation, For quality control, we adopt two-stage method to generate problem and language CoT instead of one-step generation for both. In our preliminary experiments, find that jointly generating the instruction and language CoT together based on the Code Co'T is easy lead to low quality or incorrect language solutions, perhaps due the 'lazy' mode [39] by LLMs since it sees the correct Code CoT as 'guidance'. Therefore, each code snippet is paired with representative input-output examples (code-instruction pair) and provided as input to the LLM (see Prompt 5), which generates a natural language problem at the first stage. Secondly, we prompt the generated problem to the LLM (see Prompt 6) for natural language CoT synthesis, which largely forces the LLM to think and generate correct language CoTs
Dual Verification. Two filtration and verification ways are processed ensure the correctness of the instruction and natural language COT.
(L) Answer Consistency: We execute the code and compare its output to the answer inferred from the LLM's CoT reasoning. Any mismatches are discarded to maintain high precision.
(2) CoT Consistency: We remove samples where the language CoT and Code CoT for the same problem are not aligned, based on the consistency judgment Prompt 7 This process ensures the correctness of the reasoning steps in the language CoT.
Only tuples (p', d')) that simultaneously satisfy both conditions retained. This filtering process can be formally expressed as:
Dínal = (
Go-ppe), s' "G''ssp'), (Ans(s') Exec(c')) A Con(s', ,')), (2)
where G denotes a general-purpose LLM used for instruction reversal and answer generation; Ans(s') extracts the final answer from the solution s' and compares it with the execution result of the code Exec(c'); and Con(s', represents the CoT consistency check between the natural language solution and the code. After this pipeline, we obtain approximately 1.3M validated instruction-anse answer pairs in Diiat which significantly enhance the diversity and reliability of the training data and serve as valuable resource for downstream reasoning tasks.
4 Experiment
4.1 Experimental Setup
Baselines. We compare Caco-generated dataset against several mainstream synthesized instruction-tuning datasets for math reasoning, including data-centric methods such as Meta- Math [45), MMIQC [2I]. NuminaMath (18), MathFusion [4], RFT [38], and DART-Math (38),
which all demonstrate strong reasoning enhancement. Besides, we also include well-known open- source instruction-tuned reinforcement learning (RL)-based models baselines: LLaMA3-7B-
Instruct Q
44], and DeepSeek 32
Training Configuration. To evaluate the generalizable effectiveness of our Caco produced dataset, our experiments are conducted on two math-specciaiieed LLMs DeeeSSckMatth-7 Swen2.5-Math-77 44. well as one general-purposs model, LLaMA3-SB 49 Unless oth-
[32 and
erwise specified, all models are fine-tuned for 3 epoch using a learning rate of 5 x 10 10-6 6 a batch size
of 128, and cosine decay schedule with a warm-up ratio of 0.03. Additional implementation details are provided in Appendix B
Evaluation Setup. Following the evaluation protocol of DartMath 38
we evaluate on multiple
popular benchmarks show the advantages, including MATH 14, GSM8K (6, CollegeMath (4)
DeepMind- Matteemttatttematiie [31]. OlympiadBench-Math 13 and Th [5]. Solutions

---

generated using greedy decoding with a maximum sequence length of 2048 tokens, and we report Pass@1 I accuracy the zero-shot setting without tool integration. Further evaluation details and benchmark statistics can be found in Appendix B
4.2
Main Results
Model
# Samples DeepSeckMath-7 (Math- Specialiee Base Model)
MATH
GSMBK
College
DM
Olympiad
Theorem
AVG
DeeSeekMath- Mathek--Maat-----R....
51.1
88.8
34.5
58.2
18.8
30.9
47.1
DeepSockMath-7B
DepseokMaath-7-MMcaaaaa
400K
40.2
80.5
35.7
48.1
11.4
21.8
39.6
DeepSeekMath-7B-MMMR.
2.3M
45.3
79.0
35.3
52.9
41.5
DeepSeckMathh75.NNume Math
860K
47.7
78.5
38.0
56.2
18.2
22.1
43.5
DeppSciMaath-7BRRTT
590K
53.0
88.2
41.9
60.2
19.1
27.2
48.3
DeepSeckMath-7BDDunkk.
590K
53.6
86.8
40.7
61.6
21.7
32.2
49,4
DeepSeekMath-76
60K
53.4
77.9
39.8
65.8
23.3
24.6
47.5
109K
58.7
82.4
42.9
71.3
51.1
596K
63.5
85.2
44.4
78.0
25.8
30.2
54.5
Caco-1 2aco-1.3M-JD Meth
1.3M
68.2
85.1
46.0
80.2
29.5
33.8
$7.1
Qwen2.5-Math-77 (Math Speccaliee Base Model)
Qwen2.5- 5-an2.5-Math-BB... Maath-7B-Instruue
82.1
94.1
50.4
72.9
41.3
40.8
63.6
Qwen2.5 5-225--- -BhtaaaB--M
MetaMath
400K
51.7
84.7
40.0
62.6
18.2
26.5
47.3
Qwen2.5-Matte 5-a.------------- Maaathh7--NNunnMaatl
860K
70.6
90.8
46.1
75.1
35.9
37.4
59.3
DDrrttMahh
590K
61.4
89.7
42.5
72.0
25.8
35.5
54.5
-uiihFFoon
60K
75.2
83.5
43.0
76.0
39.5
41.5
59.8
Caco-Seed109P 20we2.55Matth-2
109K
47.1
Caco-596K
596K
81.1
92.4
50.3
86.7
43.3
45.5
66.6
Caco-1 1,30 Qwen2.5 7B
1.3M
82,4
92.6
51.4
87.1
46.5
46.0
67.7
LLaMA3-88 3-8B (General Base Model)
LLaMA3-8B-Inntn I-stuuuct
44.3
53.4
29.8
42.0
11.3
17.7
33.1
400K
32.5
77.3
20.6
35.0
5.5
13.8
30.8
LLaMA3- 8B- -MIQCT
2.3M
39.5
77.6
29.5
41.0
35.6
LLaMA3-8B-Numinen
SBNuunnnMatth
860K
43.6
79.7
24.7
43.1
16.4
37,9
LLaMA3-8B-RIT
590K
39.7
81.7
23.9
41.7
14,9
35.2
LLaMA3-S8 SB-DartMath
590K
46.6
81.1
28.8
48.0
14.5
19.4
39.7
LLLMAA-8B-MuthFUe
60K
46.5
79.2
27.9
43.4
17.2
20.0
39,0
109K
55.3
86.0
42.2
52.0
19.1
25.6
46.7
Caco-59KK-LLaMA33
596K
64.3
88.6
44.8
66.7
52.8
ABco-1.3M-LLaMA3-22
1.3M
70.6
89.1
46.2
72.5
34.1
31.0
57.3
Table 1: Performance comparison on mathematical benchmarks including MATH, GSM8K, Col-
legeMATH (College), DeepMind-Mathematioe Mathematics (DM), OlympiadBench- oremQA (Theorem). The best results are highlighted in bold. Baseline results labeled with are
(Olympiad), and The-
derived from MathFusion [30]
Table T presents comprehensive comparison of our Caco against a series of strong baselines across and L.LMMA38B).. We
the three different base models (DeepSeekMMat-75 report results for two synthesized data sizes: Caco-596K and Caco-1.31 samples. From the results, can summarize the following findings:
Consistent improvements across base models. Caco consistently outperforms existing methods across all three base models. For instance, on LLaMA3-8B, Caco-1 1.3M achieves an average score of 57.3, surpassing the previous best of 39.7 from DartMath by a relative improvement of 44.3%.
Improvement over scaled synthetic data. Performance improves obviously when increasing the Caco-generated data from 596K to 1.3M. On Qwen2.5-Math-77 Caco-1.3M achieves 67.7, outperforming Caco-596K by 1.1 and demonstrating the scalability and effectiveness of our approach under larger supervision.
Strong performance on challenging subsets. Notably, Caco shows superior performance on harder benchmarks such OlympiadBench and TheoremQA, where other baselines struggle. For instance, on LLaMA-8B, Caco-596K improves OlympiadBench from 17.2 to 34.1 and TheoremQA from 20.0 to 31.0 compared to MathFusion, which shows the great potential of our approach.
Competitive with strong instruction- tuned and RL-based models. Remarkably, Caco matches or exceeds the performance of strong instruction-tunee or RL-finetuned models. For example, on Owen2.5-Math-77, Caco-1.3M achieves 67.7, which comparable D.ven..5-Math-7B--mee (63.6). On DeepSeekMath and LLaMA series, faco-1.3M, trained models significantly surpass

---

DeepSeekMath-7B-RR (47.1) and LLaMA-8B- --nssruuttttt (33.1). This greatly demonstrates the superi- ority of our method.
Effectiveness of Caco Data. Compared to the seed data we used to train CodeGen (Caco-Seed- 109K), Caco-596K and Caco- consistently deliver substantial improvements. For instance, on LLaMA3-8B, Caco-1.3M achieves 57.3, a significant increase from Sico-Seed-109K score of 46.7. This validates our data scaling strategy, showing that our method yields performance gains by ensuring the training data comprehensively represents diverse and challenging problems.
5 Analysis
To further understand the strengths of our proposed approach, we analyze three key aspects that contribute to Caco's 's effectiveness: the diversity, the scalability, and the verification mechanism in the Caco data construction pipeline. Together, these components form the foundation of Caco's training methodology and help explain its strong performance across models and benchmarks. In the following sections, we provide a detailed analysis of each component and its contribution. More experiments and discussion of cost are in Appendix C and D
5.1 Analysis on Data Diversity
We conduct comprchensive investigation into the diversity of the dataset to assess the range and variability of the aaco-generated problems. This analysis crucial for understanding how well the model can generate problems across various domains and ensure broad coverage of mathematical topics. By examining both the distribution of problems and the variety of problem types, we aim to demonstrate that the dataset not only spans wide range of topics but also captures diverse problem-solving scenarios that are representative of real-world mathematical challenges.
Problem Diversity. We analyze the distribution of problems in the synthesized Caco dataset to assess its coverage and diversity. Specifically, we randomly sample 5K problems from Caco and compare them with samples from the original seed datasets (MATH, DeepScaleR and BigMath). We encode all problems using the all-MiniLMM-Lon --6--2 sentence embedding modef" and visualize their distributions t-SNE [40]. shown in Figure 4al The resulting plot demonstrates that Caco's 's synthesized data broadly and evenly spans the embedding space, effectively covering the original seed distributions. Notably, we observe distinct region the left side of the plot where Caco samples diverge from the seed data clusters, suggesting that our generation pipeline introduces novel and diverse problem types beyond the original datasets. This supports the claim that Caco enhances distributional generalization through its diverse synthetic augmentation.
Topic Diversity. To further assess the topical diversity of the Caco dataset, we apply clustering analysis to the problem embeddings. Using the same embedding method as before, we encode all problems and then apply the KMeans algorithm (27) to partition them into 12 distinct clusters. The clustering results are visualized in Figure 4b The clusters reveal a wide range of mathematical and algorithmic topics, including algebra, geometry, applied mathematies, data structures, algorithms, and more. This confirms that Caco spans a broad spectrum of problem types, rather than concentrating narrow domains. Representative samples from each identified topic cluster are provided in Appendix G for for qualitative reference.
5.2 Analysis on Data Scalability
We evaluate the scalability of Caco by analyzing its impact on model performance under varying amounts of training data. Figure 5c presents the results on the MATH benchmark and the overall average across all benchmarks for DeepSeekMath-T7 and LLaMA3-8B. For both models, we observe clear upward trend as the training data size increases from 109K to 1.3M. This demonstrates the strong scalability of our approach. Notably, the performance gains are more pronounced for the general-purpose LLLMA3-8B, especially in the early stages (e.g., from Seed109K to 596K), highlighting Caco's os ability to significantly improve less specialized models. On Qwen2.5-M5 -athhhh-Math model, the performance also improves with increasing data size, but the improvement is less pronounced due to the already strong capabilities the base model.
MinLMM

---

BigHathh
Souttin
Seld Douesiyy
-00
Figure 4: Left: Problem distribution of our Caco dataset and the original data sources. Right: KMeans clustering result of the problem types.
5.3
Ablation Verification
37.0
wee Verification Verification
24.9
$2.0
Parcertig 1N)
21.4
88.0
10
17.A
DeeppSesk
LLatt. Math
Salvabiity
Carrediness
Olymipied
Theorum
Average
SeedI09K 300K
599K
3.5M
Figure 5: Left: Comparison of solvability and correctness between generated samples with and without verification. Middle: Accuracy comparison between models trained on verified and non- verified data. Right: Performance improvements the Caco model as data size increases.
Verification is a crucial process in our Caco data generation. To further investigate the impact of verification on data quality and reliability, we compare the data with and without applying the verification filtering. We randomly sample 100K data points for each version and use Qwen3-32B to evaluate both the solvability (i.e., whether the problem can be solved) and the correctness (i.e., whether the final answer is accurate) of the generated samples. We further evaluate downstream performance by fine-tuning the LLaMA model on each dataset.
Impact on Data Quality. As shown in Figure 5a the verification mechanism substantially improves the quality of the training data. With verification, the ratio of solvable problems increases from 91K to 97K, and the number of correct answers rises from 88K to 93K. These improvements suggest that the verification process-basee based on answer validation and consistency checks over reasoning chains effectively filters out low-quality or incorrect samples, resulting in more reliable supervision.
Impact Model Performance. In addition improving data quality, verification also yields tangi- ble benefits in downstream performance (Figure 5b). The model trained with verified data achieves an average accuracy of 21.8, compared to 20.8 without verification, reflecting consistent improvement across benchmarks. The performance gain is especially notable on more challenging tasks: for instance, on Olympiad, the verified model scores 18.7, outperforming its non-verified counterpart by 1.1 points. This demonstrates that the enhanced data reliability introduced by verification translates into better generalization and reasoning robustness in trained models.
5.4 Generality Beyond Mathematics
We first evaluate the generalization of Caco models. Using OpenCompass 77,. we assess Caco-I.3M models across broad set of reasoning tasks, including mathematics (AIME24), code generation (Hu- manEval+), scientific QA (ARC-c), logic puzzles (BBH, KorBench), and general knowledge/science (AGIEval).. Caco models demonstrate substantial improvements beyond math, with notable gains in logic puzzles, general reasoning, science reasoning, and code tasks. These results indicate that the models trained on Caco data generalize effectively across diverse benchmarks.
next discuss the generality of the Caco methodology itself beyond mathematics. Although our primary experiments focused mathematical reasoning, Caco is fundamentally a gureral-

---

Model
AGIEval
AIME24
HumanEval+
ARC-c
BBH
KorBench
Average
Qwen2.5-Math-7B-baan
42.5
20.0
12.8
72.2
19.9
39.7
34.5
53.3
23,3
53.1
81.4
65.1
47.1
53,9
LLaMA3-8B-bull
28.5
0.0
32.3
79.0
19.8
23.8
30.6
Baco-..3M-LJaMM3-888
46.5
10.8
34.2
83.1
33,8
44.1
42.1
Table 2: Performance comparison of base models and Caco- aaco-auugeented models across diverse out-of-
domain benchmarks.
Model
AGIEval
ARC-c
MMLU-STEM
Average
I..aMA JLaMA--Megaccicne-Seed. LLaMA- MMeaMA-MaaaaaSsnnC-Caaaoa
42.8
78.6
55.4
59.0
45.0
84.8
60.5
63.4
Table 3: Evaluation of LLaMA models trained on MegaScience seed data (5.2K) vs. Caco Caco-augmented expansion (37K).
framework for structured, code-based reasoning. and applicable domains exhibiting logical, symbolic, programmatic structure, such as logic puzzles, scientific reasoning, and procedural tasks. In logic puzzles, for instance, many problems share reusable underlying reasoning template (e.g., arithmetic expression puzzles, countdown problems), which can be parameterized in code to generate diverse instances. This aligns with Caco's central principle: code abstracts problem logic more compactly than natural language, enabling systematic sampling and verification.
To test cross-domain applicability, applied Caco 5.2K science reasoning seeds from Mega- Science. The pipeline generated 37K valid QA samples, and fine-tuning LLaMA on these yielded an average score improvement from 59.0 63.4 across AGIEval, ARC-c, and MMLU-STEM (Table B). These results confirm that Caco's 's code-driven design enables effective extension to new domains where logic can be programmatically represented.
Conclusion
In this work, present Caco, code-assisted framework for generating high-quality, verifiable, and diverse thain-of-thoughe reasoning data. By leveraging code execution and automated filtering, Caco enables scalable synthesis of logically grounded instruction data without human supervision. Models trained with Caco outperform strong baselines on both mathematical reasoning benchmarks and
benchmarks. Our findings highlight the effectiveness of code-driven verification and instruction diversity in improving reasoning generalization.
Acknowledgements
This work is supported by Shanghai Artificial Intelligence Laboratory.
10

---

References
[1] Janice Ahn, Rishu Verma, Renze Lou, Di Liu, Rui Zhang, and Wenpeng Yin. Large language models for mathematical reasoning: Progresses and challenges. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics: Student Research Workshop, pp. 225-237, 2024.
[2] Alon Albalak, Duy Phung. Nathan Lile, Rafael Rafailov, Kanishk Gandhi, Louis Castricato, Anikait Singh, Chase Blagden, Violet Xiang, Dakota Mahan, et al. Big-math: A large-scale, high-quality math dataset for reinforcement learning in language models. arXiv preprint arXiv:2502.17388 2025.
[3] Wenhu Chen, Xueguang Ma, Xinyi Wang, and William W Cohen. Program of thoughts prompt- ing: Disentangling computation from reasoning for numerical reasoning tasks. Transactions on Machine Learning Research.
[4] Wenhu Chen, Xueguang Ma, Xinyi Wang, and William W Cohen. Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks. arXiv preprint arXiv:221 12588, 2022.
[5] Wenhu Chen, Ming Yin, Max Ku, Pan Lu, Yixin Wan, Xueguang Ma, Jianyu Xu, Xinyi Wang. and Tony Xia. Theoremqa: theorem-driven question answering dataset. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 7889-7901, 2023.
[6] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichrr Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:21 10.1466.. 2021.
[7] OpenCompass Contributors. Opencompass: A universal evaluation platform for foundation models.
cow http:////wp...ccaaaa//////copana 2023.
[8] Yuyang Ding, Xinyu Shi, Xiaobo Liang, Juntao Li. Qiaoming Zhu, and Min Zhang. Unleashing reasoning capability of Ilms via scalable question synthesis from scratch. arXiv preprint 2XXv:24100116933 2024.
[9] Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang. Jamie Callan, and Graham Neubig. Pal: Program Machine Learning, pp. 10764-10799. PMLR, 2023.
Program-aided aided language models. In International Conference
[10] Zhibin Gou, Zhihong Shao, Yeyun Gong, Yujiu Yang. Minlie Huang, Nan Duan, Weizhu Chen, al. Tora: tool-integrated reasoning agent for mathematical problem solving. The Twelfth International Conference on Learning Representations.
[11] Xinyu Guan, Li Lyna Zhang, Yifei Liu, Ning Shang, Youran Sun, Yi Zhu, Fan Yang, and Mao Yang. rstar-math: Small llms can master math reasoning with self-evolved deep thinking. arXiv preprint Stti:25001.45111 2025.
[12] Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. Deepseek-rl: Incentivizing reasoning capability in Ilms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025.
[13] Chaoqun He, Renjie Luo, Yuzhuo Bai, Shengding Hu, Zhen Leng Thai, Junhao Shen, Jinyi Hu, Xu Han, Yujie Huang, Yuxiang Zhang, al. Olympiadbench: A challenging benchmark for promoting agi with olympiad-lewe bilingual multimodal scientific problems. arXiv preprint arXiv:2402. /4008 2024.
[14] Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset. Sort, 2-4):0-6.
[15] Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: A survey. Findings of the Association for Computational Linguistics: ACL 2023, pp. 1049-1065, 2023.

---

[16] Yiming Huang, Xiao Liu, Yeyun Gong, Zhibin Gou, Yelong Shen, Nan Duan, and Weizhu Chen. key-pooin- data synthesis with its enhancement on mathematical reasoning. arXiv preprint arXiv:2403.02333 2024.
[17] Chengpeng Li, Guanting Dong, Mingfeng Xue, Ru Peng, Xiang Wang, and Dayiheng Liu. Dotamath: Decomposition of thought with code assistance and self-correction for mathematical reasoning. arXiv preprini 2rXi::2407.04000 2024.
[18] Jia Li, Edward Beeching, Lewis Tunstall, Ben Lipkin, Roman Soletskyi, Shengyi Huang, Kashif Rasul, Longhui Yu, Albert Q Jiang. Ziju Shen, et al. Numinamath: The largest public dataset in ai4maths with 860k pairs of competition math problems and solutions. 2024.
[19] Junlong Li, Daya Guo, Dejian Yang, Runxin Xu, Yu Wu, and Junxian He. Codei/o: Condensing reasoning patterns via code imput-oupput prediction. arXiv preprint arXiv:2502.07316. 2025.
[20] Honglin Lin, Zhuoshi Pan, Yu Li, Qizhi Pei, Xin Gao, Mengzhang Cai, Conghui He, and Lijun Wu. Metaladder: Ascending mathematical solution quality via analogical probbeem-pp reasoning transfer. arXiv preprint arXiv:2503. 14891, 2025.
[21] Haoxiong Liu, Yifan Zhang, Yifan Luo, and Andrew C Yao. Augmenting math word prob- lems via iterative question composing. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, pp. 24605-24613, 2025.
[22] Iya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 2017.
[23] Zimu Lu, Aojun Zhou, Houxing Ren, Ke Wang, Weikang Shi, Junting Pan, Mingjie Zhan, and Hongsheng Li. Mathgenie: Generating synthetic data with question back-translation for enhancing mathematical reasoning of llms. arXiv preprint arXiv:2402. 16352, 2024.
[24] Zimu Lu, Aojun Zhou, Ke Wang, Houxing Ren, Weikang Shi, Junting Pan, Mingjie Zhan, and Hongsheng Li. Mathcoder2: Better math reasoning from continued pretraining on model- translated mathematical code. arXiv preprint arXiv:2410.08196, 2024.
[25] Haipeng Luo, Qingfeng Sun, Can Xu, Pu Zhao, Jian-Guang Lou, Chongyang Tao, Xiubo Geng, Qingwei Lin, Shifeng Chen, Yansong Tang, and Dongmei Zhang. Wizardmath: Empowering mathematical reasoning for large language models via reinforced evol-instruct. In The Thirteenth International Conference on Learning Representations.
[26] Michael Luo, Sijun Tan, Justin Wong, Xiaoxiang Shi, William Y Tang, Manan Roongta, Colin Cai, Jeffrey Luo, Tianjun Zhang, Li Erran Li, et al. Deepscaler: Surpassing ol- o1-preview with 1.5 b model by scaling rl. Notion Blog, 2025.
[27] James MacQueen. Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics, volume 5, pp. 281-298. University of California press, 1967.
[28] Arindam Mitra, Hamed Khanpour, Corby Rosset, and Ahmed Awadallah. Orca-math: Unlocking the potential of slms in grade school math. arXiv preprint 2rXiv:2402.14880) 2024.
[29] OpenAI.
Learning to reason with Ilms, 2024. learning- to rewson- Breason-with-11e with-1lms,
URL httt:::///opena..oommiii//
[30] Qizhi Pei, Lijun Wu, Zhuoshi Pan, Yu Li. Honglin Lin, Chenlin Ming, Xin Gao, Conghui He, and Rui Yan. Mathfusion: Enhaneing mathematic problem-solving of I1m through instruction fusion. arXiv preprint arXiv:2503. /62 2025.
[31] David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. In International Conference on Learning Representations.
[32] Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Y Wu, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03322 03300, 2024.
12

---

[33] Weisong Sun, Chunrong Fang, Yun Miao, Yudu You, Mengzhe Yuan, Yuchen Chen, Quanjun Zhang, An Guo, Xiang Chen, Yang Liu, et al. Abstract syntax tree for programming language understanding and representation: How far are we? arXiv preprini arXiv:2312.0041. 2023.
[34]
Zhengyang Tang, Xingxing Zhang, Benyou Wang, and Furu Wei. Mathscale: Scaling instruction tuning for mathematical reasoning. In International Conference on Machine Learning, pp.
PMLR, 2024.
[35] Mistral Al team. Learning to reason with Ilms, 2024. URL mathstral
[36] Qwen Team, Qwq: Reflect deeply on the boundaries of the unknown, November 2024. URL https://quenIn: www.gggithhu...... 10/ wwt.:////ol/////oo hptp///q---22000 preview/
[37] Qwen Team. Qwen3: Think deeper, act faster, April 2025. URL https://qwennmm githhub to/blog/qwen3/
[38] Yuxuan Tong, Xiwen Zhang, Rui Wang. Ruidong Wu, and Junxian He. Dart-math: Difficulty- aware rejection tuning for mathematical problem-solving. Advances Neural Information Processing Systems, 37:7821-7846, 2024.
[39] Shubham Toshniwal, Ivan Moshkov, Sean Narenthiran, Daria Gitman, Fei Jia, and Igor Gitman. Openmathinstruct-I: A 1.8 million math instruction tuning dataset. Advances in Neural Information Processing Systems, 37:34737-34774, 2024.
[40] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
[41] Ke Wang, Houxing Ren, Aojun Zhou, Zimu Lu, Sichun Luo, Weikang Shi, Renrui Zhang, Lingi Song, Mingjie Zhan, and Hongsheng Li. Mathcoder: Seamless code integration in Iims for enhanced mathematical reasoning. In The Twelfth International Conference on Learning Representations.
[42] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoe V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances neural information processing systems, 35:24824-24837, 2022.
[43] Zhangchen Xu, Yang Liu, Yueqin Yin, Mingyuan Zhou, and Radha Poovendran. Kodcode: di- verse, challenging, and verifiable synthetic dataset for coding. arXiv preprint arXiv:2503.02951, 2025.
[44] An Yang, Beichen Zhang, Binyuan Hui, Bofci Gao, Bowen Yu, Chengpeng Li, Dayiheng Liu, Jianhong Tu, Jingren Zhou, Junyang Lin, et Qwen2. 5-math technical report: Toward mathematical expert model via seff-immprvemmen, arXiv preprint arXiv:2409. /2/22, 2024.
[45] Longhui Yu, Weisen Jiang, Han Shi, YU Jincheng, Zhengying Liu, Yu Zhang, James Kwok, Zhenguo Li, Adrian Weller, and Weiyang Liu. Metamath: Bootstrap your own mathematical questions for large language models. In The Twelfth International Conference on Learning Representations.
[46] Xiang Yue, Xingwei Qu, Ge Zhang, Yao Fu, Wenhao Huang, Huan Sun, Yu Su, and Wenhu Chen. Mammoth: Building math generalist models through hybrid instruction tuning. In The Twelfth International Conference on Learning Representations.
[47] Xiang Yue, Tuney Zheng, Ge Zhang, and Wenhu Chen. Mammoth2: Scaling instructions from the web. arXiv preprint ar0ivv2405.033: 03548, 2024.
[48] Erie Zelikman, Yuhuai Wu, Jesse Mu, and Noah Goodman. Star: Bootstrapping reasoning with reasoning. Advances in Neural Information Processing Systems, 35:15577-15488, 2022.
[49] Di Zhang, Jiatong Li, Xiaoshui Huang, Dongzhan Zhou, Yuqiang Li, and Wanli Ouyang. Accessing gpt-4 level mathematical olympiad solutions via monte carlo tree self-refine with Ilama-3 8b. arXiv preprint arXiv:2406.07555 2024.
13

---

[50] Aojun Zhou, Ke Wang, Zimu Lu, Weikang Shi, Sichun Luo, Zipeng Qin, Shaoqing Lu, Anya Jia, Linqi Song, Mingje Zhan, al. Solving challenging math word problems using gpt-4 code interpreter with code-based self-verification. In The Twelfih International Conference on Learning Representations.
[51] Fan Zhou, Zengzhi Wang, Nikhil Ranjan, Zhoujun Cheng. Liping Tang, Guowei He, Zhengzhong Liu, and Eric P Xing. Megamath: Pushing the limits of open math corpora. arXiv preprint arXiv:2504.02807 2025.
14

---

A Data Generation
A.1 Prompts
We show the prompts used for Code CoT unifying in Prompt[anne Prompt and CodeCien training and sampling in Padd We also provide the hack-translation prompt for question generation in Prompt 5 and answer generation prompt in prompt prompts for problem solvability, answer correctness, the consistency between the answer and the code's 's chain-of-thought (CoT) evaluations are displayed in Prompt 8 9 and 7
A.2 Model Usage
We detail the models employed at each stage of our pipeline:
Unifying Code CoTs: We used Qwen2.5-72BB Inn-ssrrrttt
Instruct to generate unified Code CoTs, CodeGen: The unconditional CodeGen was fine-tuned from Qwen2.5-Coder-7B.
Problem Reversal & Solution Generation: Both question back-translation and answer synthesis were performed using Qwen3-8B.
Evaluation: All assessments (problem solvability, answer correctness, and CoT consistency) were conducted with Qwen3-32B.
A.3
Implementation Details
Focusing on Challenging Code CoT. To increase the difficulty of the dataset, we applied additional filtering to the largest subset, bigmath, of the Code CoT dataset. Based on the solve rate annotations provided with the dataset, we retained only those Code CoTs with a solve rate of less than 0.3.
Hyperparameters. During the Unifying Code CoT stage, we deployed Qwen2.55-72BImm Instruct on A100 GPUs to generate code from the raw datasets. For each sample, we performed single pass of sampling with a temperature of 0.6.
For training the CodeGen model, used the LlamaFactory framework and adopted the same training configuration as the main experiments. During inference, we sampled with a temperature of 0.9 and maximum sequence length of 1024 tokens.
For problem and solution generation, we followed the Qwen3-8B best practice (37 Specifically, we used: Temperature 0.7, TopP False.
0.8, TopK = 20, MinP O, and enable_ timblletthikiig
We use Qwen3-32B for evaluating problem solvability, answer correctness, and the CoT consistency between the natural language solution and code COT.
A.4 Filtering Mechanism for Code CoTs
As discussed in method section, many stages of our pipeline require rigorous filtering to ensure the quality, correctness, and executability the generated Code CoTs. Here, we formally describe the filtering criteria used throughout our work.
Executability. The code must be syntactically valid and executable without raising runtime errors.
This ensures basic correctness and structural integrity.
Execution Efficiency. To prevent degenerate or non-terminating programs, we discard any samples that exceed 10-second execution time limit under controlled runtime environment.
Minimum Code Length. To avoid trivial or underdeveloped solutions, require that each code snippet contain at least six non-comment lines of code. This encourages a minimal degree of reasoning complexity and explanatory depth.
AST-Based Semantic Validation. Using abstract syntax (AST) analysis 33
ensure that all variables declared the input dictionary are functionally utilized in the program's 's logic. This discourages redundant or templated outputs and promotes semantically meaningful solutions.
Output Consistency. When ground-truth answers are available, verify that the program output exactly matches the expected solution. This check is applied in cases where reference answen are known and consistency can be reliably evaluated.
15

---

B Train and Evaluation
B.1
Training Setup
Model training was conducted using the LLaMA Factory framework on 8 NVIDIA A GPUs. All models were trained for 3 epoch with a batch size of 128. We used the Adam W optimizer [22] with learning rate of 5 x 10-6, cosine learning rate decay, and a warm-up ratio of 0.03. The maximum sequence length (cutoff) was set to 4096, and the weight decay was 0.1. The prompt used for training shown in Prompt 10
B.2 Evaluation Setup
All models were evaluated using a unified framework under the zero-shot setting. We used greedy decoding with a maximum generation length of 2048 tokens. The prompt used for evaluation is shown in Prompt II
B.3
Evaluation Benchmarks
The following datasets are used for evaluation:
MATH [4]: A benchmark of 12,500 high school math competition problems, with 7,500 for training and 5,000 for testing. Problems are categorized into topics (Prealgebra, Intermediate Algebra, Algebra, Precalculus, Geometry, Counting & Probability, and Number Theory) and difficulty levels.
GSM8K (6] This dataset contains 8,792 high-quality grade school math word problems, with 7,473 for training and 1,319 for testing. Each problem typically requires 2 to 8 reasoning steps to solve.
CollegeMath [34]
test set containing 2,818 college-level math problems collected from college textbooks, covering 7 core subjects: Algebra, Precalculus, Calculus, Vector Calculus, Probability, Linear Algebra, and Differential Equations.
[3 This test consists of 1,000 problems covering wide range of mathematical reasoning tasks including algebra, arithmetic, calculus, and probability. It is designed assess the mathematical reasoning abilities of models.
OlympiadBench-Main [ A benchmark of 675 Olympiad-level math problems. We evaluate only on the English text-only subset of OlympiadBench.
Theorem QA [5] A mesorem-driven question- guestion-answering benchmark containing 800 problems grounded in 350 domain-speeifit theorems. It evaluates model's ability apply mathematical and scientific theorems across disciplines such as mathematies, physics, electrical engineering, computer science, and finance.
C Additional Experiments
C.1 Distinguishing Caco from Teacher Knowledge Transfer and STaR-style Self-Improvemmnt
A natural concern is whether Caco's 's performance gains stem primarily from knowledge transfer from the large teacher model the Caco procedure itself. To isolate this factor, we conducted a control experiment in which the same teacher model was used to directly produce natural language Chain-of-Thhough (CoT) answers for the same seed questions, resulting in a 300K QA dataset SOWENNBB-SEE--EE models fine-tuned on this dataset to those trained on 300K subset of Caco (Caco-300K) and the full CACD-1.3M. Even at equal data size, Caco outperformed the distilled baseline (e.g.. 66.2 vs. 65.5 AVG for Qwen-7B), and scaling Caco to 1.3M samples yielded further improvements (up to 67.7 AVG). This suggests that prompt and reasoning diversity, enabled by Caco's code- basee augmentation, provides benefits beyond direct teacher distillation, and that Caco scales more effectively.
2etnn...572B-Istruuu used to generate the seed dataset, rather than from
We compared
16

---

Another question is whether the gains could also be achieved by simpler self- improvement methods such as STaR 48 Conceptually, Caco differs from these in that it does not focus on iteratively refining answers to fixed set of questions; instead, it trains dedicated code generator to produce executable CoTss from scratch, enabling scalable, verifiable creation of new problems. Nevertheless, to provide direct comparison, we implemented a single iteration of STaR-style ieproiemtevemeent on the seed dataset, generating multiple CoTs per seed question, filtering for correctness, and sampling 300K verified solutions (SEED- SSEEDSSLLF-IPPROVE
Across both DeepSeck-Math-7B and Qwen-7B by substantial margins (e.g., 53.2 48.9 AVG for DS-7B, and 66.2 vs. 52.6 for Qwen-7B). These results reinforce that Caco's improvements derive from its code-driven, simply inheriting knowledge from stronger teacher applying standard self relloimproeeenttt seed data.
backbones, CACO-300K consistently outperformed
oriented generation process, rather than
ISamples
MATH
GSM8K
College
DM
Olympiad
TheoremQA
AVG
Qwen Seed self wel-ssefffmmmme improve
300K
70.7
83.0
47.1
47.6
39.0
28.2
52.6
Qwen-7B Twen-7B-Qwen's S0--Qwen22B-B- (eer722--eedd-iiee Seed-distilled
300K
79.0
91.2
52.1
84,4
41.3
45.0
65.5
Qwen- -B-Caco--CC---aa 300K
300K
81.6
92.4
51.2
84.8
42.5
44.9
66.2
Owen-7B-Caco--ne
1.M
82.4
92.6
51.4
87.1
46.5
46.0
67.7
DS-7B-Sced-sell Seep-e-f--e
300K
53.1
86.7
41.6
62.5
19.3
30.2
48,9
DS-7B- 10--7B-Qee7... 17-22---ee---ee Seed- distilled
300K
57.4
83.0
42.4
69.0
23.4
31.4
51.1
DS-7B-Caco-B3
300K
61.8
83.2
43.3
76.0
23,9
31.1
53.2
DS-7B-Caco-L33
1.3M
68.2
85.1
46.0
80.2
29.5
33.8
57.1
Table 4: Control experiment comparing teacher-distilled natural language CoTss vs. Caco-generated
data at matched size (300K) and at scale (1.3M). Bold indicates the best within each student block.
D Computational Cost and Efficiency
Stage
#Samples
Time (Hours)
Unifying Code CoT
339K
2h
Scaling Code CoT
5.3M
8h
Question Reversal
4.6M
5h
Answer Generation
4.6M
40h
Total (for 1.3M valid data)
55h
Table 5: Computation time for each stage in generating the CACO- 1.3M dataset single A100
machine.
To quantify the efficiency of our method, we report the full computational cost of generating the Caco-1.3M dataset (Table 5). All experiments were conducted single machine equipped with 8x NVIDIA A100 GPUs The pipeline consists four main stages: unifying Code Col's (339K samples, 2h), scaling Code CoT's (5.3M samples, 8h), question reversal (4.6M samples, 6h), and answer generation (4.6M samples, 38.5h). totaling approximately 55 hours to produce 1.3M verified samples. Importantly, the entire process relies solely on open-source models, avoiding the substantial cost of proprietary API usage.
From cost breakdown perspective, the majority of the runtime is consumed by the answer generation stage, which unavoidable in any instruction tuning or self- ieff-improvemntt setup. For example, prior works such as DartMath [38] also incur comparable
higher costs in solution generation, particularly when sampling multiple candidate answers per prompt. The additional steps specific to Caco- Code CoT generation and question reversal are lightweight (combined ~66)), as natural language solutions are substantially longer than questions or Code CoTs.
Overall, these results demonstrate that Caco can generate over one million verified, diverse reasoning samples in under three days on a single 8-GPU node, highlighting strong sculability and accessi- bility. While we acknowledge that data-efficient methods have their merits, Caco is designed with a complementary focus: producing large-scale, diverse, and verifiable reasoning data to support cross-domain generalization.
17

---

E Limitations
Although Caco demonstrates strong capabilities in generating diverse reasoning paths and instructions, its performance is still limited by the predefined problem types used during training. The system may struggle when faced with highly innovative or unconventional problems, particularly those that do not align with the templates or problem categories used during training. As a result, generating high-quality code-based CoTs for more complex or uncommon problem types remains a challenge, potentially leading to biases in the distribution of generated data.
Additionally, while the code be executed accurately, converting it back into human-readable natural language instructions may result in the loss of some details or require simplification, causing the final output to be less rich or specific than the original reasoning steps.
Furthermore, the generated code is primarily used for filtering data and not for final training purposes. It helps ensure the correctness and consistency of the reasoning process, but does not directly contribute to the final training dataset. In future work, will be essential to explore how the generated code can be used to further improve the quality of the data and enhance the training process.
Currently, Caco's application scope is focused mainly on mathematical and algorithmic reasoning tasks. Future work will need to explore extending it to broader domains, such as logical puzzles or STEM problem solving, which will require further effort.
F
Future Works
We outline three complementary directions: increasing difficulty, expanding diversity, and leveraging Caco in reinforcement learning (RI.).
Raising Difficulty. Since the completion of this work, several math corpora with higher diffi- culty and quality than DEEPSCALER and BIGMATH have emerged, such as A.M-THINKING-V DISTILLED and the DAPO dataset. Starting from harder, cleaner seed sets is likely further amplify the benefits of code-based augmentation. Concretely, we plan to (i) replace/augment the seed pool with high-diffculty problems (e.g.. Olympiad-style, exam-grade items) and (ii) adopt hardness-aware sampling and adversarial program mutations during Code CoT generation.
Expanding Diversity. As demonstrated in Section 5.4 our method generalizes beyond mathematics and applies naturally to domains with logical, symbolic, or procedural structure. While we discussed science and logic reasoning, broader coverage (e.g., data reasoning, procedural planning, code debugging, diagram/physics problems, proofs) should allow CodeGen to learn richer templates and compose more diverse problems. Furthermore, extending the framework beyond Python support formal languages (c.g.. Lean, Cog, or Wolfram Language) could enhance rigor and verifiability. We will train multi-domain CodeGen with domain tags, (ii) design compositional templates that factor shared subroutines across domains.
Reinforcement Learning with Verifiable Rewards (RLVR). Recent RL-based training has shown strong gains for reasoning models but often depends critically on the correctness of reference answers. Caco's executable traces provide natural, low-noise reward signal. We will integrate Caco with RI. by (i) deriving rewards from execution correctness (ii) employing curriculum over program length and control-flow complexity. This combination targets scalable, verifiable RL training without heavy reliance noisy external references.
Applications:
G More Cases
This section presents samples from the Caco dataset, including the subsequence counting problem (Case []. geometric sequences problem (Case 2). permutation and combination problem (Case
mathematical expression calculation problem (Case[), and analytical geometry problem (Case
18

---

Code Generation Prompt
Given the following math problem in natural language, provide the complete code solution that solves the problem.
Requirements:
The final output of program muss the correct numerical or symbolic answer** to the problem.
You must actually *compute** the result using Python code (e.g., using arithmetic libraries like 'sympy"), **t just explain in text or comments **
The code must define an 'input' dictionary, call function using that input, assign the result to variable 'output', and finally prrit((uuppt)".
Please provide complete, standalone executable script.
#i# Example Math Problem:
snail at bottom of 20-foot well. Each day, climbs up feet, at night, it slips back feet. How many days will it take the snail to reach the top the well?
### Example Code Solution:
def daya_ so_reach____ top (xell height, dlinb_distance alip_distance)
days
eurrent_height
current, heightt well_keight:
current_ height +- climb_distance
current_height vall_height: break
gurrent_height elip_distance days
return days
Represent the input dictionary naned 'input' input (e"xell_eeight 20, "climb Call the function with the imput dictionary, assign the result to 'output' output daye_to_reach_top (x+input) Print the output print (outtut)
"eliab_distance", distance"; 3, siippdisstace"" 2)}
Now, please provide the code solution for the following math problem directly. Make your code solution defines the input dictionary named imput, calls the solution function using this dictionary, stores the result a variable named output, and prints output.
### Math Problem:
{problem}
#### Solution (Optional):
[solution]
###l Code Solution:
Prompt 1: Code Generation Prompt for solving math problem using Python code.
19

---

Code Unifying Prompt
Given the following code and function, please refactor the solution into the required format: Example Output Format:
def (a, b):
Represent the input as a dictionary nemed 'input" input (("a": 3, "b"; 5})
Call the function with the input dictionary, assign the result to 'autput" output (*=inpu)
Print the output (rinppout
<answers&</nnswer>
Code:
{code]
Test Function:
coss__code]
Please refactor the code to follow the required format.
The code must define an 'input' dictionary, call function using that input, assign the result to variable 'output', and finally "print(output)..
If there are multiple test cases function, just select one of them.
Please provide complete, standalone executable script. ### Output:
Prompt 2: Prompt for refactoring code into the required input-output format.
CodeGen Training Prompt
<lim_ _tt_stttbbssseem
You helpful assistant.< <lim__nddi <lim startbbsse [code]<<lin endb>
Prompt 3: Prompt for training the CodeGen model.
CodeGien Sampling Prompt
<lim startbsssstem are helpful assistant.<lhi <lim__eddil slim_star|/susee
Prompt 4: Prompt for sampling from the trained CodeGen model.
20

---

Question Back-translation Prompt
The code represents solution to math problem, and your task is to generate the original math problem that corresponds the code.
#I#l Example Code:
def change_ (ant, coins): if ant <- 0: return
ant 1- and not coins: return float ("inf")
alif coina [0]
return change_rer (ant, coins[1:])
use_it = 1 cha (ant coins [0], coins)
lose_it change_ (ant, coine (1:])
min cuse_it, lose_it)
Represent input dictionary input ("ant": 13, "coins"; [1, 3, 5, 7]} with imput dictionary, assign output change_ret (++ip)tt) Print the output print (output)
'input'
'output
### Example Math Problem:
What is the minimum number of coins needed to make total of 13 units using the available coin denominations of 3, and units, each in unlimited supply? #### End Problem
Please generate ** Math Problem** based the following codc. Ensure the generated problem fully self-contained, solvable, doesn't miss any necessary conditions context.
You may add a concrete scenario or express the problem different styles for diversity.
### Code:
{code}
### Math Problem:
Prompt 5: Question Back-translation Prompt. The prompt for generating math problem based given code solution, where the generated problem should fully capture the conditions and context of the code.
Answer Generation Prompt
### Instruction:
[problem)- Please step by step, and put your final answer within \boxed() )-
#ifl Response:
Prompt 6: Instructions for generating step-by-step reasoning and the final answer enclosed a boxed format.
Consistency Checking Prompt
Solution:
[solution]
Code:
[code]
Please determine the logic the code and the chain-of of-uuut in the solution are consistent.
Answer with single word: "Yes" or "No".
Answer:
Prompt 7: Prompt for checking the consistency between the logic of the code and the chain-of- of-thougghtttt in the solution, where the answer is expected to be either "Yes" or "No".
21

---

Solvability Checking Prompt
Problem:
[problem]
Please determine if the problem is solvable.
Answer with single word: "Yes" or "No".
Answer:
Prompt 8: Prompt for determining the solvability of a given problem, where the answer is expected be either "Yes" "No".
Correctness Checking Prompt
Problem:
{problem}
Solution:
[solution]
Please determine the chain-of-thought of solution is correct.
Answer with single word: "Yes" or "No".
Answer:
Prompt 9: Prompt for verifying the correctness of the chain-of-thought in a given solution, where the answer is expected to be either "Yes" or "No".
Training Prompt
Instruction:
[question]
#ilfi Response:
{solution]
Prompt 10: Training prompt of Caco model and baseline.
Evaluation Prompt
### Instruction:
(question)
Response:
Let's think step by step.
Prompt 11: Evaluation prompt of Caco model and baseline with step-by-step reasoning.
22

---

Subsequence Counting Problem
Prohlem:
How many unique subsequences can be formed from the list of numbers [1, 2, 3), where subsequence defined as any sequence that can he derived by deleting some no elements from the list without changing the order of the remaining elements?
Code:
def tays_to_reach_tte (xell beeght -linb_distance, dispadis) days current_height.
while current.height <eell_height:
heirent__hiiht -- climb_distane if current_heigh, >- vell_beight: break
current__hight alip_diatance daye +-
return days
Represent the input dictionary named 'input'
input [f"xell_he heill_height'. 20, "climb_distane" 3, "alip_distance". 23} Call function with input dictionary, assiga result 'output? output tays_to_reach_tog (npiptt)) the output print (output))
Solution:
We are asked to find the number of umiiqu subsequences** that can be formed from the list of numbers:
[1,
### Step I: Understand what subsequence is ** *uhhequuncc is any sequence that be derived by **deleting original list, #*without changing the order** the remaining elements.
elements** ** from the
For example, from [1, 2. 3]. valid subsequences include: [1]. [2), [3], [1. 2]. [1. 3]. [2. 3). [1, 2,
Also the empty subsequence (which is often considered, depending the problem's 's context)
#### Step 2: Count all possible subsequenecs
**xxcluded** subsequence. So for list of length n, there are 2" total possible subsequences (including the empty subsequence). Here, the list has 3 elements, so the total number of subsequences is:
Each element in the list either be ** **included**
2 = 8
#illi Step 3: List all the subsequences to verify
Let's list all possible subsequences of 2, 3]:
(empty subsequence), [1]. [2], [3], [1. 2). [1. 3]. [2. 3]. [1,
These are all the possible subsequences. All of them are **unique** because the elements all distinct, and the order preserved. ### Final Answer:
There are #*8 unique subsequences*** that can he formed from the list [1, 2, 3].
Case I: Subsequence Counting Problem: Counting the number of unique subsequences formed from a list of numbers.
23

---

Geometric Sequence Problem
Problem:
1. a geometric sequence,
Code:
from syпpу inport symbole, solve
def find_b(a, c):
b synbols('b') a, aquation bx*2 a*c
geonetric sequence,
aolutions solve
need to deternine the correct sign of solutions [0] solutions [1] 0:
If the product and the other la positive. He chooae the one that is consiatent sequence -1, a, b, c, -9 being decreasang. if aolutions [0] < <:
negative,
of the solutions negative
return solutions [0]
else:
return solutions [1]
elas:
return aolutions [0]
input {"aa: -1, *c": -9}
output [iad_b(*eiap)) print (output)
Solution:
are given
b, c, *"goometric sequenceh
Step I: In geometric sequence, each term obtained by multiplying the previous term constant ratio So, the sequence is:
structure a geometric sequence
-1, a, b, -9
Then:
(-1-r)-r= -r----r
WAY 2: Use the last sulve for
We are told the last term is - 9, soc
=
Divide both sides by -1:
1 =9
Now solve for y::
== + +9
Note that $/
/9
v3,
1v3
#aU Step 3: Find 2
compute ? both Ifr v3, then (v3)² 3 If /3, then ? (-v3)² = both cases:
-3
#*# Final Answer:
Case 2: Geometric Sequence Problem: Solving for b in geometric sequence with given terms.

---

Counting and Combinatorics
Problem:
Using the digits and 3 to form four-digit number, and both digits and must appear at least once. there total of such four-digit numbers.
Code:
from itertools inport product
def count_four www.ooorrii.tuueeeeeee ()::
count
4-digit combinations
for combo in product ([1, 3], repeat-4):
appear at
it 1 in combo and in combo: count retura count
Represent input dictionary 'input' imput - O
imput dictionary, assign result 'output output count caant_fourddee four_diggtt.unbbrr (**input) Print the output print (output))
Call function
Solution:
We are asked find how many * "fourrdigit numbers** can be formed using only the digits ***** and ##388, such that *#both digits and appear least once
### Step 1: Total number of four-digit numbers using digits and 3 Each of the 4 positions in the number can be filled with either #*1#* s* or $43**, s0:
Total combinations 2'
16
So. there are f6 total four-digit numbers that can be formed using only digits and 3.
#### Step Subtract the cases where only one digit used
need to exclude the numbers that "*do not contain both digits**, That is, the cases where: All digits are #* - number: 1111 All digits are #*3** - number: 3333
So. there are **2*# such numbers that we need to exclude.
### Step Compute valid numbers
Valid numbers = Total combinations Invalid combinations
16
14
#ill Final Answer:
14
There are ** 14 four-digit numbers that can formed using digits and with both digits appearing least once.
Case 3: Counting and Combinatorics problem: Counting the number of valid four-digit numbers formed by the digits and 3 where both digits appear least once. The table includes the problem description, step-by-step solution, and corresponding Python code to calculate the number of valid combinations.
25

---

Mathematical Expression Calculation
Problem:
Calculate:
V12 + V3 + 2023)
Code:
import math
def calculatee.expresionn ():
sqrt_12 agth.
abs_value abs nath.eqrt(B)) (3))
pozer_0 (math.pi 2023)
result sqrt_12 abe_value poxer_0
return result
# Represent the input dictionary named 'input" input
# Call the function with the input dictionary, assign the result to 'output' output aaleulate_.xprraattee (x+input) Print the output
print (output)
Solution:
We are asked to calculate the expression:
V12+ /3|+ 2023))
Let's break it down step by step.
### Step 1: Simplify v12 We can simplify the square root:
V12 v4.3 V4. =3=2v3
### Step Simplify /3) We know that v3 x 1.732, so:
0.732 Since the result is negative, the absolute value is:
1- 13 1.732
v3
#illi Step Simplify (N 2023) Any non-zero number raised the power of is Since 3.1416, and 2023 we have:
(π - -022) =
Step Add simplified parts Now, add the three parts together:
V12
/3 (M 2022) 2/3 (V3 1) +1
Simplify:
-
###f Final Answer:
3v3
Case 4: Mathematical Expression Calculation: Solving the expression involving square roots, absolute values, and exponentiation. The table provides a detailed breakdown of the problem-solving steps and the corresponding Python code implementation.
26

---

Tangency Condition of Line and Parabola
Problem:
Given the line y and the parabola ax² are langent each other. find the value
Code:
import вушрy ep
def find_tangens waw.glaaanenetceeeiiee coefriciettt ()::
y, symbolee line_eg - a*x**2
parabola_eq
# Subatitute fron the line equation into the parabola equation substituted_eq
carabbls_eq.eubbff
a Simplify the equation
simplified_eq
For the line and parabola to be tangent, the quadratic equation must have exactly one solution.
discrininant ap. discrininaat (smppiiieeg..slllliidee....
# Solve for a
a_value sp. so.eelo (discrininant,
retura a_value [0]
Represent the input dictionary named 'input' input = (
Call function with imput dictionary, assign result 'output? output www.aaattcoefficieeeeeeeeeeeeeee (*+input) print wrint(output)
output
Solution:
We given:
A *=inn=*:
*paraahola*:; y aa.
We are told that the *inee and the parahola are tangent each other**, which means they intersect **exactly one point** (ic. the system has exactly one solution).
MAY Step I: Solve the system of equations
We given:
L.
= = x-
Substitute the expression for from the line into the parabola:
Rewriting:
ax?
This **quadratic equation** in
ax
1=
#*# Step 2: Use the condition for tangency
For the line and the parabola be **tangent** the quadratic equation have **exactly solution That the "ddiscriminant" of the quadratic must be zero. for quadratic ax² bi + e discriminant
52 40c
casc, quadratic
a8 2 + 1=1=0
Sa:
1, compute the discriminant:
(-1)² 4(a)(1)
Sot the discriminant equal to zero (for tangency):
4a
Solve
Final
Case 5: Tangency Condition Line and Parabola: Finding the value of for the line and parabola to be tangent.
27

---

NeurIPS Paper Checklist
The checklist is designed to encourage best practices for responsible machine learning research, addressing issues of reproducibility. transparency, research ethics, and societal impact. Do not remove the checklist: The papers not including the checklist will be desk rejected. The checklist should follow the references and follow the (optional) supplemental material. The checklist does NOT count towards the page limit.
Please read the checklist guidelines carefully for information on how to answer these questions, For each question in the checklist:
You should answer [Yes]. [No], or [NA].
[NA] means either that the question is Not Applicable for that particular paper or the relevant information is Not Available.
Please provide short (1-2 sentence) justification right after your answer (even for NA).
The checklist answers are an integral part of your paper submission. They are visible to the reviewers, area chairs, senior chairs, and ethics reviewers. You will be asked to also include (after eventual revisions) with the final version of your paper, and its final version will published with the paper.
The reviewers of your paper will be asked use the checklist as one of the factors their evaluation. While "[Yes] is generally preferable to "[No]" ", it is perfectly acceptable to answer "[No] provvdddd proper justification is given (e.g.. "error bars are not reported because it would be too computationally expensive" or "we were unable to find the license for the dataset we used"). In general, answering binary way, we
"[No] or "[NA]" is not grounds for rejection. While the questions are phrased acknowledge that the true answer is often more nuanced, please just your best judgment and write justification to elaborate. All supporting evidence can appear either in the main paper or the supplemental material, provided in appendix. If you answer [Yes] to question, in the justification please point to the section(s) where related material for the question can be found.
IMPORTANT, please:
Delete this instruction block, but keep the section heading "NeurIPS Paper Checklist",
Keep the checklist subsection headings, questions/answers and guidelines below.
Do not modify the questions and only use the provided macros for your answers.
1. Claims
Question: Do main claims made abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: In the abstract and Section] we claimed our contribution and scope.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
is fine to include aspirational goals as motivation as long as is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification:
In Appendix E. we discuss the limitations of our method.
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that
paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
28

---

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g.. independence assumptions, noiseless settings, model well-specification asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't It acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
Answer: [NA]
Justification: Our work is not strictly purely theoretical work.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide short proof sketch to provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main experi- mental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided not)?
Answer: [Yes]
Justification: We have provided detailed descriptions of the experimental model, data and imple- mentation in Section 4.1 and Appendix
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided not.
If the contribution is dataset and/or model, the authors should describe the steps taken make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary either make it possible for others replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how replicate the
29

---

results, access to a hosted model (e.g., in the case of a large language model), releasing of model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily new algorithm, the paper should make it clear how to reproduce that algorithm.
(b) the contribution primarily new model architecture, the paper should describe the architecture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g.. to registered users), but it should be possible for other researchers to have some path to reproducing verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material? Answer: [Yes]
Justification: Most of the data we used are available in the public. we provide an anonymized url to share code.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurIPS code and data submission guidelines hhttps://nips.cc/ppp
Silides/CooeSuumiisee sei.bbmiissooooooccyyy for more details.
While encourage the release of code and data, understand that this might not be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for
open-source benchmark).
reproduce The instructions should contain the exact command and environment needed http//iipsscccpulllii the results. See the NeurIPS code and data submission guidelines pentps://nipaa for more details.
cc/ p
wwt.Suumissiiooosssssioooooo quiddes/CooeeSutmissiiiic.
The authors should provide instructions data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments are reprodueible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible in supplemental material (appended the paper) is recommended, but including URLs to data and code is permitted.
Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary understand the results?
Answer: [Yes]
Justification: All details are provided in the main paper and Appendix.
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented the core of the paper to a level of detail that is necessary appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, supplemental material.
7. Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined other appropriate information about the statistical significance of the experiments?
Answer: [No]
30

---

Justification: In both the main paper and the appendix. we conducted extensive experiments. However, due to resource limitations, we do not report error bars.
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors). should be clear whether the error bar is the standard deviation or the standard error of the mean.
It is OK to report 1 I-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).
error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments compute resources
Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experi- ments?
Answer: [Yes]
Justification: In Appendix B specify the computational resources used for the experiments.
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud
provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (c.g., preliminary or failed experiments that didn't 't make into the paper).
Code of ethics
Question: Does the research conducted in the paper conform, every respect, with the NeurIPS Code of Ethics https://neuripps.... http://wpp........o...///cssaeaa
Answer: [Yes]
Justification: We followed the NeurlPS Code of Ethics.
Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code Ethics.
the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).
10. Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification: The purpose of this paper is to explore data synthesis for LLM reasoning. Therefore, does not pose any societal impacts.
Guidelines:
31

---

The answer NA means that there is no societal impact of the work performed. If the authors answer NA or No, they should explain why their work has no socictal impact or why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g.. disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deploy- ment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to par- ticular applications, let alone deployments. However, if there a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: The paper poses no such risks.
Guidelines:
The answer NA means that the paper poses no such risks.
Released models that have high risk for misuse dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere usage guidelines or restrictions access the model implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators original owners of assets (c.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: The creators original owners of assets (e.g., code, data, models), used in the paper, have been properly credited and the license and terms of use have been explicitly mentioned and properly respected.
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset is used and, possible, include a URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode. com/ datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.
For existing datasets that are packeadedd, both the original license and the license of the derived asset (if it has changed) should be provided.
32

---

If this information is not available online, the authors are encouraged to reach out to the asset's creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification: The paper introduces new dataset and models, both of which are well documented. Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details of the dataset/code/moddl as part of their sub- missions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsoureing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?
Answer: [NA]
Justification: The paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human
subjects.
Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail possible should be included in the main paper.
According to the NeurlPS Code Ethics, workers involved data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: The paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending on the country in which research conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and expect authors to adhere to the NeurlPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applica- ble), such as the institution conducting the review.
16. Declaration of LLM usage
Question: Does the paper describe the usage of LLMs if it is important, original, non- standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigorousness, or originality the research, declaration is not required. Answer: [NA]
33

---

The core method development in this research does not involve LLMs as any important. original, non-standard components.
Justification:
Guidelines:
The answer NA means that the core method development in this research does not involve LLMs any important, original, or non-standard components.
Please refer to our L.M policy (https: http://arrriicccc/ooooeeeeee///a for what should or should not be described.
34


Reviews:
[{"review_id": "iQtYZQIKbF", "reviewer": "Reviewer_ZeGf", "summary": "This paper introduces Caco (Code-Assisted Chain-of-ThOught), a framework for automated generation of verifiable and code CoT data. Unlike traditional CoT methods that suffer from unverifiability issues, Caco leverages code execution to validate reasoning chains and automated back-translation to produce natural language instructions and CoTs.", "questions": "1. The proposed method is only evaluated on mathematical and algorithmic tasks. It remains unclear whether Caco's code-assisted CoT generation and filtering pipeline generalizes to other domains (e.g., logic puzzles, scientific reasoning, or commonsense QA). Have the authors considered extending their framework beyond math-centric problems?\n2. The paper does not report the proportion of generated code-CoTs that fail execution or are filtered out due to semantic or structural issues. What is the rejection rate during data generation? Understanding how much noisy or invalid data is discarded would help assess the efficiency and robustness of the pipeline.", "limitations": "See in Questions and Weaknesses", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 2, "originality": 2, "strengths_and_weaknesses": "### Strengths\n- This paper contribute a fully auto-generates 1.3M high-quality instruction-CoT pairs without human labels.\n- The proposed method outperforms prior datasets across multiple math benchmarks.\n\n### Weaknesses\n- This paper is difficult to distinguish from some accepted works [1,2]. Both adopt the same approach of converting mathematical CoTs into code, using Python execution for filtering. This has become a common practice for CoT verification. Moreover, this paper also uses AST-based code validation, resulting in significant overlap in methodlogy.\n- Evaluation limited to math.Despite the claimed generality, experiments are only conducted on math datasets. There is no evidence the framework generalizes to other reasoning domains (e.g., logic puzzles, science QA).\n- Scalability claim lacks resource metrics. While Caco claims to be scalable, the paper does not report data generation time, compute cost, or comparison to other data-efficient methods.\n\n[1] Gao L, Madaan A, Zhou S, et al. Pal: Program-aided language models[C]//International Conference on Machine Learning. PMLR, 2023: 10764-10799.\n[2] [PaD: Program-aided Distillation Can Teach Small Models Reasoning Better than Chain-of-thought Fine-tuning](https://aclanthology.org/2024.naacl-long.142/) (Zhu et al., NAACL 2024)", "was_revised": true, "final_justification": "Author's clarifications effectively addressed my concerns regarding generalizability and evaluation scope, and the additional results are very promising. I encourage the authors to include these promising findings and discussions in the revised version.\n\nMost of my concerns have been resolved, and I am inclined to raise my score.", "rebuttal": "Thank you very much for your valuable feedback and thoughtful questions. We greatly appreciate your efforts in reviewing our paper. Below, we provide our detailed response to your concerns.\n\n> W-1: This paper is difficult to distinguish from some accepted works [1,2].\n> \n\nWe appreciate the reviewer’s comment and acknowledge the growing popularity of code-assisted reasoning in recent literature. As noted, we reference relevant prior works [1,2] in Section 2.2 *“Code Integration for Enhanced Reasoning”*, which primarily use Python code for **answer verification**—not for data generation.\n\nIn contrast, our work **reframes code as an abstract representation of reasoning patterns and logical templates for entire problem families**. Specifically:\n\n- **Caco treats problem generation as code generation**: Instead of verifying generated problems with code (as in [1,2]), we first generate **executable Code CoTs**, then reverse-translate them into diverse and verifiable QA pairs. This reflects a fundamentally different motivation and methodology.\n- This shift enables several key benefits:\n    - **Scalability**: By fine-tuning on a small seed set, we sample millions of structurally valid and semantically rich Code CoTs, automatically filtered without human annotation.\n    - **Diversity**: Code abstracts reasoning beyond natural language, enabling generalizable problem-solving patterns\n        1. Through pattern-level augmentation (e.g., as illustrated in Figure 3), the model generates novel reasoning strategies beyond template memorization.\n        2. Each code trace can yield multiple natural language questions via reverse translation, increasing linguistic and topical diversity.\n    - **Verifiability**: Executable code enables automatic verification through execution, AST analysis, and answer consistency checks, ensuring high-quality reasoning data.\n    - **Cross-Domain Unification via Code**: Unlike prior math-focused work, we unify multiple domains (math, algorithms, etc.) into a shared code-based format, greatly expanding data diversity and applicability.\n\nWe will clarify these distinctions in the revised version and ensure both works are properly cited. For detailed definitions and contributions, please also see our W1 and W2 responses to Reviewer oWXi.\n\n> W-2 & Q-1: Evaluation limited to math.Despite the claimed generality, experiments are only conducted on math datasets. There is no evidence the framework generalizes to other reasoning domains (e.g., logic puzzles, science QA).\n> \n\nThank you for the insightful question. While our primary experiments focused on mathematical reasoning, **Caco is fundamentally a general-purpose framework for structured, code-based reasoning**, and is applicable to domains that exhibit **logical, symbolic, or programmatic structure**—such as **logic puzzles, scientific reasoning, and procedural tasks**.\n\n**Logic Puzzles**\n\nCaco naturally extends to logic-based tasks like puzzles and rule-based games. In many of these problems (e.g., arithmetic expression puzzles, countdown problems), the **underlying logic is shared across instances** and can be encoded as **parameterized templates**. For example, in countdown puzzle [1], we can reuse the same program structure and vary only the inputs:\n\n```python\nimport random\n\ndef generate_expression_sample(min_len=3, max_len=6):\n    ops = ['+', '-', '*', '/']\n    count = random.randint(min_len, max_len)\n    nums = [random.randint(1, 100) for _ in range(count)]\n    ops_list = [random.choice(ops) for _ in range(count - 1)]\n    expr = ' '.join(str(num) + ' ' + op for num, op in zip(nums[:-1], ops_list)) + f' {nums[-1]}'\n    return {'numbers': nums, 'expression': expr, 'result': eval(expr)}\n\nif __name__ == \"__main__\":\n    for i in range(3):\n        s = generate_expression_sample()\n        print(f\"Sample {i+1}:\\n  Numbers: {s['numbers']}\\n  Expression: {s['expression']}\\n  Result: {s['result']}\\n\")\n```\n\nThis aligns with Caco's central idea: **code abstracts problem logic more compactly than natural language**, enabling batch generation of diverse problem instances from shared reasoning templates. As such, logic puzzles are a natural fit for Caco’s generation and filtering pipeline.\n\n**Scientific Reasoning**\n\nTo further evaluate Caco pipeline's generalization, we applied the framework to **scientific QA tasks** using the MegaScience dataset. After filtering out math-related instances, we retained **5.2K science reasoning samples** as seeds. Using Caco’s pipeline:\n\n- We sampled **50K Code CoTs by CodeGen tuned on 5.2K seed CoTs.**\n- After filtering, we obtained **37K valid science QA samples**\n\nWhen finetuned on these, the model showed strong performance improvements across several scientific benchmarks:\n\n| Model | AGIEval | ARC-c | MMLU-STEM | Average |\n| --- | --- | --- | --- | --- |\n| LLaMA-MegaScience-5.2K | 42.8 | 78.6 | 55.4 | 59.0 |\n| LLaMA-MegaScience-37K | 45.0 | 84.8 | 60.5 | 63.4 |\n\nThis demonstrates that **Caco's pipeline generalizes effectively to scientific reasoning**, provided that the reasoning logic can be encoded programmatically.\n\n**Broad Generalization Evaluation**\n\nWe also benchmarked models trained with **Caco-1.3M** data across **a wide range of tasks** using the OpenCompass framework:\n\n- **Math (hard):** AIME2024\n- **Code generation:** HumanEval-Plus\n- **Science QA:** ARC-c\n- **Logic puzzles:** BBH, KorBench\n- **General knowledge & science:** AGIEval\n\nExcept for AIME (8-sample majority voting), all evaluations used **greedy decoding**.\n\n| Model | AGIEval | AIME2024 | HumanEval+ | ARC-c | BBH | KorBench | Average |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| Qwen-math-base | 42.5 | 20.0 | 12.8 | 72.2 | 19.9 | 39.7 | 34.5 |\n| **Qwen-Caco-1.3M** | **53.3** | **23.3** | **53.1** | **81.4** | **65.1** | **47.1** | **53.9** |\n| LLaMA-base | 28.5 | 0.0 | 32.3 | 79.0 | 19.8 | 23.8 | 30.6 |\n| **LLaMA-Caco-1.3M** | **46.5** | **10.8** | **34.2** | **83.1** | **33.8** | **44.1** | **42.1** |\n\nThese results confirm that **Caco-trained models generalize well beyond math**, showing strong improvements in **logic puzzles, scientific reasoning, and code tasks**, across **three different model backbones**.\n\nIn summary, while Caco was designed with mathematical reasoning in mind, its core mechanisms are broadly applicable to **any domain where logic can be codified**, and our experiments show **strong generalization across diverse reasoning domains**. We will clarify this in the revised version and include additional non-math evaluations to highlight its broader applicability.\n\n> W-3: Scalability claim lacks resource metrics.\n> \n\nWe appreciate the reviewer’s comment regarding the need to quantify the efficiency of our proposed method. To address this, we report the full computational cost for generating the **Caco-1.3M** dataset. All experiments were conducted on a machine with **8× NVIDIA A100 GPUs**.\n\n| Stage | # Samples | Time (Hours) |\n| --- | --- | --- |\n| Unifying Code CoTs | 339K | 2h |\n| Scaling Code CoTs | 5.3M | 8h |\n| Question Reversal | 4.6M | 6h |\n| Answer Generation | 4.6M | 38.5h |\n| **Total (for 1.3M valid data)** | — | **~55h** |\n- **Low Cost and Accessibility**: First, the pipeline uses only **open-source models**, avoiding reliance on costly proprietary APIs.\n- **Efficiency and Scalability**: Generating 1.3M verified samples in under 55 hours demonstrates strong scalability, with most steps parallelizable.\n- **Minimal Overhead over Standard Pipelines**: **the majority of the cost comes from answer generation**—which is ***unavoidable*** in any instruction tuning or self-improvement setup. Prior works such as STaR【1】also incur similar or higher costs in the solution generation phase, especially when multiple samples per prompt are required.\n    \n    The additional steps specific to Caco (e.g., Code CoT generation and question reversal) are relatively lightweight (combined ~16h). This is due to natural language solutions are significantly longer than questions or Code CoTs.\n    \n- **Clarification on Focus**: While we acknowledge the value of data-efficient methods, **Caco’s focus is on scalable, diverse, and verifiable reasoning data**, not minimal data volume. Our aim is to enable generalization across domains by generating rich reasoning trajectories at scale.\n\n[1] Zelikman, E., Wu, Y., Mu, J., & Goodman, N. (2022). STaR: Bootstrapping reasoning with reasoning. Advances in Neural Information Processing Systems.\n\n> Q-2: The paper does not report the proportion of generated code-CoTs that fail execution or are filtered out due to semantic or structural issues.\n> \n\nAs mentioned in **Line 171** and **Line 193**:\n\n```\n“5.3M Code CoT samples. After filtering, we retained a high-quality subset of around 4.6M executable and structurally valid programs.”\n“After the processes, it yields approximately 1.3M validated instruction-answer pairs...”\n```\n\nTherefore, the rejection rate during code generation is approximately 13%, and the rejection rate from code to question–answer pair generation is about 71%. This looks somehow with a high fail rate because we conduct a very hard and strict filtration that any failure during the code-to-question or question-to-answer generation steps is detected and filtered.\n\nThis also suggests that other data generation methods that do not include verification mechanisms may produce a large amount of incorrect or noisy data.\n\nTo present this more clearly, we will add a **figure showing the retention rate at each stage** in the final version of the paper."}, {"review_id": "vmqITOoHTx", "reviewer": "Reviewer_oWXi", "summary": "This paper proposes Caco (Code-Assisted Chain-of-ThOught), a novel framework designed to automate the synthesis of high-quality, verifiable, and diverse instruction-based Chain-of-Thought (CoT) reasoning data through code-driven augmentation. This framework can improve the scalability and generalizability of the code-assisted reasoning method, thereby enhancing the reasoning capabilities of large language models.\n\nThe key contributions are:\n\n1.\tThe authors proposed Caco, a scalable code-assisted CoT and instruction generation framework designed to automate the production of high-quality reasoning training data through code-anchored refinement.\n2.\tThe authors created Caco-1.3M, a large-scale synthetic dataset containing millions of high-quality reasoning traces\n3.\tThrough extensive experiments on multiple mathematical reasoning benchmarks, the authors demonstrate the effectiveness and advantages of Caco over existing approaches.", "questions": "1.\tWhy is your method not evaluated on the AIME dataset?\n2.\tCode-assisted methods primarily address incorrect calculations in reasoning trajectories. Does the Caco framework specifically aim to reduce calculation errors? It would be beneficial to analyze whether improvements arise from other factors, such as Caco's influence on the reasoning patterns and behaviors of LLMs.\n3.\tThe introduction mentions the length inefficiency problem. Have you compared the efficiency metrics, such as response length and generation time, of Caco with those of other baseline methods?\n4.\tSuggestion: Clearly articulate the main contributions of your work, including the dataset generation and any novel mechanisms introduced in Caco.\n5.\tSuggestion: Complete the problem formulation section to enhance clarity.", "limitations": "Yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 2, "significance": 2, "originality": 3, "strengths_and_weaknesses": "Strengths:\n\n1.\tHigh-quality framework proposal: The paper proposes a original and novel framework called Caco which effectively addresses the limitations of traditional CoT methods on the code-assisted reasoning problem, such as uncontrolled generation, insufficient quality, and limited diversity in reasoning paths.\n2.\tClear framework description: The paper provides a detailed introduction to the overall Caco framework. Each component of Caco is elaborated with specific methods and processes.\n3.\tProviding high-quality training data: The Caco framework generates a large-scale dataset, Caco-1.3M, which offers high-quality LLM reasoning training data. \n\nWeaknesses\n\n1.\tLack of clarity in the Introduction: The main contributions of the paper are not clearly explained in the introduction.\n2.\tInadequate problem formulation: The paper lacks a clear problem formulation. It is essential to explicitly define and describe the code-assisted reasoning problem, using appropriate notations to help readers understand the whole framework.", "was_revised": true, "final_justification": "Thanks for the response.", "rebuttal": "We truly appreciate the time and effort you dedicated to reviewing our work. Below, we provide detailed responses to your concerns, and we hope this clarifies our design decisions and highlights the key contributions of our approach more clearly.\n\n> W-1: Lack of clarity in the Introduction: The main contributions of the paper are not clearly explained in the introduction.\nQ-4: Clearly articulate the main contributions of your work, including the dataset generation and any novel mechanisms introduced in Caco.\n> \n\nThank you for pointing out the need for clearer articulation of our contributions. In the revised version, we will restructure the introduction to explicitly present the **main contributions and novel mechanisms** introduced by Caco. Below, we summarize these points clearly:\n\nWe propose **Caco**, a unified and scalable framework for generating large-scale, high-quality, and verifiable chain-of-thought (CoT) reasoning data by treating **code as the central abstraction** of logical reasoning. Unlike prior methods that begin with natural language questions and derive CoTs, **Caco reverses this pipeline**: it first generates executable **code-based reasoning traces (Code CoTs)** and then reverse-translates them into diverse, verifiable question-answer pairs. This inversion unlocks key benefits in **scalability, verifiability, and cross-domain diversity**.\n\nTo support this, we train a **code-based CoT generator**, which learns from a high-quality seed dataset and is capable of **sampling millions of reasoning chains**. This approach significantly improves the efficiency and diversity of data generation compared to prior methods that rely heavily on manual templates or language-only augmentation.\n\nThe key contributions of Caco are:\n\n- **Closed-Loop Generation with Built-in Verifiability.** Caco introduces an **end-to-end pipeline** combining generation, validation, and translation. The process guarantees correctness by design through **Code execution checks, AST-based structural filtering and Answer consistency verification**. This makes every QA pair **self-consistent, verifiable, and ready for downstream use**, including reinforcement learning.\n- **Scalable Data Generation via a Trained Code Generator:** We train a **code-based CoT generator** on a small set of verified seed examples. This model can efficiently sample **millions of high-quality reasoning traces**, enabling **scalable and low-cost** dataset creation without manual templates or annotations.\n- **Code-Centered Augmentation for Diversity and Generalization**\n    \n    Caco uses code as a modular reasoning template, supporting two types of augmentation:\n    \n    - **Pattern-level augmentation**: sampling novel reasoning strategies beyond seen templates.\n    - **Problem-level augmentation**: translating a single code trace into multiple linguistically distinct questions.\n    \n    This improves **data diversity and model generalization** across tasks and formats.\n    \n- **Cross-Domain Reasoning Unification**\n    \n    By representing both **mathematical and algorithmic reasoning** in Python code, Caco provides a **shared reasoning format** across domains. This promotes **data source diversity**, facilitates **cross-domain learning**, and broadens the applicability of the framework.\n    \n\n> W-2: Inadequate problem formulation: The paper lacks a clear problem formulation. It is essential to explicitly define and describe the code-assisted reasoning problem, using appropriate notations to help readers understand the whole framework.\n\nQ-5: Suggestion: Complete the problem formulation section to enhance clarity.\n> \n\n### 1. Problem Definition\n\n- Let the problem space be $\\mathcal{P}$, with each problem denoted as $p \\in \\mathcal{P}$ and its correct answer as $a^*$.\n- Define the space of **Code-based Chain-of-Thoughts (Code CoT)** as $\\mathcal{C}$, where each executable reasoning program $c \\in \\mathcal{C}$ produces the correct answer via Python execution: $F(c) = a^*$, where $F(\\cdot)$ denotes running $c$ in a Python environment.\n- Our goal is to generate diverse, verifiable new problems $p'$ and answers $s'$ from a small set of seed problems, with each $p'$ linked to a validating program $c'$.\n\n### 2. Core Functions\n\n- We use a general language model $G$ for conditional generation:\n    \n    $G_{p \\to c}:\\mathcal{P}\\to\\mathcal{C},\\quad G_{c \\to p}:\\mathcal{C}\\to\\mathcal{P},\\quad G_{p \\to s}:\\mathcal{P}\\to\\mathcal{S}$\n    \n    where $G$ can be any sequence-to-sequence model.\n    \n- An unconditional generator $U$ samples candidate programs:\n    \n    $U: \\varnothing \\to \\mathcal{C}$\n    \n- $F$ is a code executor that filters valid programs through execution, AST checks, and output consistency:\n    \n    $F(c) = a^*$\n    \n\n### 3. Conventional Method and Its Limitations\n\nThe common data synthesis approach:\n\n- Rewrite $p$ into $p'$: $P' = {G_{p \\to p'}(p)}$\n- Generate answer: ${p', s'} = {G_{p \\to s}(p')}$\n\nLimitations:\n\n1. $p'$ depends on $p$, limiting diversity.\n2. No guarantee of solvability of $p'$ or correctness of $s'$.\n\n### 4. Caco: A Code-Driven Framework\n\nCaco generates new problems by sampling new code instead of rewriting existing problems:\n\n1. **Seed Collection and CodeGen Fine-Tuning**\n    \n    $\\mathcal{C}_{\\rm seed} = \\{G_{p \\to c}(p)\\mid F(c) = a^*\\}$\n    \n    Fine-tune $U$ on $\\mathcal{C}_{\\rm seed}$ to model valid code distributions.\n    \n2. **Sampling New Programs and Reversing to Questions**\n    \n    $\\{(p', c')\\} = \\{G_{c \\to p}(c')\\mid c' \\sim U()\\}$\n    \n    Each $c'$ is translated into a question $p'$, with its correctness validated via $F(c')$.\n    \n3. **Answer Generation and Filtering**\n    \n    $\\{(p', s', c')\\}_{\\rm valid} = \\{G_{p \\to s}(p') \\mid G_{p \\to s}(p') = F(c')\\}$\n    \n    Answers are only accepted if consistent with code execution.\n    \n\n### Benefits\n\n- **Diversity**: Code serves as an abstract, language-independent reasoning template, enabling pattern-level and problem-level augmentation.\n- **Verifiability**: Each problem is paired with executable logic, allowing strict automated validation.\n- **Scalability**: The framework supports large-scale generation via unconditional sampling and efficient filtering.\n\n> Q-1: Why is your method not evaluated on the AIME dataset?\n> \n\nThank you for the question. We initially did not evaluate on AIME because **our models were trained only with short-CoT supervised fine-tuning**, which is insufficient to yield strong improvements on AIME without more advanced **System-2 reasoning strategies**.\n\nIn early experiments using **Qwen-Math-base**, we observed only marginal gains on AIME(20% to 23.3%)—likely due to the fact that Qwen already exhibits strong performance on math reasoning tasks. However, when we tested **LLaMA-based models** (as shown in **ZeGf-W2 Table**), we observed a more substantial gain from **0% to 10.83% (Average@8 samples)**, suggesting Caco’s benefits are more pronounced on weaker base models.\n\nInspired by the System-2 reasoning paradigm, we later conducted experiments using **Caco-Long**, described in **Appendix C.1**. This involved generating 100K long-form CoTs using Qwen3 in “thinking mode”, and yielded some improvement.\n\nAfter the submission, we further realized that **long-CoT learning requires higher learning rates and longer training schedules** due to its distinct reasoning pattern. We therefore re-trained the model using **lr=5e-5** (10× the original), with **3 epochs** and **an expanded dataset of 300K long CoTs**. This led to further performance gains, as shown in the updated results in **NsmM-W2 Table**.\n\n> Q-2: Code-assisted methods primarily address incorrect calculations in reasoning trajectories. Does the Caco framework specifically aim to reduce calculation errors? It would be beneficial to analyze whether improvements arise from other factors, such as Caco's influence on the reasoning patterns and behaviors of LLMs.\n> \n\nWe appreciate the reviewer’s interest in the underlying factors behind Caco’s performance gains. Unlike many code-assisted methods that focus specifically on reducing calculation errors, Caco does not target a specific error type.\n\nInstead, Caco emphasizes scaling diverse, verifiable reasoning traces. During code verification, all incorrect samples—whether due to calculation mistakes, logical flaws, or incomplete reasoning—are filtered out, ensuring that only correct and executable reasoning paths are retained.\n\nFurthermore, to better diversify the reasoning behaviors and patterns represented in the training data, we deliberately included algorithmic problems in the seed dataset. These problems require reasoning patterns that are structurally different from typical math problems, such as **recursion, dynamic programming, and search algorithms**. By doing so, Caco enables the model to internalize a **broader set of reasoning strategies**, which we believe contributes meaningfully to its improved generalization and robustness across tasks. \n\n> Q-3: The introduction mentions the length inefficiency problem. Have you compared the efficiency metrics, such as response length and generation time, of Caco with those of other baseline methods?\n> \n\nWhen we mention “length inefficiency” in the introduction, we are referring to how **long chain-of-thoughts (CoTs) often introduce redundancy and increase the risk of logical inconsistencies**. In many long-CoT setups, the reasoning trace can span **tens of thousands of tokens**, even for relatively simple problems—resulting in unnecessarily verbose answers.\n\nRegarding your question on response length, we analyzed the length of our generated **code-based CoTs**, which are much more compact. On average, each CoT contains 41**5 tokens**, with a standard deviation of 284. Compared to long-CoT baselines, this represents a significant reduction in output length, suggesting improved efficiency in both reasoning compactness and model usage."}, {"review_id": "fo8kFlEtxB", "reviewer": "Reviewer_qgmg", "summary": "This paper proposes a technique called “Caco” for synthetic data generation which works by translating math reasoning problems to and from code. Specifically, Caco has the following stagers: (1) prompt an LLM (Qwen-2.5-72B-Instruct) to convert existing math datasets to a unified code format (which the paper calls a “Code CoT”) which are filtered to ensure they produce the same answer as in the original dataset; (2) finetune a new LLM (unclear which one) on the Code CoTs to produce a model called CodeGen; (3) sample from the CodeGen model to create novel Code CoTs; (4) prompt an LLM (unclear which one) with the Code CoTs to produce corresponding natural language prompts, and filter the resulting prompts (using Qwen3-32B) to ensure that they are solvable. This procedure results in a dataset of 1.3M math problems which, when used to finetune various models (DeepSeekMath-7B, Qwen-2.5-Math-7B, LLaMA3-8B), substantially improves their reasoning performance across six benchmarks, outperforming the performance of those same models when trained on a variety of other math-specific datasets.", "questions": "### Missing, Unclear, and Inconsistent Details\n\nThere are some missing details and inconsistencies. I would need to see all of these addressed to raise my score:\n\n* Which model is finetuned to produce the CodeGen model?  \n* Which model is used to produce the natural language instructions and solutions (detailed in Section 3.3)?  \n* More generally (e.g. lines 114, 147, 176, 187, 192): rather than saying “a LLM” the paper should always be explicit about which particular model is used.  \n* Caco-Seed-109K needs more explanation. The paper says it is the “seed data used to train CodeGen”, but that would be data consisting of Code CoTs, not natural language prompts and CoTs. Moreover, Line 162 says that the seed dataset is 162K examples, not 109K. Why are these numbers different? Where do the natural language CoTs come from? (Is it just that you’ve applied the rest of the Caco procedure to the 162K to generate the CoTs, and applied filtering, thus reducing the size of the dataset?)  \n* Plots and tables should include confidence intervals/error bars. These do not need to be derived from multiple experiments (I agree with the authors this would be too computationally expensive) but they can still be computed over the *dataset*. For example, for GSM8K (with N=1319 questions) and Caco-1.3M-LLaMA3-8B (with p \\= .878) the upper 95% confidence interval is .878 \\+ 1.96 \\* sqrt(p \\* (1 \\- p)) / sqrt(n) \\= 0.896 (see [https://en.wikipedia.org/wiki/Binomial\\_proportion\\_confidence\\_interval](https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval)).\n\n### Possible Distillation Effect\n\nTo generate the seed Code CoTs, the paper uses a much larger model (Qwen-2.5-72B-Instruct) than the models ultimately finetuned on Caco & benchmarked in Table 1\\. I am worried that because of this, the Caco data pipeline is essentially just implementing a process of distillation from this larger model.\n\nAn important, simple baseline would be to instead sample natural language CoTs from Qwen-2.5-72B-Instruct and use them for finetuning the smaller models. If this results in similar performance as training on Caco (when matched for dataset size), this would suggest that the ability to synthesize new prompts is not providing much benefit—rather, the gains are coming from solutions generated by a larger model.\n\nI would need to see a comparison to this baseline (or something analogous to convince me that the results are not coming from distillation) to consider raising my score.\n\nIdeally, the paper would also include benchmark scores for Qwen-2.5-72B-Instruct for reference.\n\n### Comparison to STaR / ReST-EM\n\nRelated to the above point, but slightly different, is that the Caco procedure can be seen in some sense as a (relatively complicated) iteration of STaR \\[1\\] or ReST-EM \\[2\\], which is a much simpler method. An important baseline would be to include a comparison to a single iteration of self-improvement: (1) generate CoTs from a model (e.g. one of the ones benchmarked), (2) filter the CoTs by correctness, (3) and then finetune the model on the resulting traces.\n\nThis would be an important control because it would again show that the gains are coming from having a higher number of unique prompts to train on, rather than a more generic form of self-improvement. (Note it should be possible to match for dataset size as well by generating multiple samples per prompt.)\n\nI would need to see a comparison to this baseline (or something analogous to convince me that the results are not coming from vanilla self-improvement) to consider raising my score.\n\nRefs:\n\n1. Zelikman, E., Wu, Y., Mu, J., & Goodman, N. (2022). STaR: Bootstrapping reasoning with reasoning. Advances in Neural Information Processing Systems, 35, 15476-15488.  \n2. Singh, A., Co-Reyes, J. D., Agarwal, R., Anand, A., Patil, P., Garcia, X., ... & Fiedel, N. (2023). Beyond human data: Scaling self-training for problem-solving with language models. arXiv preprint arXiv:2312.06585.\n\n### Minor Points\n\nThese are some suggestions for improving the paper (but have not strongly influenced my score):\n\n* Line 66 \\- please make it clear what the “65.4% accuracy” is over (i.e. the six benchmarks).  \n* As far as I can tell, the “problem-level augmentation” described in Figure 3 isn’t mentioned anywhere else in the paper. It should be removed if it’s not part of the paper, or made clear what part of the text this is referring to.  \n* Section 3.4 seems like it could be in the appendix.  \n* Section C.1: What is Caco-100K? It is not described anywhere.  \n* Section C.2: I’m not sure I understand this experiment. Is the idea that when generating the problem solutions on the Caco prompts, you enable thinking, and then train on these longer traces instead? If so, I think this not a very informative experiment without the inclusion of some further baselines (e.g. AIME performance after training on Caco w/o long prompts)", "limitations": "The main unaddressed limitation is the fact that the paper uses a larger model as part of the data generation procedure, but then only evaluates on smaller models. This could result in the improved results being due to a distillation effect, rather than due to the proposed data generation method. This limitation should be addressed.\n\nEDIT: I believe the authors' rebuttal has sufficiently addressed this limitation.", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 2, "significance": 4, "originality": 3, "strengths_and_weaknesses": "Pros:\n* Originality: It is an interesting idea to leverage a formal language to constrain the synthetic data generation process, which enables more reliable verification. This is not a completely original idea on its own (e.g. methods like AlphaGeometry also leverage this idea) but to my knowledge the particular instantiation of this idea in this paper is new.\n* Significance: Synthetic data generation is an important area of LLM research especially in reasoning domains, as high-quality, expert-level human-generated data is hard to come by.\n* Clarity: I appreciate that all the prompts used in the pipeline are included in the appendix, thank you for including this level of detail.\n\nCons:\n* Clarity: I found the paper difficult to read at times. (1) The method is relatively straightforward to explain yet I found the explanation—especially in the abstract and introduction—to be unclear and it was not until I had fully finished reading the methods that I was able to understand it. Similarly, I found Figure 2 to not be particularly easy to understand—I needed to read the text first to understand it, whereas it should really be the other way around. (2) Many details are also scattered throughout the paper & appendix making it difficult to completely understand the full picture.\n* Clarity: I find the term “Code CoT” to be misleading. It’s not a chain-of-thought at all because it’s not step-by-step reasoning—it’s a programmatic solution to the given problem.\n* Quality: Important details are missing from the paper, and there are some inconsistencies. I detail these further below in the “Questions” section.\n* Quality: Given that the paper uses a larger model (Qwen-2.5-72B-Instruct) to generate the seed dataset of Code CoTs, I have a concern about whether the gains come from the knowledge from the more advanced model, or from the Caco procedure. I discuss this concern in more detail below in the “Questions” section.\n* Quality: The proposed procedure shares some similarities with STaR/ReST, which are much simpler methods. Ideally one iteration of STaR would be included as a baseline to confirm that the gains obtained from Caco are indeed due to leveraging the code representation. I discuss this concern in more detail below on the “Questions” section.", "was_revised": true, "final_justification": "The authors have included extensive results regarding the possible distillation and self-improvement effects, which fully address my concerns. They have also promised to improve the clarity and sufficiently answered the questions I had about various details. Of course, I can't evaluate whether the clarity is improved without reading the revised paper but my main concerns were about distillation/self-improvement and these have been resolved.", "rebuttal": "We’re grateful for your valuable feedback and the careful attention you’ve given to our submission. Below we provide responses to your questions, and we hope this helps clarify our methodology and resolve your concerns.\n\n> W-1: Clarity: I found the paper difficult to read at times. \nW-2: Clarity: I find the term “Code CoT” to be misleading.\n> \n\n**Response to W-1: Clarity of Presentation**\n\nThank you for the feedback. As suggested, we have revised the abstract and introduction to provide a **clearer and more concise overview of the core methodology**, ensuring readers can grasp the main idea without needing to read the full methods section.\n\nIn addition, we will **redesign Figure 2** to make the workflow more intuitive and self-explanatory. We also plan to include a **dedicated “Problem Formulation” section**, as recommended by reviewer **oWXi-W2**, to help organize key concepts.\n\nFurthermore, in response to your point in **W-3**, we have consolidated scattered technical details from the appendix into the main text to improve clarity and cohesion.\n\n**Response to W-2: On the Term “Code CoT”**\n\nWe appreciate your observation. Our original intent behind the term “Code CoT” was to describe reasoning traces expressed in **code (i.e., programmatic) form**, as a structured and executable variant of chain-of-thought.\n\nWe used the term “CoT” because such programs encode **sequential reasoning steps** implicitly—for example, variable initialization reflects problem setup, and each computation (e.g., via `SymPy`) corresponds to an intermediate logical operation.\n\nThis framing is consistent with prior terminology:\n\n- **PAL** [1] refers to this as “programmatic steps,”\n- **PoT** [2] describes it as “Programs of Thought,” suggesting that “LMs can express reasoning steps as Python programs.”\n\nWe acknowledge that the term “Code CoT” may be misleading, as such traces do not contain explicit step-by-step natural language explanations. In the revised version, we are considering replacing it with a more precise term such as **“Program of Thoughts”** for improved clarity.\n\n[1] Gao, Luyu, et al. \"Pal: Program-aided language models.\" International Conference on Machine Learning. PMLR, 2023\n\n[2]Chen, Wenhu, et al. \"Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks.\" arXiv preprint arXiv:2211.12588\n\n> W-3: Quality: Important details are missing from the paper, and there are some inconsistencies. I detail these further below in the “Questions” section.\n> \n\nSorry for missing details. We give detailed information here, and we will revise as you suggested.\n\n- After generating the seed Code CoT dataset, we fine-tuned **Qwen2.5-Coder-7B** to obtain the CodeGen model.\n- The natural language instructions and answers mentioned in Section 3.3 were generated using **Qwen3-8B (non-thinking mode)**.\n- Thank you for the suggestion. We will replace vague mentions like \"an LLM\" with the specific model names throughout the paper, e.g. Qwen2.5-Code-7B, Qwen3-8B.\n- Exactly — the **162K** seed dataset includes the original source problems, which correspond to the “Original Math Problem” branch in Figure 2. Like the synthetic problems, we used **Qwen3-8B** to generate Language CoTs for them, and after filtering, **109K** samples remained. The current description is unclear, and we will revise it in the next version.\n- Thank you for the reminder. We will add **confidence intervals** to tables.\n\n> W-4 & Limitation: Quality: Given that the paper uses a larger model (Qwen-2.5-72B-Instruct) to generate the seed dataset of Code CoTs, I have a concern about whether the gains come from the knowledge from the more advanced model, or from the Caco procedure.\n> \n\nThank you for raising this important point. To evaluate whether the performance gains are primarily due to knowledge transfer from the large teacher model (Qwen-2.5-72B-Instruct) rather than the Caco procedure itself, we conducted the following **control experiment**:\n\n- We used **Qwen-2.5-72B-Instruct** to generate natural language CoT answers for the **same seed questions**, using multiple sampling rounds to create a dataset of **300K QA pairs**, which we refer to as **Qwen72B-Seed-distilled**.\n- We then fine-tuned the same student model on this dataset and compared it to a **300K subset of Caco**, and the full **Caco-1.3M** dataset.\n\nThe results are shown below:\n\n| Dataset | #Samples | MATH | GSM8K | College | DM | Olympiad | TheoremQA | AVG |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| Qwen-7B-Qwen72B-Seed-distilled | 300K | 79.0 | 91.2 | 52.1 | 84.4 | 41.3 | 45.0 | 65.5 |\n| Qwen-7B-Caco-300K | 300K | 81.6 | 92.4 | 51.2 | 84.8 | 42.5 | 44.9 | 66.2 |\n| Qwen-7B-Caco-1.3M | 1.3M | 82.4 | 92.6 | 51.4 | 87.1 | 46.5 | 46.0 | 67.7 |\n|  |  |  |  |  |  |  |  |  |\n| DS-7B-Qwen72B-Seed-distiiled | 300K | 57.4 | 83.0 | 42.4 | 69.0 | 23.4 | 31.4 | 51.1 |\n| DS-7B-Caco-300K | 300K | 61.8 | 83.2 | 43.3 | 76.0 | 23.9 | 31.1 | 53.2 |\n| DS-7B-Caco-1.3M | 1.3M | 68.2 | 85.1 | 46.0 | 80.2 | 29.5 | 33.8 | 57.1 |\n|  |  |  |  |  |  |  |  |  |\n| Qwen2.5-72B-Instruct | - | 83.1 | 95.8 | 53.0 | 83.7 | 46.7 | 46.0 | 68.1 |\n\n*Note: Unlike the results reported in the original paper, we found after submission that the model requires **3 epochs of training to fully converge**. The results shown here are based on this updated 3-epoch training.*\n\nWe draw two key conclusions from this:\n\n1. **Caco outperforms the distilled data** (66.2 vs. 65.5 AVG) even at the same dataset size, suggesting that **prompt and reasoning diversity**—enabled by Caco’s code-based augmentation—is beneficial beyond simply copying teacher traces.\n2. **Caco scales more effectively**: When expanding to 1.3M samples, the model gains further improvement, which would be difficult to achieve using the seed-only natural language questions, demonstrating Caco’s **scalability advantage** in generating diverse and verifiable new problems.\n\nThese results confirm that the improvements come not just from the use of a strong teacher, but from the **Caco generation procedure itself**, which promotes data diversity, verifiability, and scalability.\n\n> W-5: Quality: The proposed procedure shares some similarities with STaR/ReST, which are much simpler methods. Ideally one iteration of STaR would be included as a baseline to confirm that the gains obtained from Caco are indeed due to leveraging the code representation. I discuss this concern in more detail below on the “Questions” section.\n> \n\nThank you for the valuable suggestion. We would like to clarify that **Caco’s primary focus is not on improving answers for a fixed set of questions** (as in STaR or ReST), but rather on **generating a much larger and more diverse set of new problems** through code-based reasoning traces. Unlike STaR, Caco does not follow a traditional **self-improvement paradigm**. Rather than using model-generated answers to improve the same model, we **train a dedicated code generator** to produce executable CoTs from scratch—shifting the focus from answer refinement to **scalable, verifiable data creation**.\n\nThat said, we agree that the two directions are not mutually exclusive. In fact, we believe that applying STaR-style self-improvement **on top of the more diverse prompts generated by Caco** could yield further gains.\n\nTo directly address your suggestion of a **single iteration of self-improvement** as a control, we conducted the following experiment:\n\n- Using **DeepSeek-Math-7B**, we generated 4 CoTs for each of the 109K seed examples.\n- After filtering incorrect answers, we retained **363K verified solutions**, from which we randomly sampled **300K (DS-7B-Seed-self-improve)** for comparison.\n- We compared this to **300K randomly sampled data from the full Caco dataset (DS-7B-Caco-300K)**.\n\n**The results are as follows:**\n\n|  | #sample | MATH | GSM8K | College | DM | Olympiad | Theoremqa | AVG |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| DS-7B-Seed-self-improve | 300K | 53.1 | 86.7 | 41.6 | 62.5 | 19.3 | 30.2 | 48.9 |\n| DS-7B-Caco-300K | 300K | 61.8 | 83.2 | 43.3 | 76.0 | 23.9 | 31.1 | 53.2 |\n| Qwen-7B-Seed-self-improve | 300K | 70.7 | 83.0 | 47.1 | 47.6 | 39.0 | 28.2 | 52.6 |\n| Qwen-7B-Caco-300K | 300K | 81.6 | 92.4 | 51.2 | 84.8 | 42.5 | 44.9 | 66.2 |\n\nWe observe that the **Caco-based dataset consistently outperforms the STaR-style self-improvement baseline across all evaluated benchmarks**. We hope this additional baseline helps clarify the distinction and effectiveness of our approach.\n\n> **Minor Points**\n> \n> \n> These are some suggestions for improving the paper (but have not strongly influenced my score):\n> \n- The **65.4%** refers to the **average accuracy of Caco-1.3M-Qwen2.5-Math-7B** across the six benchmarks in the main experiment. We will revise it to: *“65.4% average accuracy on six benchmarks in Section 4.2.”*\n- Thank you for the reminder. We will discuss both forms of augmentation in **Section 3.3** to better intuitively show the advantages of our method.\n- Noted, we will move **Section 3.4** to the appendix.\n- **Caco-100K** is a subset of more difficult problems sampled from the full Caco dataset. We assess difficulty based on the average pass rate over three generations using **Qwen2.5-Math-7B-Instruct**.\n- Yes, the experiment enables chain-of-thought reasoning when generating answers, and then trains on these longer traces. Our motivation is that **test-time scaling methods like system-2 prompting can further benefit from our data**, especially on extremely hard problems, e.g. AIME. We have added a comparison between the **short-CoT** and **long-CoT fine-tuned models** in the **NsmM-W2 table**."}, {"review_id": "iMN2k123Hv", "reviewer": "Reviewer_NsmM", "summary": "The paper introduces Caco (Code-Assisted Chain of Thought), a framework for generating large-scale, high-quality, and executable reasoning data (in the form of Python code) to train large language models (LLMs). It addresses key limitations of traditional Chain of Thought (CoT) prompting, which is typically done in natural language and suffers from issues such as unverifiability, reliance on manual annotation, and logical inconsistencies. The authors demonstrate that fine-tuning both specialized and general-purpose open-source models on the proposed dataset significantly improves their performance on mathematical reasoning benchmarks.", "questions": "See the weakness section", "limitations": "yes", "rating": 4, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 2, "significance": 3, "originality": 2, "strengths_and_weaknesses": "**Strengths**\n\n- A dataset where reasoning traces are executable (i.e., Python programs) can significantly improve the verifiability and reliability of reasoning chains. Unlike natural language-based reasoning, which is difficult to parse and not directly executable.\n- Fine-tuning results show consistent improvements across benchmarks.\n\n**Weaknesses**\n\n- Although the dataset is useful, the core research contributions are somewhat unclear. Representing reasoning in executable code and using fine-tuned models like CodeGen for data generation have both been explored in prior work. For example, \\[1] uses (a similar idea) Formalizer models to generate formal proof data from informal sources. It would be great if the authors could clarify their technical contributions and how they compare with existing, well-known ideas.\n- While the results reported in Table 1 are promising, existing methods such as rStar-Math appear to achieve substantially better performance with similarly sized models (see Table 5 in \\[2]). The authors should clarify why this baseline was not included and, if possible, provide a fair comparison with such existing methods.\n\n\\[1] *Goedel-Prover: A Frontier Model for Open-Source Automated Theorem Proving*\\\n\\[2] *rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinking*", "was_revised": true, "final_justification": "I am largely satisfied with the submission and will maintain my score at 4. However, I would not give a higher score due to the lack of technical novelty in the paper, although it does present strong empirical results.", "rebuttal": "Thank you for your time and thoughtful review. We have carefully considered your comments and provide detailed responses below, with the hope that they clarify our intentions and strengthen the understanding of our work.\n\n> W-1: Although the dataset is useful, the core research contributions are somewhat unclear. Representing reasoning in executable code and using fine-tuned models like CodeGen for data generation have both been explored in prior work. For example, [1] uses (a similar idea) Formalizer models to generate formal proof data from informal sources. It would be great if the authors could clarify their technical contributions and how they compare with existing, well-known ideas.\n> \n\nIn [1], the approach first converts math problems into formal theorem statements and then uses a prover model to generate formal proofs. These proofs are filtered based on verifiability, and the correct ones are added for iterative self-improvement. The primary goal of [1] is to sample the **highest-quality answers** possible under a **fixed set of problems**.\n\nIn contrast, our work focuses on **generating large-scale, diverse, and verifiable problems** across domains such as mathematics, algorithms, and logic—all unified under a **Python-based code representation**. By leveraging a **code generation model**, we synthesize new problems by first generating code-based reasoning traces and then translating them into natural language, enabling both diversity and scalability.\n\nTo clarify these distinctions, we will revise the manuscript to explicitly highlight the differences from [1], and we will **include proper citations to both works** as suggested.\n\nFor more precise definitions and contribution statements, we refer the reviewer to our responses to **Reviewer oWXi-W1 and oWXi-W2**.\n\n> W-2: While the results reported in Table 1 are promising, existing methods such as rStar-Math appear to achieve substantially better performance with similarly sized models (see Table 5 in [2]). The authors should clarify why this baseline was not included and, if possible, provide a fair comparison with such existing methods.\n> \n\nThank you for raising this important point. Our method focuses on scalable reasoning data generation with basic SFT, while **rStar-Math** is a **System 2-style test-time reasoning framework** that uses **multi-stage evolution, Monte Carlo Tree Search (MCTS), and a PPM-based reward model** to select final answers.\n\nTo enable a fair comparison, we consider both greedy and sampled decoding modes:\n\n**Greedy Inference**\n\nThe main results reported in rStar-Math (Table 5 in [2]) rely on sampling **64 responses** per question and selecting the best one using PPM scoring (denoted `rStar-Math-best@64`). This is not directly comparable to our default greedy decoding setting.\n\nTo enable a fair comparison, we refer to **rStar-Math’s greedy baseline** (Table 10 in [2]) and compare it to our Caco-1.3M model under similar decoding.\n\n**System2 Sampling**\n\nTo compare with the main results in rStar-Math, we initially considered replicating rStar’s full MCTS+PPM pipeline but found it incompatible:\n\n- The rStar-Math model is trained to decode step-by-step outputs (`### Step n`) to enable MTCS which our model doesn’t generate natively.\n- Instead, we adopt long-form CoT with majority voting—a simpler and widely used System 2-style approach.\n\nWe also evaluate **Caco-Long**, a System 2-style model trained on long CoTs, using both greedy decoding and **8× sampling with majority voting** (temperature=0.8, top_p=0.9).\n\nDue to the large evaluation cost on Math and Olympiad, we only performed sampling on AMC and AIME. All model are based on Qwen2.5-Math-7B.\n\n|  | Model | Inference Mode | Training Strategy | AIME2024 | Math | AMC23 | Olympiad | Average |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| System1 | rStar-Math (greedy) | Greedy | 4stage eolve with PPM | 26.7 | 78.4 | 47.5 | 47.1 | 49.9 |\n|  | Caco-1.3M | Greedy | sft 3epoch | 23.3 | 82.4 | 67.5 | 46.5 | 54.9 |\n| System2 | Caco-Long-300K | Greedy | sft 3epoch | 40.0 | 89.6 | 75.0 | 58.9 | 65.9 |\n|  | rStar-Math-best@64 | MCTS+PPM (64 samples) | 4stage eolve with PPM | 53.3 | 90.0 | 87.5 | 65.6 | 74.1 |\n|  | Caco-Long-major@8 | Majority (8 samples) | sft 3epoch | 56.6 | - | 90.0 | - |  |\n\n*Note: Unlike the results reported in the original paper, we found after submission that the model requires **3 epochs of training to fully converge**. The results shown here are based on this updated 3-epoch training.*\n\n**Key observations:**\n\n- **Under greedy decoding**, Caco-Long outperforms rStar-Math’s greedy policy by a large margin.\n- With **just 8 sampled outputs**, Caco-Long surpasses rStar-Math-best@64, which uses 64 samples and a reward model.\n\nWhile rStar-Math introduces a sophisticated multi-round framework, our work focuses on improving **cold-start performance** via better data generation. These two directions are complementary: **Caco can provide stronger initial models and data, which rStar-style pipelines can further evolve**.\n\nWe appreciate the reviewer’s suggestion and will include this comparison in the revised version to better contextualize our contributions."}]

Author rebuttal:

Meta-review: This paper proposes a novel framework, Caco (Code-Assisted Chain-of-ThOught), which automates the generation of high-quality, verifiable, and diverse reasoning data. Caco first fine-tunes a code-based CoT generator on existing math and programming solutions in code format, and then scales the data generation to a large amount. Experiments demonstrate that models trained with Caco achieve competitive performance.

For the revision, the authors should provide a clearer justification of the contributions compared to existing code-aided reasoning approaches and include further comparisons with similar methods. Additional details are also needed, such as the problem formulation, dataset construction process and cost, as well as clarifications on experimental settings.
Decision: Accept (poster)