Machine Learning PapersLandmark papers
← All papers
RESEARCH PAPER / 2021

LoRA: Low-Rank Adaptation of Large Language Models

Edward J. Hu, Yelong Shen, Phillip Wallis ...Full author list in the original paper.

Microsoft Research · landmark

Affiliations: Microsoft Research

Abstract

An important paradigm of natural language processing consists of large-scale pre-training on general domain data and adaptation to particular tasks or domains. As we pre-train larger models, full fine-tuning, which retrains all model parameters, becomes less feasible. Using GPT-3 175B as an example -- deploying independent instances of fine-tuned models, each with 175B parameters, is prohibitively expensive. We propose Low-Rank Adaptation, or LoRA, which freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture, greatly reducing the number of trainable parameters for downstream tasks. Compared to GPT-3 175B fine-tuned with Adam, LoRA can reduce the number of trainable parameters by 10,000 times and the GPU memory requirement by 3 times. LoRA performs on-par or better than fine-tuning in model quality on RoBERTa, DeBERTa, GPT-2, and GPT-3, despite having fewer trainable parameters, a higher training throughput, and, unlike adapters, no additional inference latency. We also provide an empirical investigation into rank-deficiency in language model adaptation, which sheds light on the efficacy of LoRA. We release a package that facilitates the integration of LoRA with PyTorch models and provide our implementations and model checkpoints for RoBERTa, DeBERTa, and GPT-2 at https://github.com/microsoft/LoRA.

The following analysis is generated by AI and may contain errors. It is separate from the authors’ abstract and is not peer review.

Research summary

This paper introduces Low-Rank Adaptation (LoRA), a parameter-efficient fine-tuning method that injects trainable rank-decomposition matrices into frozen pre-trained weights, achieving full fine-tuning performance with drastically reduced memory and compute overhead while eliminating inference latency. The work represents a paradigm shift in LLM adaptation, combining rigorous empirical validation with profound theoretical insights into the low-rank nature of weight updates, ultimately enabling scalable, cost-effective, and widely adopted deployment of large-scale language models across academia and industry.

Methodology

The paper introduces a mathematically elegant reparameterization technique that constrains weight updates to a low-rank decomposition ($W = W_0 + BA$) while freezing the original pre-trained weights. The design is conceptually simple yet highly effective: by initializing $B$ to zero and scaling the update by $\alpha/r$, the method ensures training starts exactly from the pre-trained baseline without disrupting initial representations. The critical architectural innovation is the parallel injection of low-rank matrices, which allows them to be algebraically merged with the base weights at deployment time, completely eliminating the sequential inference latency that plagues adapter modules. The theoretical grounding in intrinsic dimensionality and rank-deficiency during adaptation is well-motivated, clearly articulated, and directly addresses the optimization bottlenecks of prior parameter-efficient methods.

Results & evaluation

The empirical evaluation is comprehensive and spans multiple model scales (RoBERTa, DeBERTa, GPT-2, GPT-3) and diverse tasks (GLUE, NL2SQL, summarization, data-to-text). The authors rigorously compare LoRA against full fine-tuning, adapter layers, and prefix-tuning, demonstrating that LoRA matches or exceeds baseline performance while reducing trainable parameters by up to 10,000x and training VRAM by 3x. The ablation studies on rank selection, weight matrix targeting ($W_q, W_v$), and subspace similarity analysis provide deep, interpretable insights into why low-rank adaptation works. The low-data regime experiments further highlight LoRA's robustness compared to prompt-based methods, and the analysis of amplification factors offers a novel lens into how pre-trained features are selectively emphasized during downstream adaptation.

Reproducibility

Reproducibility is exceptionally high. The authors release a well-documented PyTorch package, detailed hyperparameter tables for all model/task combinations, training configurations, and random seed protocols. The mathematical formulation is straightforward to implement, and the provided codebase has become the de facto standard for PEFT in the open-source community. All experimental setups, including dataset preprocessing and evaluation metrics, are clearly specified, enabling direct replication.

Limitations

The paper acknowledges that merging weights prevents dynamic multi-task batching in a single forward pass, requiring explicit weight swapping for task switching. The selection of target layers (attention vs. MLP) and optimal rank $r$ relies partly on heuristics and empirical sweeps rather than a principled theoretical framework. Additionally, the method assumes the adaptation update is inherently low-rank, which may not hold for tasks requiring drastic domain shifts (e.g., cross-lingual adaptation or entirely new modalities), and the analysis does not fully explore the interaction between LoRA and modern architectural components like MoE or rotary positional embeddings.

Broader impact

LoRA has fundamentally democratized access to large language model fine-tuning, drastically lowering the computational, financial, and environmental barriers for researchers and practitioners. By enabling efficient, latency-free adaptation, it has catalyzed the development of multi-task LLM services, personalized AI assistants, and domain-specific models. Its open-source release and architectural simplicity have spawned an entire ecosystem of derivative methods (e.g., QLoRA, DoRA, AdaLoRA), making it a cornerstone of modern LLM deployment pipelines and significantly accelerating the pace of applied AI research. This paper introduces Low-Rank Adaptation (LoRA), a parameter-efficient fine-tuning method that injects trainable rank-decomposition matrices into frozen pre-trained weights, achieving full fine-tuning performance with drastically reduced memory and compute overhead while eliminating inference latency. The work represents a paradigm shift in LLM adaptation, combining rigorous empirical validation with profound theoretical insights into the low-rank nature of weight updates, ultimately enabling scalable, cost-effective, and widely adopted deployment of large-scale language models across academia and industry.

Curator note

Hu et al.; standard PEFT method; enables consumer fine-tuning

Discussion

Talks & videos

Related later work

Author of this paper? Send a correction.