Beyond Similarity: A Gradient-based Graph Method for Instruction Tuning Data Selection
Yang Zhao, Li Du, Xiao Ding, Yangou Ouyang, Hepeng Wang, Kai Xiong, Jinglong Gao, Zhouhao Sun, Dongliang Xu, Yang Qing, Dongchen Li, Bing Qin, Ting Liu
TL;DR
G2IS introduces a gradient-based instruction graph to capture the joint distribution and interdependencies among instructions for data selection in domain-specific instruction tuning. By computing momentum-adjusted training gradients and SGD-based validation gradients, and constructing a graph with nodes as gradient representations and edges weighted by cosine similarity, it enables a gradient walk to select training samples aligned with a core knowledge extracted via PCA. The method demonstrates strong data efficiency, often matching or surpassing full-data instruction tuning with only 1% of the data, and shows robust gains on multi-task and complex reasoning tasks. This approach offers a scalable path to efficient, domain-specific LLM adaptation with reduced data requirements.
Abstract
Large language models (LLMs) have shown great potential across various industries due to their remarkable ability to generalize through instruction tuning. However, the limited availability of domain-specific data significantly hampers their performance on specialized tasks. While existing methods primarily focus on selecting training data from general datasets that are similar to the target domain, they often fail to consider the joint distribution of instructions, resulting in inefficient learning and suboptimal knowledge transfer. To address these challenges, we introduce G2IS (Gradient-based Graph Instruction Selection), a novel method that constructs a mixed gradient-based instruction graph to capture the joint distribution and interdependencies between instructions. By accounting for the relationships between instructions, G2IS improves domain adaptation efficiency. Additionally, we propose a gradient walk algorithm to refine the data selection process, enhancing both training effectiveness and efficiency. Our experiments demonstrate that G2IS outperforms traditional methods across various domain adaptation tasks, yielding significant performance gains, particularly in complex, data-scarce scenarios. These results underscore the potential of G2IS in advancing the development of large, domain-specific models.
