Skip to main content
QUICK REVIEW

[Paper Review] VeRA: Vector-based Random Matrix Adaptation

Dawid Jan Kopiczko, Tijmen Blankevoort|arXiv (Cornell University)|Oct 17, 2023
Domain Adaptation and Few-Shot LearningComputer Science8 citations
TL;DR

VeRA reduces finetuning parameters by sharing frozen random matrices across layers and learning small scaling vectors, achieving comparable performance to LoRA with orders of magnitude fewer trainable parameters across NLP, vision, and instruction-tuning tasks.

ABSTRACT

Low-rank adapation (LoRA) is a popular method that reduces the number of trainable parameters when finetuning large language models, but still faces acute storage challenges when scaling to even larger models or deploying numerous per-user or per-task adapted models. In this work, we present Vector-based Random Matrix Adaptation (VeRA), which significantly reduces the number of trainable parameters compared to LoRA, yet maintains the same performance. It achieves this by using a single pair of low-rank matrices shared across all layers and learning small scaling vectors instead. We demonstrate its effectiveness on the GLUE and E2E benchmarks, image classification tasks, and show its application in instruction-tuning of 7B and 13B language models.

Motivation & Objective

  • Motivate the need for ultra-parameter-efficient finetuning for large pretrained models in LLMs, vision, and instruction-tuning applications.
  • Propose VeRA to drastically reduce trainable parameters while maintaining competitive or better performance.
  • Show applicability across NLP benchmarks (GLUE), generation tasks (E2E), image classification (ViT), and instruction-following setups.
  • Provide ablations to understand the contribution of each component and initialization in VeRA.

Proposed method

  • Freeze a single pair of random matrices shared across all adapted layers.
  • Introduce trainable scaling vectors that act as diagonal scaling (Lambda_b and Lambda_d) around the frozen matrices to enable layer-wise adaptation.
  • Formally, h = W0 x + Lambda_b B Lambda_d A x, where A and B are frozen/random and shared, while b and d (in Lambda_b and Lambda_d) are trainable.
  • Ensure that trainable parameters can be merged back into the original weights for no inference latency increase.
  • Provide initialization strategies: Kaiming initialization for A and B, zeros for b, and a controlled initialization for d; d_init values explored include 0.1 and 1e-7, among others.
Figure 1: Schematic comparison of LoRA (left) and VeRA (right). LoRA updates the weights matrix $W$ by training the low-rank matrices $A$ and $B$ , with intermediate rank $r$ . In VeRA these matrices are frozen, shared across all layers, and adapted with trainable vectors $d$ and $b$ , substantially
Figure 1: Schematic comparison of LoRA (left) and VeRA (right). LoRA updates the weights matrix $W$ by training the low-rank matrices $A$ and $B$ , with intermediate rank $r$ . In VeRA these matrices are frozen, shared across all layers, and adapted with trainable vectors $d$ and $b$ , substantially

Experimental results

Research questions

  • RQ1How does VeRA perform relative to LoRA and other baselines across NLP, vision, and instruction-tuning tasks?
  • RQ2What is the parameter-efficiency trade-off when using VeRA compared to LoRA across varying ranks?
  • RQ3How do initialization and scaling vector choices affect VeRA’s performance and stability?
  • RQ4Can shared frozen random matrices generalize well across layers and tasks, and what is the impact of sharing vs. unique matrices?

Key findings

  • VeRA achieves competitive performance with LoRA on GLUE while using an order of magnitude fewer trainable parameters (e.g., 0.043M vs 0.3M for RoBERTa base).
  • On E2E GPT-2 Medium/Large, VeRA outperforms LoRA with 3x and 4x fewer trainable parameters, respectively.
  • In instruction-tuning of LlaMA(Llama) and Llama2 models, VeRA attains similar or better results than LoRA with ~100x fewer trainable parameters (e.g., 1.6M/2.4M vs 159.9M/250.3M).
  • In Vision Transformer experiments, VeRA approaches LoRA on ViT-Base and outperforms LoRA on ViT-Large for multiple datasets, with over 10x fewer trainable parameters.
  • Scaling experiments show VeRA remains significantly more parameter-efficient; when VeRA at equivalent parameter count to LoRA, VeRA can outperform by several accuracy points on RTE.
  • Ablation studies confirm both scaling vectors d and b are needed for best performance, and initialization choices (Kaiming, d_init) materially impact results.
Figure 2: Performance of LoRA and VeRA methods for varying ranks on RTE task.
Figure 2: Performance of LoRA and VeRA methods for varying ranks on RTE task.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.