Unlock the Correlation between Supervised Fine-Tuning and Reinforcement Learning in Training Code Large Language Models
Jie Chen, Xintian Han, Yu Ma, Xun Yu Zhou, Liang Xiang · 2024 · 11 citationsRead the paper
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.
What the full text shows
Shown in the lab- A mixture of a small amount of synthetic (composite) data and a larger amount of atomic data maximizes zero-shot generalization on out-of-distribution tasks. — 54.7% zero-shot pass@1 on Composite_C (using 1% Composite_A and 600% Atom_base) (SFT on a 1.5B parameter GPT2-like model)
- Minor modifications or translations of atomic data significantly degrade generalization performance. — 9.7% pass@1 (Atom_modify) and 12.6% pass@1 (Atom_translate) vs 54.7% (Atom_base) (SFT on Composite_C)
- Bi-directional language understanding (English-Chinese pairs) improves instruction tuning generalization. — 23.5% zero-shot pass@1 on Composite_C (SFT with <prompt_Chinese, prompt_English> and <prompt_English, prompt_Chinese> pairs)
- Reinforcement Learning (RL) enhances SFT generalization and can mitigate SFT-induced overfitting when trained from scratch. (PPO optimization using unit test rewards (0 or 1))
- Setup
- GPT2-like model with 1.5B parameters (hidden size 2048, 16 heads, 24 layers); datasets include Atom_base (100 functions) and synthesized Composite sets; evaluated on Composite_C, HumanEval-Python, and MBPP.
- How
- The researchers created a data synthesizing pipeline that combines 100 manually crafted 'atomic' Python functions into complex 'synthetic' functions. They performed ablation studies using Supervised Fine-Tuning (SFT) and Proximal Policy Optimization (PPO) with a code sandbox for reward signals.
- Limitations
- Insights based on a 1.5B parameter model may not scale to larger models. · Dataset limited to 100 atomic functions and the Python language. · Evaluation focused on code generation and completion, excluding debugging or translation. · RL implementation limited to the PPO algorithm.
Summarized by Gemma 4 from the open-access full text · 26 Nov 2026. Read it