arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.10305cs.SEcs.AIcs.LG
收藏

解锁监督微调与强化学习在训练代码大语言模型中的关联

Unlock the Correlation between Supervised Fine-Tuning and Reinforcement Learning in Training Code Large Language Models

ByteDance Seed(字节跳动种子(部门))

Jie Chen, Xintian Han, Yu Ma, Xun Zhou, Liang Xiang

AI总结:

本研究通过构造原子函数与合成函数,揭示监督微调与强化学习在代码大语言模型训练中的关联:两者互补,RL可增强SFT泛化并缓解过拟合。

摘要:

自动代码生成一直是一个长期的研究课题。随着通用大语言模型(LLMs)的进步,编码能力成为衡量模型推理性能的一项重要指标。通常,采用两阶段训练范式来获得代码大语言模型,即预训练和微调。在微调阶段,监督微调(SFT)和强化学习(RL)常被用来提升模型的零样本能力。已有大量工作通过修改算法或优化数据集来提升模型在代码相关基准上的性能。然而,我们仍缺乏对SFT与RL之间关联的深入理解。例如,应使用何种数据集以确保泛化能力,或者如果在微调中放弃SFT阶段会怎样。在本工作中,我们尝试理解SFT与RL之间的关联。为促进研究,我们手工构建了100个基础Python函数,称为原子函数,然后部署一个合成流水线在原子函数之上生成大量合成函数。通过这种方式,我们确保训练集和测试集保持不同,防止数据污染。通过全面的消融研究,我们发现:(1)原子函数和合成函数对于SFT的泛化都是不可或缺的,且仅需少量合成函数即可;(2)通过RL,即使使用相同的训练提示,SFT对目标领域的泛化能力也能大幅提升;(3)从头训练RL可以缓解SFT阶段引入的过拟合问题。

英文摘要:

Automatic code generation has been a longstanding research topic. With the advancement of general-purpose large language models (LLMs), the ability to code stands out as one important measure to the model's reasoning performance. Usually, a two-stage training paradigm is implemented to obtain a Code LLM, namely the pretraining and the fine-tuning. Within the fine-tuning, supervised fine-tuning (SFT), and reinforcement learning (RL) are often used to improve the model's zero-shot ability. A large number of work has been conducted to improve the model's performance on code-related benchmarks with either modifications to the algorithm or refinement of the dataset. However, we still lack a deep insight into the correlation between SFT and RL. For instance, what kind of dataset should be used to ensure generalization, or what if we abandon the SFT phase in fine-tuning. In this work, we make an attempt to understand the correlation between SFT and RL. To facilitate our research, we manually craft 100 basis python functions, called atomic functions, and then a synthesizing pipeline is deployed to create a large number of synthetic functions on top of the atomic ones. In this manner, we ensure that the train and test sets remain distinct, preventing data contamination. Through comprehensive ablation study, we find: (1) Both atomic and synthetic functions are indispensable for SFT's generalization, and only a handful of synthetic functions are adequate; (2) Through RL, the SFT's generalization to target domain can be greatly enhanced, even with the same training prompts; (3) Training RL from scratch can alleviate the over-fitting issue introduced in the SFT phase.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑