At Which Training Stage Does Code Data Help LLMs Reasoning?
Yingwei Ma, Yue Liu, Yue Yu, Yuanliang Zhang, Yu Jiang, Changjian Wang, Shanshan Li
摘要
Large Language Models (LLMs) have exhibited remarkable reasoning capabilities and become the foundation of language technologies. Inspired by the great success of code data in training LLMs, we naturally wonder at which training stage introducing code data can really help LLMs reasoning. To this end, this paper systematically explores the impact of code data on LLMs at different stages. Concretely, we introduce the code data at the pre-training stage, instruction-tuning stage, and both of them, respectively. Then, the reasoning capability of LLMs is comprehensively and fairly evaluated via six reasoning tasks in five domains. We critically analyze the experimental results and provide conclusions with insights. First, pre-training LLMs with the mixture of code and text can significantly enhance LLMs' general reasoning capability almost without negative transfer on other tasks. Besides, at the instruction-tuning stage, code data endows LLMs the task-specific reasoning capability. Moreover, the dynamic mixing strategy of code and text data assists LLMs to learn reasoning capability step-by-step during training. These insights deepen the understanding of LLMs regarding reasoning ability for their application, such as scientific question answering, legal support, etc. The source code and model parameters are released at the link: https://github.com/yingweima2022/CodeLLM.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 27 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Understanding Catastrophic Forgetting in Language Models via Implicit Inference 引用了 Training language models to follow instructions with human feedback
- Enhancing Reasoning Capabilities of LLMs via Principled Synthetic Logic Corpus 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Not All Tokens Are What You Need for Pretraining 引用了 Language Models are Few-Shot Learners
- Not All Tokens Are What You Need for Pretraining 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Not All Tokens Are What You Need for Pretraining 引用了 Training language models to follow instructions with human feedback
- Iteration Head: A Mechanistic Study of Chain-of-Thought 引用了 Language Models are Few-Shot Learners
- Iteration Head: A Mechanistic Study of Chain-of-Thought 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- GuardReasoner-VL: Safeguarding VLMs via Reinforced Reasoning 引用了 Training language models to follow instructions with human feedback
- Learn to Explain: Multimodal Reasoning via Thought Chains for Science Question Answering 引用了 Language Models are Few-Shot Learners
- Learn to Explain: Multimodal Reasoning via Thought Chains for Science Question Answering 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Learn to Explain: Multimodal Reasoning via Thought Chains for Science Question Answering 引用了 Training language models to follow instructions with human feedback
引用它的顶会 Paper27
- Understanding Catastrophic Forgetting in Language Models via Implicit InferenceSuhas Kotha, Jacob Mitchell Springer, Aditi RaghunathanICLR 2024 · 131 次引用
- Not All Tokens Are What You Need for PretrainingZhenghao Lin, Zhibin Gou, Yeyun Gong, Xiao Liu 等NeurIPS 2024 · 99 次引用
- Enhancing Reasoning Capabilities of LLMs via Principled Synthetic Logic CorpusTerufumi Morishita, Gaku Morio, Atsuki Yamaguchi, Yasuhiro SogawaNeurIPS 2024 · 60 次引用
- Iteration Head: A Mechanistic Study of Chain-of-ThoughtVivien Cabannes, Charles Arnal, Wassim Bouaziz, Xingyu Yang 等NeurIPS 2024 · 44 次引用
- GuardReasoner-VL: Safeguarding VLMs via Reinforced ReasoningYue Liu, Shengfang Zhai, Mingzhe Du, Yulin Chen 等NeurIPS 2025 · 40 次引用
它引用的 Paper8
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Learn to Explain: Multimodal Reasoning via Thought Chains for Science Question AnsweringPan Lu, Swaroop Mishra, Tanglin Xia, Liang Qiu 等NeurIPS 2022 · 2,727 次引用
- JEC-QA: A Legal-Domain Question Answering DatasetHaoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang 等AAAI 2020 · 212 次引用
相关 Paper
- Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models ReasoningXinlu Zhang, Zhiyu Zoey Chen, Xi Ye, Xianjun Yang 等AAAI 2025 · 40 次引用
- To Code or Not To Code? Exploring Impact of Code in Pre-trainingViraat Aryabumi, Yixuan Su, Raymond Ma, Adrien Morisot 等ICLR 2025 · 3 次引用
- Front-Loading Reasoning: The Synergy between Pretraining and Post-Training DataSyeda Nahida Akter, Shrimai Prabhumoye, Eric Nyberg, Mostofa Patwary 等ICLR 2026 · 27 次引用
- On Code-Induced Reasoning in LLMsAbdul Waheed, Zhen Wu, Carolyn Rose, Daphne IppolitoICLR 2026 · 6 次引用
- Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMsDayu Yang, Tianyang Liu, Daoan Zhang, Antoine Simoulin 等EMNLP 2025 · 1 次引用
