Hadamard Adapter: An Extreme Parameter-Efficient Adapter Tuning Method for Pre-trained Language Models

Yuyan Chen, Qiang Fu, Ge Fan, Lun Du, Jian-Guang Lou, Shi Han, Dongmei Zhang, Zhixu Li, Yanghua Xiao

TL;DR

The Hadamard Adapter is a new parameter-efficient fine-tuning (PEFT) method that achieves 99.4% of full fine-tuning performance while updating as little as 0.033% of a model's total parameters. By applying a simple element-wise linear transformation (the Hadamard product) specifically to self-attention outputs, it sets a new bar for "extreme" efficiency in adapting large language models to downstream tasks.

What Problem Does This Paper Address?

As Pre-trained Language Models (PLMs) like T5 and GPT-3 grow in size, "full fine-tuning"—updating every single parameter for a specific task—has become prohibitively expensive. It requires massive computational power and vast amounts of storage to save a unique version of the model for every task.

While existing "adapters" (small modules inserted into the model) have reduced this overhead to roughly 1-4% of parameters, the authors argue there is still significant redundancy. They ask: What is the absolute minimum we need to change to make a model perform well on a new task?

Methods

The authors propose the Hadamard Adapter, which stands out due to its mathematical simplicity. Instead of using traditional bottleneck layers (which involve matrix multiplications), this adapter uses the Hadamard product (element-wise multiplication).

  1. The Architecture: For a hidden dimension $d$, the adapter consists of just two 1D vectors: a weight vector $w$ and a bias vector $b$. The transformation is simply $y = w \odot x + b$.
  2. Strategic Placement: Based on empirical analysis, they inject this adapter immediately after the multi-head self-attention (MHSA) outputs.
  3. Two-Stage Training:
    • Stage 1: Train only the task-specific classifier head.
  4. Stage 2: Inject the Hadamard Adapter and fine-tune it along with the model's existing normalization layers (LayerNorm), keeping the rest of the PLM frozen.

Datasets

The researchers evaluated their method using the GLUE (General Language Understanding Evaluation) benchmark, a standard suite for Natural Language Processing. The tasks included:

  • Single-sentence classification: CoLA, SST-2.
  • Similarity and Paraphrase: MRPC, STS-B, QQP.
  • Inference tasks: MNLI, QNLI, RTE.

They tested the adapter across several state-of-the-art architectures, including BERT, RoBERTa, BART, DeBERTa, and ELECTRA.

Key Insights and Ideas

  • Self-Attention is the Key: The authors found that the norm of self-attention outputs changes most significantly during fine-tuning. By targeting this specific bottleneck, they can influence the model's behavior with very few parameters.
  • Linearity is Enough: While many adapters use non-linear activation functions (like ReLU), the authors proved that a simple linear transformation is sufficient to "shift" the pre-trained representations into the target task's space.
  • Normalization Matters: A critical finding was that unfreezing existing normalization layers is vital. Because the Hadamard Adapter changes the distribution of the attention outputs, the normalization layers must be allowed to adapt to this new distribution to maintain stability.
  • Layer Redundancy: Not all layers are created equal. The authors discovered that they could achieve competitive results by only unfreezing adapters in about half of the model's layers, potentially pushing parameter efficiency down to 0.022%.

Key Results

  • Performance: On the GLUE benchmark, the Hadamard Adapter achieved an average performance of 99.4% relative to full fine-tuning.
  • Efficiency: It outperformed other popular PEFT methods like BitFit and LoRA in terms of parameter count. For example, on RoBERTa-large, it used only 0.03% of parameters compared to LoRA's 0.23%, while maintaining nearly identical accuracy.
  • Consistency: Analysis showed that the learned weight vectors across different tasks were remarkably consistent (often close to 1.0), suggesting that the "bias" term ($b$) does the heavy lifting in task adaptation.

Limitations and Future Work

  • Two-Stage Complexity: The proposed two-stage training process (classifier first, then adapter) is more complex than standard joint training and may increase the total training time, even if it saves memory.
  • Redundancy Exploration: While the authors noted that some layers are redundant, they haven't yet developed an automated way to identify which layers can be skipped for a specific task.
  • Scaling to LLMs: The experiments were conducted on "encoder-only" or "encoder-decoder" models like BERT and BART. Future work is needed to see if these extreme efficiencies hold for "decoder-only" Giant Language Models (like GPT-4 or Llama).

Summary updated

BibTeX
@inproceedings{chen2023hadamard,
  author = {Yuyan Chen and Qiang Fu and Ge Fan and Lun Du and Jian-Guang Lou and Shi Han and Dongmei Zhang and Zhixu Li and Yanghua Xiao},
  title = {{Hadamard Adapter: An Extreme Parameter-Efficient Adapter Tuning Method for Pre-trained Language Models}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2023},
  doi = {10.1145/3583780.3614904},
}
Figure