[论文解读] Preserving Diversity in Supervised Fine-Tuning of Large Language Models
该论文提出GEM(生成熵正则化匹配),一种用于大语言模型的新型有监督微调方法,用反向Kullback-Leibler散度最小化结合熵正则化替代交叉熵损失。GEM可减少过拟合并显著提升生成多样性,采用best-of-n采样时在代码生成和数学推理基准上性能最高提升10分,优于标准交叉熵和权重衰减基线,在Llama-3-8B上表现更优。
Large Language Models (LLMs) typically rely on Supervised Fine-Tuning (SFT) to specialize in downstream tasks, with the Cross Entropy (CE) loss being the de facto choice. However, CE maximizes the likelihood of observed data without accounting for alternative possibilities. As such, CE usually leads to reduced diversity in the model's outputs, which hinders further development that requires sampling to explore better responses. To address this limitation, this paper introduces a new game-theoretic formulation for SFT. In this framework, an auxiliary variable is introduced to regulate the learning process. We prove that the proposed game-theoretic approach connects to the problem of reverse KL minimization with entropy regularization. This regularization prevents over-memorization of training data and promotes output diversity. To implement this framework, we develop GEM, a new training algorithm that is computationally efficient as CE by leveraging some unique properties of LLMs. Empirical studies of pre-trained models from 3B to 70B parameters show that GEM achieves comparable downstream performance to CE while significantly enhancing output diversity. This increased diversity translates to performance gains in test-time compute scaling for chat and code generation tasks. Moreover, we observe that preserving output diversity has the added benefit of mitigating forgetting, as maintaining diverse outputs encourages models to retain pre-trained knowledge throughout the training process.
研究动机与目标
- 为解决大语言模型(LLMs)有监督微调(SFT)中因交叉熵(CE)损失的激进更新而引起的过拟合和生成多样性有限的问题。
- 开发一种有原则的CE损失替代方案,鼓励更平坦、更多样化的输出分布,同时保持数据保真度。
- 通过增强模型多样性,提升下游任务的泛化能力和性能,特别是依赖先进解码策略(如best-of-n采样)的任务。
- 证明熵正则化反向KL散度最小化作为标准SFT训练的可行且高效替代方案的有效性。
- 提供一种可扩展、高效的方案,与标准SFT流水线兼容,适用于通用及领域特定的指令微调。
提出的方法
- 提出GEM(生成熵正则化匹配),一种基于最小化数据分布与模型生成分布之间反向Kullback-Leibler(KL)散度的新型训练目标,辅以熵正则项以防止过记忆化。
- 采用可计算的优化方案,避免对抗训练,计算效率高,且与标准SFT框架兼容。
- 引入损失函数,通过在拟合监督数据的同时最大化熵,平衡数据似然与输出多样性。
- 采用重参数化技巧,实现微调过程中对熵正则化反向KL目标的可微优化。
- 在Llama-3-8B上应用该方法,使用通用数据集(UltraFeedback)和领域特定数据集(MetaMathQA、Magicoder-OSS-Instruct)评估泛化性与多样性。
- 采用best-of-n采样与多数投票法评估多样性增益,在代码与数学基准上使用pass@100与准确率指标。

实验结果
研究问题
- RQ1用熵正则化反向KL散度最小化替代交叉熵损失,能否减少大语言模型有监督微调中的过拟合?
- RQ2所提出的GEM方法是否能在无需领域特定数据的情况下提升大语言模型的生成多样性?
- RQ3GEM在受益于多样化输出的下游任务(如数学推理与代码生成)中,性能提升程度如何?
- RQ4在不同数据集上,GEM与标准CE损失及权重衰减正则化相比,在泛化性与鲁棒性方面表现如何?
- RQ5熵正则化能否缓解模式崩溃,并在best-of-n采样等先进解码策略下提升性能?
主要发现
- 在指令微调的UltraFeedback数据集上,GEM降低了困惑度并提升了IFEval性能,表明相比CE损失,其过拟合程度更低。
- 在GSM8K与MATH数学推理基准上,GEM-LS在BON@32上分别实现2.6分与1.6分的提升,表明其多样性与泛化能力增强。
- 在代码生成基准上,GEM-LS在HumanEval上Pass@100相比CE提升9.7分(相对提升14.7%),在MBPP上提升8.0分(相对提升11.1%)。
- 在更具挑战性的MATH基准上,GEM-LS在贪婪解码中提升1.9分(相对提升8.0%),在多数投票中提升1.7分(相对提升5.8%),表明其对困难任务具有鲁棒性。
- 权重衰减正则化表现不一致,而GEM在所有基准与设置中均持续优于CE,证实其在减少过拟合与提升多样性方面的有效性。
- 结果表明,GEM的熵正则化能有效缓解过拟合,并在best-of-n采样下实现更优性能,验证了其在推理时计算与自我改进流水线中的实用性。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。