用执行轨迹构建显式推理链,提升大模型通用推理能力
Chain of Execution Supervision Promotes General Reasoning in Large Language Models
- 将代码执行过程转为显式步骤推理链,消除语法噪声
- 在20个基准上平均提升7.1%,数学类任务表现突出
- 适合需要强逻辑推理的AI研发与教育应用
构建鲁棒且通用的推理能力是大语言模型发展的核心目标。近期研究越来越多地采用代码作为训练资源,因其具备内在逻辑结构和多样化的推理范式,如分治、拓扑排序和枚举等。然而,代码中的推理常隐含于语法或实现细节中,直接使用原始代码进行训练效果不佳。为此,我们提出了TracePile,一个包含260万样本的大规模语料库,将代码执行过程转化为显式的、分步的链式思考式推理,称为执行链(Chain of Execution, CoE)。该语料库覆盖数学、经典算法及算法竞赛等领域,并通过变量追踪问题和代码重写增强逻辑粒度与代码多样性。我们在三种训练设置下评估TracePile:持续预训练、预训练后的指令微调以及两阶段微调。实验在四个基础模型(LLaMA 3、LLaMA 3.1、Qwen-2.5、Qwen-2.5 Coder)和20个涵盖数学、代码、逻辑与算法的基准上均显示一致提升。显著的是,TracePile使LLaMA3.1-8B在九个数学数据集上平均提升7.1%,并在两阶段微调下对LiveCodeBench、CRUX和MMLU均有明显改善。
原文摘要 · Abstract (English)
Building robust and general reasoning ability is a central goal in the development of large language models (LLMs). Recent efforts increasingly turn to code as a rich training source, given its inherent logical structure and diverse reasoning paradigms such as divide-and-conquer, topological ordering, and enumeration. However, reasoning in code is often expressed implicitly and entangled with syntactic or implementation noise, making direct training on raw code suboptimal.To address this, we introduce TracePile, a large-scale corpus of 2.6 million samples that transforms code execution into explicit, step-by-step chain-of-thought-style rationales, which we call Chain of Execution (CoE). The corpus spans domains including mathematics, classical algorithms and algorithmic competition, and is enriched with variable-tracing questions and code rewritings to enhance logical granularity and code diversity. We evaluate TracePile using three training setups: continue-pretraining, instruction tuning after pretraining, and two-stage finetuning. Experiments across four base models (LLaMA 3, LLaMA 3.1, Qwen-2.5, and Qwen-2.5 Coder) and 20 benchmarks covering math, code, logic, and algorithms demonstrate consistent improvements. Notably, TracePile boosts LLaMA3.1-8B by 7.1\% on average across nine math datasets and delivers clear gains on LiveCodeBench, CRUX, and MMLU under two-stage fine-tuning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。