A Kernel-Based View of Language Model Fine-Tuning

Sadhika Malladi, Alexander Wettig, Dingli Yu, Danqi Chen, Sanjeev Arora
10/11/2022
cs.LGcs.CL

Official code: princeton-nlp/LM-Kernel-FT (78 stars, Python, MIT, last commit 2023-09-04).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

A Kernel-Based View of Language Model Fine-Tuning https://arxiv.org/abs/2210.05643

785Python, ShellOct 9, 20223 years agoMIT

Similar Papers

Cite this paper

@article{malladi2022kernelbased,
  title  = {A Kernel-Based View of Language Model Fine-Tuning},
  author = {Sadhika Malladi and Alexander Wettig and Dingli Yu and Danqi Chen and Sanjeev Arora},
  year   = {2022},
  eprint = {2210.05643},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.05643}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.05643.svg)](https://codeofpaper.com/paper/2210.05643)

Discussion