Minor SFT loss for LLM fine-tune to increase performance and reduce model deviation
Shiming Xie, Hong Chen, Fred Yu, Zeye Sun, Xiuyu Wu
TL;DR
Problem: large language model fine-tuning via SFT risks drifting away from the base model. Approach: adapt the DPO objective into SFT by injecting a sample-level dynamic coefficient and introducing a normalized deviation metric $m_\theta(x,y) = \frac{1}{N} \sum_{(x,y)\in D} \frac{1}{m} \log \frac{\pi_\theta(y|x)}{\pi_{ref}(y|x)}$ to monitor drift. Contributions: a MinorSFT loss with gradient $\nabla_\theta L_{MinorSFT} = - \mathbb E_{(x,y)\sim D}[\frac{2}{m} \sigma(-\beta \log \frac{\pi_\theta(y|x)}{\pi_{ref}(y|x)}) \nabla_\theta \log \pi_\theta(y|x)]$, and a deviation metric. Experiments: MinorSFT outperforms raw SFT and SFT+DPO on FinanceIQ, fineval, and ceval-exam, with lower deviation, albeit with extra computation and a tunable hyperparameter $\beta$. The result demonstrates practical potential for domain-specific SFT with controlled drift.
Abstract
Instruct LLM provide a paradigm used in large scale language model to align LLM to human preference. The paradigm contains supervised fine tuning and reinforce learning from human feedback. This paradigm is also used in downstream scenarios to adapt LLM to specific corpora and applications. Comparing to SFT, there are many efforts focused on RLHF and several algorithms being proposed, such as PPO, DPO, IPO, KTO, MinorDPO and etc. Meanwhile most efforts for SFT are focused on how to collect, filter and mix high quality data. In this article with insight from DPO and MinorDPO, we propose a training metric for SFT to measure the discrepancy between the optimized model and the original model, and a loss function MinorSFT that can increase the training effectiveness, and reduce the discrepancy between the optimized LLM and original LLM.
