Refine Large Language Model Fine-tuning via Instruction Vector
Gangwei Jiang, Zhaoyi Li, Defu Lian, Ying Wei
TL;DR
This work tackles catastrophic forgetting during instruction fine-tuning of large language models by distinguishing world knowledge from instruction-following using $P(y|x)$ and $P(y^c|c,x)$. It introduces the Instruction Vector (IV), a task-conditioned latent representation built from selected attention-head activations that governs instruction-following performance via a computation graph $f_M(x,c,\theta_c)\rightarrow y_c$, and demonstrates that forgetting arises from overlay of new patterns on the IV pathways rather than erasing prior skills. The authors propose IV-guided training with progressive IV intervention and an IV-based KL loss to preserve the original computation graph, achieving substantial reductions in forgetting and preserved plasticity across TRACE, FUNC, and LONG benchmarks. This provides mechanistic insight into how instruction-following capabilities evolve during fine-tuning and offers a practical method to maintain pre-existing capabilities in continual instruction learning, with potential for extension to additional backbones and tasks.
Abstract
Fine-tuning large language models (LLMs) can cause them to lose their general capabilities. However, the intrinsic mechanisms behind such forgetting remain unexplored. In this paper, we begin by examining this phenomenon by focusing on knowledge understanding and instruction following, with the latter identified as the main contributor to forgetting during fine-tuning. Consequently, we propose the Instruction Vector (IV) framework to capture model representations highly related to specific instruction-following capabilities, thereby making it possible to understand model-intrinsic forgetting. Through the analysis of IV dynamics pre and post-training, we suggest that fine-tuning mostly adds specialized reasoning patterns instead of erasing previous skills, which may appear as forgetting. Building on this insight, we develop IV-guided training, which aims to preserve original computation graph, thereby mitigating catastrophic forgetting. Empirical tests on three benchmarks confirm the efficacy of this new approach, supporting the relationship between IVs and forgetting. Our code will be made available soon.
