Fine-tuning Happens in Tiny Subspaces: Exploring Intrinsic Task-specific Subspaces of Pre-trained Language Models (2023)

Abstract: Pre-trained language models (PLMs) are known to be overly parameterized and have significant redundancy, indicating a small degree of freedom of the PLMs. Motivated by the observation, in this paper, we study the problem of re-parameterizing and fine-tuning PLMs from a new perspective: Discovery of intrinsic task-specific subspace. Specifically, by exploiting the dynamics of the fine-tuning process for a given task, the parameter optimization trajectory is learned to uncover its intrinsic task-specific subspace. A key finding is that PLMs can be effectively fine-tuned in the subspace with a small number of free parameters. Beyond, we observe some outlier dimensions emerging during fine-tuning in the subspace. Disabling these dimensions degrades the model performance significantly. This suggests that these dimensions are crucial to induce task-specific knowledge to downstream tasks.

## introduction pre-trained language models (plms) have become the de facto methods for various natural language processing (nlp) tasks @xcite @xcite . the typical paradigm is to pre-train a big language model on large-scale corpora and then fine-tune the model on small task-specific datasets to adapt to the downstream tasks. despite the great success of this paradigm, two questions still come to our mind: (1) why can a plm with hundreds of millions of parameters be successfully fine-tuned on different downstream tasks using only hundreds or thousands of labeled samples? (2) do we really need a full fine-tuning of all parameters of a plm to reach state-of-the-art performance on downstream tasks? in this paper, we try to provide a new viewpoint on the two questions, and claim that: fine-tuning happens only in some tiny task-specific subspaces, which can be effectively learned with a small number of free parameters. recent studies have shown that plms are highly over-parameterized and robust to pruning @xcite @xcite @xcite , and can be fine-tuned in parameter-efficient ways @xcite @xcite . this emerging empirical evidence tends to point to one fact that there exist some intrinsic structures in plms that are responsible for inducing task-specific knowledge to downstream tasks. notably, the recent work @xcite provides a promising conclusion that plms can be re-parameterized and fine-tuned in random low-dimensional subspaces using random projection, and the dimensionality of the random subspace is orders of magnitude smaller than the dimensionality of the full parameter space. their findings implicitly suggest the existence of such intrinsic structure in the plms, which is, however, understudied. to bridge this gap, we explicitly demonstrate that there exist task-specific lowdimensional subspaces in which plms can be effectively fine-tuned. inspired by the low dimensional landscape hypothesis @xcite ) that a training trajectory of a neural network lies in a low-dimensional subspace, in this work, we thus resort to the finetuning trajectory to study the intrinsic task-specific subspaces of plms. we show that it is possible to uncover the intrinsic task-specific subspaces with a fine-tuning trajectory by finding its principal directions. the uncovered intrinsic task-specific subspaces usually have very low dimensionalities, but are quite effective in inducing task-specific knowledge. for example, by re-parameterizing the encoder and optimizing only 32 free parameters per-layer in the intrinsic task-specific subspace, the model allows achieving nearly the same performance as fine-tuning in the full parameter space. moreover, we further show that the uncovered intrinsic task-specific subspaces have a certain transferability. beyond this, we find that the model contains some outlier dimensions with abnormal spikes when fine-tuning in the intrinsic task-specific subspaces instead of a random subspace. disabling these outlier dimensions degrades the model performance significantly. we believe that this phenomenon is related to the previously discovered outlier dimensions of plms @xcite @xcite . however, there are essential differences between them, which we will discuss in the latter section. by exploring the intrinsic task-specific subspaces of plms, the main contributions of this paper are summarized as follows. we show that the models can be effectively fine-tuned with a very small number of parameters in the uncovered intrinsic task-specific subspaces. ## conclusion in this paper, we claim that the fine-tuning of plms happens in tiny subspaces. to uncover such intrinsic task-specific subspaces, we exploit the fine-tuning trajectory to find its main direction. our empirical experiments show that plms can effectively adapt to downstream tasks when re-parameterizing and training in the found subspaces, which well explains the ease of adapting plms to downstream tasks. furthermore, we find outlier dimensions in plms during the subspace training. we consider that these dimensions are crucial to induce task-specific knowledge to downstream tasks. still, we need further in-depth analysis to understand the reasons and impact of the emergence of outlier patterns.