In recent years, large pre-trained language models have achieved remarkable success across a wide range of natural language processing tasks. Many real-world applications rely on adapting a single pre-trained model to multiple downstream tasks, which is typically done through fine-tuning. However, as models become larger and larger, fine-tuning all of the parameters has become increasingly challenging. For example, GPT-3 175B requires storing and deploying a separate copy of 175 billion parameters for each task, making it prohibitively expensive.
To tackle this challenge, many researchers have proposed parameter-efficient adaptation methods, such as adapter layers and prefix tuning. While these methods are effective in reducing the number of trainable parameters, they still suffer from several limitations. Adapter layers introduce additional inference latency, whereas prefix tuning is difficult to optimize and reduces the sequence length available for downstream tasks.
In this paper, we propose Low-Rank Adaptation (LoRA), a novel and efficient method that addresses these limitations. We hypothesize that the weight updates during adaptation also have a low intrinsic rank. Specifically, LoRA freezes the pre-trained weights and injects trainable low-rank matrices into each layer, thereby greatly reducing the number of trainable parameters, making it possible to switch between tasks efficiently.