这篇论文戳破了“代码训练提升通用推理”的迷思,做预训练数据策略的团队值得细看——它指明了如何通过结构化推理信号精准优化数学能力,而非盲目堆代码。
这篇论文通过控制预训练实验,重新审视了代码训练对语言模型推理能力的影响。研究发现,纯代码主要提升编程能力,而非通用推理能力,甚至与数学等知识密集型任务存在竞争关系。真正提升数学推理的是跨领域的结构化推理信号,如代码-文本和数学-文本混合数据。在固定数学预算下,增加结构化数学样本密度能显著提升复杂数学推理,同时保持编程性能。分析还显示,数据组成效应反映在专家激活模式中,为跨领域的竞争与协同提供了机制层面的证据。
What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code
Code has become a standard component of modern foundation language model (LM) training, yet its role beyond programming remains unclear. We revisit the claim that code improves reasoning through controlled pretraining experiments on a 10T-token corpus with fine-grained domain separation. Our findings are threefold. First, when code is restricted to standalone executable programs and Code-NL data are controlled for, code substantially improves programming ability but does not act as a general reasoning enhancer; instead, it competes with knowledge-intensive tasks, especially complex mathematical reasoning. Second, the reasoning gains often attributed to code are better explained by cross-domain structured reasoning traces, such as code-text and math-text mixtures, rather than by executable code alone. Third, increasing the density of structured math-domain samples within a fixed math budget yields substantial gains on difficult mathematical reasoning while largely preserving programming performance, suggesting that cognitive scaffolds offer a targeted way to mitigate cross-domain trade-offs. Finally, routing analyses show that data-composition effects are reflected in expert-activation patterns, providing mechanism-level evidence for competitive and synergistic interactions across domains. Our results clarify which data characteristics transfer across capability dimensions and point to more precise data-centric optimization strategies.