Empowering parameter-efficient transfer learning by recognizing the kernel structure in self-attention

Yifan Chen, Devamanyu Hazarika, Mahdi Namazifar, Yang Liu, Di Jin, Dilek Hakkani-Tur

Abstract

As pre-trained language models (PLMs) continue to grow in scale, the computational and storage costs of full fine-tuning for downstream tasks have become prohibitive. Parameter-efficient fine-tuning (PEFT) methods, such as LoRA and Adapters, mitigate this by updating only a small subset of parameters. However, these methods often treat Transformer layers as generic matrices, ignoring the specific functional roles of the attention mechanism. This paper, authored by researchers at Amazon Alexa AI and UIUC, proposes a more principled approach by viewing self-attention through the lens of kernel learning. By treating self-attention as a Nadaraya-Watson kernel estimator, the authors introduce Kernel-mix, a method that prioritizes updates to the "value" components and implements head-specific adaptation. Experimental results demonstrate that Kernel-mix achieves state-of-the-art performance on complex generation tasks, sometimes surpassing full fine-tuning while updating only 1.6% of the model's parameters.

Introduction

The standard paradigm in Natural Language Processing involves fine-tuning massive pre-trained models for specific tasks like summarization or translation. Because storing full copies of these models for every task is inefficient, the community has turned to PEFT. While successful, existing PEFT methods are largely "structure-agnostic." They apply low-rank updates to weight matrices without considering whether those matrices function as queries, keys, or values within the attention block. Specifically, standard LoRA applies a uniform update structure across all attention heads, potentially limiting the model's ability to leverage the unique representational "view" provided by each head.

The Kernel Lens on Self-Attention

The core innovation of this research is the re-interpretation of the self-attention mechanism as a Nadaraya-Watson kernel estimator. In this mathematical framework:

  • The Kernel: The Query ($W_q$) and Key ($W_k$) matrices define the kernel function, determining the relational weights between tokens.
  • The Coefficients: The Value ($W_v$) matrix provides the actual information (coefficients) being aggregated based on those weights.

Drawing from classical kernel learning theory, the authors derive two fundamental guidelines for efficient adaptation:

  1. Head-specific Adaptation: Each attention head functions as a distinct kernel estimator. Therefore, forcing all heads to share a single adaptation basis (as in LoRA) is suboptimal. Each head should ideally have its own unique adaptation space.
  2. Value-Heavy Budgeting: Kernel theory suggests that optimizing the coefficients (Values) is more impactful for model performance than optimizing the kernel (Queries/Keys) itself. Consequently, the parameter budget should be skewed toward the Value ($W_v$) and Output ($W_o$) matrices.

Proposed Method: Kernel-mix

To operationalize these insights, the authors propose three architectural variations:

  • Kernel-wise Adaptation: An extension of LoRA where each attention head receives its own low-rank update matrices ($B^{(h)}$), rather than sharing a global basis.
  • Kernel-wise-lite: A resource-efficient version that utilizes the frozen Key matrix ($W_k$) as a basis for updates, further reducing the parameter footprint.
  • Kernel-mix: The flagship approach that combines a shared global basis with head-specific updates, balancing parameter efficiency with high expressivity.

Experimental Results

The researchers evaluated Kernel-mix against standard PEFT benchmarks using GPT-2 (Small) for generation tasks and RoBERTa (Base) for understanding tasks. The evaluation spanned several datasets, including WebNLG (table-to-text), CoQA (conversational QA), CNN/DailyMail (summarization), and GLUE tasks like MNLI and SST2.

Performance Highlights

  • Surpassing Full Fine-Tuning: On the CoQA dataset, Kernel-mix(qvo) achieved an F1 score of 68.4, outperforming full fine-tuning (67.4) while utilizing only 1.61% of the total parameters.
  • Superiority over LoRA: In the WebNLG "All" category, Kernel-mix reached a BLEU score of 49.3, a significant improvement over LoRA’s 46.7 at an equivalent parameter budget.
  • Efficiency at Scale: Even under extreme constraints (the "Tiny" budget of <0.1% parameters), the Kernel-mix-lite(qv) variant consistently outperformed BitFit and standard Adapters.

Discussion and Insights

The success of Kernel-mix suggests that the "Aha!" moment for PEFT lies in recognizing that attention heads are not redundant parallel paths but distinct estimators. Forcing them to share a limited update vocabulary restricts their specialized functions. Furthermore, the results confirm that the Value matrix is the most critical component to tune. By including the Output matrix ($W_o$) in the "coefficient" budget, the authors significantly boosted the model's ability to handle long-sequence tasks like multi-turn QA and summarization, where standard PEFT often struggles.

Limitations and Future Work

While the results are promising, the authors note that experiments were primarily conducted on smaller-scale models (GPT-2 and RoBERTa). Future research is required to determine if these kernel-wise benefits scale to multi-billion parameter models like Llama or GPT-4. Additionally, the authors suggest that Feed-Forward Network (FFN) layers—which can be viewed as key-value memories—might also be improved by applying similar kernel-inspired guidelines. Finally, while parameter-efficient for storage, the implementation of head-specific updates may require further optimization to match the hardware efficiency of large, single-matrix multiplications.

Summary updated

BibTeX
@inproceedings{chen2022empowering,
  author = {Yifan Chen and Devamanyu Hazarika and Mahdi Namazifar and Yang Liu and Di Jin and Dilek Hakkani-Tur},
  title = {{Empowering parameter-efficient transfer learning by recognizing the kernel structure in self-attention}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.102},
}
Figure