[Paper Review] A Kernel-Based View of Language Model Fine-Tuning
This paper introduces a kernel-based framework to theoretically explain the success of fine-tuning large language models (LMs), showing that fine-tuning dynamics under Adam and with prompts often follow Neural Tangent Kernel (NTK) behavior. It proves that prompting induces kernel-like optimization, and demonstrates that parameter-efficient methods like LoRA preserve kernel structure, explaining their effectiveness with minimal parameter updates.
It has become standard to solve NLP tasks by fine-tuning pre-trained language models (LMs), especially in low-data settings. There is minimal theoretical understanding of empirical success, e.g., why fine-tuning a model with $10^8$ or more parameters on a couple dozen training points does not result in overfitting. We investigate whether the Neural Tangent Kernel (NTK) - which originated as a model to study the gradient descent dynamics of infinitely wide networks with suitable random initialization - describes fine-tuning of pre-trained LMs. This study was inspired by the decent performance of NTK for computer vision tasks (Wei et al., 2022). We extend the NTK formalism to Adam and use Tensor Programs (Yang, 2020) to characterize conditions under which the NTK lens may describe fine-tuning updates to pre-trained language models. Extensive experiments on 14 NLP tasks validate our theory and show that formulating the downstream task as a masked word prediction problem through prompting often induces kernel-based dynamics during fine-tuning. Finally, we use this kernel view to propose an explanation for the success of parameter-efficient subspace-based fine-tuning methods.
Motivation & Objective
- Understand why fine-tuning large language models on few-shot data does not overfit, despite high capacity.
- Explain the empirical success of prompting in fine-tuning, particularly its role in inducing kernel-like optimization dynamics.
- Theoretically extend the Neural Tangent Kernel (NTK) framework to Adam optimization and non-random (pre-trained) weight initializations.
- Provide a theoretical foundation for parameter-efficient fine-tuning methods like LoRA by analyzing their kernel behavior.
- Validate the kernel view empirically across 14 diverse NLP tasks to identify conditions under which kernel dynamics emerge.
Proposed method
- Extend the standard NTK formalism to Adam optimization by introducing a kernel formula based on the sign of gradients, which models early-stage training dynamics.
- Use the Tensor Programs framework to analyze infinite-width networks with pre-trained, non-i.i.d. initializations, enabling theoretical analysis of fine-tuning with non-random weights.
- Define an empirical NTK (eNTK) using gradients from pre-trained model parameters to represent kernel dynamics during fine-tuning.
- Formally prove that prompt-based fine-tuning induces kernel behavior in Transformers by analyzing gradient dynamics under the infinite-width limit.
- Apply the Johnson-Lindenstrauss lemma to show that low-rank parameter updates (e.g., LoRA) preserve kernel structure with high probability.
- Derive closed-form expressions for the SGD-induced kernel in LoRA and compare it to full fine-tuning kernels, proving their similarity under mild assumptions.
Experimental results
Research questions
- RQ1Under what conditions does fine-tuning of pre-trained language models exhibit kernel-based dynamics, particularly under Adam optimization?
- RQ2How does prompting influence the emergence of kernel behavior during fine-tuning of large models?
- RQ3Can the success of parameter-efficient fine-tuning methods like LoRA be explained through a kernel-based perspective?
- RQ4To what extent does the empirical NTK accurately describe fine-tuning dynamics across diverse NLP tasks?
- RQ5How do the gradient dynamics of LoRA compare to those of full fine-tuning in terms of kernel similarity?
Key findings
- Prompt-based fine-tuning consistently induces kernel-like dynamics, as evidenced by strong alignment between eNTK predictions and actual fine-tuning performance across 14 NLP tasks.
- The eNTK achieves classification accuracy within 6% of full fine-tuning on image tasks (from prior work), and this kernel-based behavior is replicated in NLP, validating its generalization to language models.
- LoRA's kernel is shown to be highly similar to the full fine-tuning kernel with high probability, provided the rank $k$ satisfies $k \geq \Theta(Lc^4 \log N / \epsilon^2)$, where $L$ is the number of LoRA layers.
- Theoretical analysis proves that prompting induces a well-defined mechanism for kernel behavior in Transformers, even with non-random pre-trained weights.
- Empirical results show that kernel dynamics are most prominent when prompts are meaningful; random prompts fail to induce stable kernel behavior.
- The kernel view provides a unified explanation for the success of parameter-efficient methods: they preserve the essential gradient structure of full fine-tuning while reducing parameter updates.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.