In one line: Freeze W0 and train a zero-initialized low-rank update W = W0 + BA (scaled alpha/r) on attention weights; matches full fine-tuning on GPT-3 175B with 10,000x smaller checkpoints and zero inference latency after merging.
How far to trust it: Believe the mechanism and the engineering: merging is exact, the parameter and storage savings are arithmetic, and five years of use have confirmed it. Treat the claim that LoRA beats full fine-tuning as unproven: the margins sit inside the noise, the baselines were not run under the same conditions, and the GPT-3 results come from runs nobody outside could repeat. The evidence, judged.
The idea in one sentence: freeze every pretrained weight and learn each adapted matrix's change as the product of two thin matrices, ΔW = BA of rank r as small as 1 to 8; on GPT-3 175B that trains 4.7 million numbers instead of 175 billion, matches full fine-tuning, and, once BA is added into W, costs nothing at inference.
You need: nothing beyond a Transformer's attention matrices and Adam's per-weight state. How LoRA is used today (QLoRA, DoRA, rsLoRA, target modules, the fine-tuning memory calculator) is taught on Parameter-efficient fine-tuning; this page is the paper. New terms: r (the rank of the update, the width of the side path); A, B (the down- and up-projection that LoRA trains); α (a constant; the update is scaled by α/r); adapter layer (a small bottleneck MLP inserted in sequence, the 2019 method LoRA replaced); prefix tuning (trained vectors prepended to the input or to every layer); φ (a 0 to 1 overlap between two subspaces, the paper's Equation 4).
The paper's Figure 1 redrawn with GPT-3's numbers. Grey: one pretrained d × d attention matrix, d = 12,288, frozen. Blue: A (r × d, random Gaussian at the start) squeezes the token from d numbers to r, B (d × r, zeros at the start) expands it back; at r = 4 the pair holds 2 × 4 × 12,288 = 98,304 trainable numbers, 0.065% of the matrix beside it. B starts at zero, so training starts exactly at the pretrained model. For deployment add BA into W0 once: the model is the original shape again, with no extra latency (§4.1).
Full fine-tuning updates every weight, so each downstream task gets a complete copy of the model. For GPT-2 or RoBERTa large that is an inconvenience; for GPT-3, with 175 billion trainable parameters (about 350 GB in FP16), storing, deploying and switching between one copy per task is "prohibitively expensive" (Abstract, §2). Fine-tuning is still worth having: on GPT-3 it lifts MNLI-matched from 40.6% few-shot to 89.5%, and RTE from 69.0% to 85.4% (Appendix A, Table 8).
The parameter-efficient alternatives of 2021 each paid a real cost (§3):
The question: can adaptation be parameter-efficient, train stably, match fine-tuning and add exactly zero inference latency?
Aghajanyan et al. (2020) had shown that fine-tuning has a low "intrinsic dimension": optimising only 200 parameters, randomly projected back into the full space, gets RoBERTa to 90% of full fine-tuning's performance on MRPC (Aghajanyan et al.). LoRA's hypothesis is the matrix version of that: the change in a weight matrix during adaptation has a low "intrinsic rank" (§1, §4.1). So for a pretrained weight W0 ∈ ℝd×k, freeze it and learn the update as a product of two thin matrices:
The released code differs in a detail: its linear layers draw A from a Kaiming-uniform distribution, and its embedding layers reverse the roles (A zero, B normal) (loralib/layers.py).
Fig. 2, step by step: Equation 3 on a real matrix
The toy model of the Train a LoRA tab: its frozen Wv and the LoRA that was trained on it, on a task whose true update is known (task "Wv, rank 4"). Every bar is a real weight, up positive, down negative, all at one scale. The same picture on a released model, SmolLM2-135M's layer 14 query matrix, is Fig. 2 of Parameter-efficient fine-tuning.
Fig. 3, step by step
One token through one weight matrix of GPT-2 medium (d = 1,024), with a LoRA update and then with an adapter (the toggle above the figure), drawn to scale: at r = 4 the small matrices are 4 numbers thick against 1,024.
Each adapted matrix gets A (r × 12,288) and B (12,288 × r), so |Θ| = 2 × L̂ × d × r with L̂ the number of adapted matrices (§5.1): 2 × 192 × 12,288 × 1 = 4,718,592, the "4.7M" of Table 4, 37,000 times fewer than the 175,255.8M that full fine-tuning trains. The calculator under Method runs the same formula for other ranks, matrices and task counts.
Any dense layer can take a LoRA update. In a Transformer there are four attention matrices (Wq, Wk, Wv, Wo, each treated as one dmodel × dmodel matrix even though its output is sliced into heads) and two in the MLP. The paper adapts only attention weights and freezes the MLPs, "both for simplicity and parameter-efficiency", leaving the MLP, LayerNorm and biases to future work; most experiments adapt just Wq and Wv (§4.2, §5.1). The paper uses dffn = 4 × dmodel and trains with Adam throughout (§1, conventions).
A generalisation of full fine-tuning. With LoRA on every weight matrix and all biases trained, setting r to the rank of the pretrained matrices roughly recovers full fine-tuning; as trainable parameters grow, LoRA converges to training the original model, while adapters converge to an MLP and prefix methods to a model that cannot take long inputs (§4.1).
Practical benefits on GPT-3 175B (§4.2):
The stated limitation. If you merge A and B into W to remove latency, one forward pass cannot easily serve a batch whose inputs belong to different tasks. Without merging, the LoRA modules can be chosen per sample, where latency is not critical (§4.2).
LoRA is also orthogonal to other methods: Appendix E combines it with prefix tuning, and LoRA plus prefix-embedding reaches 75.0 to 76.2 on WikiSQL against 73.8 for full fine-tuning, while LoRA plus prefix-layer does slightly worse than LoRA alone (Appendix E, Table 15).
GPT-3 175B: dmodel = 12,288, 96 layers, 175,255.8M parameters (Table 4); FP16 is 2 bytes per number. The defaults reproduce Table 4's 4.7M and, at r = 4, §4.2's "35MB" (37.7 MB exactly) and "354GB for 100 models", independently from the formula.
Both W0 and BA are d × k, so for deployment compute W = W0 + BA once and run inference exactly as a fine-tuned model would. To switch tasks, subtract BA and add another B′A′, a quick operation with very little memory overhead. This guarantees no added latency "by construction" (§4.1). Checked live on this page's toy model with its trained adapters: computing...
RoBERTa and DeBERTa on GLUE, GPT-2 on E2E NLG, GPT-3 175B on WikiSQL, MNLI and SAMSum, against full fine-tuning (FT), adapters and prefix tuning; all on V100s (§5).
Setup. RoBERTa and DeBERTa on GLUE; GPT-2 on E2E NLG (WebNLG and DART in the appendix), following Li & Liang (2021); GPT-3 175B on WikiSQL, MNLI and SAMSum; all on V100s (§5, Appendix C). Baselines, reused from prior work where possible (asterisked rows) (§5.1): full fine-tuning (FT), FTTop2 (last two layers), BitFit (biases only), prefix-embedding (PreEmbed) and prefix-layer (PreLayer) tuning, and adapters H (Houlsby), L (Lin), P (Pfeiffer) and D (AdapterDrop).
It falls to 55.9%, the score it had with 32 tokens; prefix-layer tuning falls from 70.1% at 20.2M parameters to 64.9% at 76.1M. LoRA, from 4.7M to 603.8M parameters, stays between 73.3% and 74.1%. This is Figure 2 redrawn from the printed values of Table 15 below (the figure itself is an image; its plotted points are those of Table 15, per Appendix F.2).
Low data (Appendix F.3, Table 16): on MNLI subsets of 100, 1k, 10k and 392k examples, LoRA scores 63.8, 85.6, 89.2 and 91.7 against fine-tuning's 60.2, 85.8, 88.9 and 89.5; prefix-embedding is near chance at 100 examples (37.6% against 33.3%). With the stated ±0.3 seed variance, LoRA wins at 100 and at full size and ties in between.
The low-rank structure also makes the update readable. Section 7 asks three questions on GPT-3 (§7).
Which matrices, for a fixed budget? With 18M trainable parameters (about 35 MB in FP16), which is r = 8 on one matrix type, r = 4 on two, or r = 2 on all four, in all 96 layers: Wq alone gets 70.4% on WikiSQL and Wk alone 70.0%, clearly worse, while Wq, Wv at r = 4 gets 73.7% and all four at r = 2 gets 73.7% (MultiNLI 91.3% and 91.7%). The paper concludes that even r = 4 captures enough of ΔW that adapting more matrices beats a higher rank on one (§7.1, Table 5). Wo alone (73.2%, 91.3%) and Wv alone (73.0%, 91.0%) are close to the best; see How much to believe.
What rank? On WikiSQL and MultiNLI, r = 1 already does as well as r = 64 when adapting Wq and Wv (73.4% against 73.5%; 91.3% against 91.4%), while Wq alone needs a larger r (68.8% at r = 1, 70.5% at r = 4) (§7.2, Table 6). The authors do not expect small r to work everywhere: if the downstream task were in a different language from pretraining, retraining the whole model (LoRA with r = dmodel) could certainly do better (footnote 6). On GPT-2 medium the optimum is between 4 and 16: BLEU peaks at r = 4 (70.38) and validation loss stops improving at 16 (Appendix H.2, Table 18).
Do different ranks and seeds find the same directions? Take the learned A at r = 8 and at r = 64, compute their right-singular vectors U, and measure how much of the span of the top i of one lies in the span of the top j of the other:
In layer 48 of 96, the top direction of r = 8 and r = 64 overlap with φ > 0.5 for both ΔWq and ΔWv, and the rest look like noise accumulated in training: that is why r = 1 works (Figure 3). Two seeds at r = 64 share their top directions too, while two random Gaussian matrices share none; ΔWq shares more directions across seeds than ΔWv, so it seems to have a higher intrinsic rank, in line with Table 6 (Figure 4). The 1st, 32nd, 64th and 96th layers look the same (Appendix H.1). The Train a LoRA tab draws the same heatmaps from a toy model, where the true update is known.
Fig. 4, step by step: the paper's Figures 3 and 4 on the toy
Measured on the toy's adapters for task "Wv, rank 4" (ΔWv, seeds 1 and 2, ranks 4 and 16), with the paper's φ: each plate is a grid of φ(i, j), bar height from 0 to 1, the top-i directions of one matrix down the side and the top-j of the other across.
Project Wq onto the r-dimensional subspace of ΔWq, ‖U⊤WqV⊤‖F with U, V the singular vectors of ΔWq, and compare with Wq's own top directions and with random ones (§7.3, Table 7). At r = 4 in layer 48: 0.32 along ΔW's directions, 21.67 along W's own, 0.02 along random ones (‖Wq‖ = 61.95). So ΔW correlates with W more than chance, but not with its top directions: it amplifies features that are present and not emphasised, and by a lot, ‖ΔWq‖ / 0.32 = 6.91 / 0.32 ≈ 21.5. At r = 64 the factor is only about 2 (3.57 / 1.90), because most of the 64 directions are not amplified, more evidence that the needed rank is low (Appendix H.4). The top 4 directions of ΔW barely reach 0.2 similarity with the top 10% of W's (Appendix H.3).
The paper's reading: low-rank adaptation amplifies task-specific features that pretraining learned but did not emphasise, a different set of directions for each task (§7.3, H.4). Open questions it lists: combining LoRA with other methods, how pretrained features are transformed, a principled choice of matrices, and whether W itself is rank-deficient (§8).
Answer the question above before you look. Bars on a log scale, printed values from Table 7 (GPT-3, layer 48, ΔWq). The toy model's own Table 7, computed live from its trained adapters, is in the Train a LoRA tab.
What holds up. The mechanism's central claims are arithmetic, not measurement. Merging is exact (this page checks it live), so zero added latency is true by construction. The parameter counts reproduce from the formula for every GPT-3 configuration in Table 15, and the storage and multi-task figures follow from them (every number checked). Adapter latency (Table 1) is measured over 100 trials with error bars. And the method has since been replicated at every scale by everyone who fine-tunes models: it is the default in Hugging Face PEFT, and QLoRA (2023) and LoRA Without Regret (2025) reproduce "LoRA matches full fine-tuning" under stated conditions (beyond the paper; see Why it matters).
What is weaker, concretely:
In the authors' favour: they state the low-rank limit themselves (footnote 6), give per-task noise for GPT-3 instead of hiding it, rerun adapter baselines in a deliberately restricted fair setup, and flag that some GPT-2 hyperparameters were tuned at r = 4 and may not suit other ranks (Table 18 caption).
Verdict: believe the mechanism and the engineering; they are exact, and five years of use confirm them. Read "on-par or better than fine-tuning" as "on par": the margins are inside the noise or produced by setup differences. The toy on this page agrees on what LoRA needs, enough rank on the right matrices, and shows where it falls short without them: (loading) (Train a LoRA).
loralib, MIT licence) with RoBERTa, DeBERTa and GPT-2 checkpoints; in practice everyone uses Hugging Face PEFT, which the repository itself points to since February 2023.LoRA became the default way to fine-tune large models; Hugging Face PEFT's LoraConfig is the standard interface (PEFT LoRA guide). QLoRA (May 2023) backpropagates through a frozen 4-bit NormalFloat (NF4) base into LoRA adapters and fine-tunes a 65B model on a single 48 GB GPU, which put LLM fine-tuning within hobbyist reach (QLoRA; NF4, double quantisation and paged optimisers are explained on Parameter-efficient fine-tuning).
The zero-latency merge and the tiny adapters also created multi-tenant serving: S-LoRA serves thousands of concurrent adapters over one base, with up to 4× the throughput of PEFT and naive vLLM (S-LoRA). How a server batches requests for different adapters (Punica's kernel, S-LoRA's memory pool) is on LLM serving in production; this paper's own limit, that a merged model serves one task per batch, is what those systems remove.
Three later results an engineer should know, each tested against this paper's recipe (taught in full on Parameter-efficient fine-tuning):
use_rslora in PEFT sets the scale to lora_alpha/√r). The paper's own Table 7 shows the effect: ‖ΔWq‖ is 6.91 at r = 4 and 3.57 at r = 64.use_dora in PEFT).vLLM and SGLang batch many adapters over one base, SGLang "incorporating techniques from S-LoRA and Punica" (vLLM, SGLang). Apple ships per-feature adapters over one on-device model of about 3 billion parameters; a rank-16 adapter takes tens of megabytes and is loaded and swapped on the fly (Apple, June 2024). Fine-tuning services, including RL fine-tuning such as Thinking Machines' Tinker, are LoRA underneath (Tinker).
The scientific contribution has aged as well as the engineering one: the intrinsic-rank analysis (adaptation amplifies existing but unemphasised features in a low-dimensional subspace) remains a standard lens on what fine-tuning does.
A real model, trained here by real arithmetic: a small Transformer block pretrained to count, and adapted, while you watch, to a task whose correct weight update is known. That lets this tab test the paper's claims directly: does a low-rank update suffice, on which matrices, and does LoRA find the true update's directions?
Try: the default (Wq, Wv, r = 4) on the rank-4 task; then r = 1 (too little rank: it plateaus); then Wq alone at r = 32 (plenty of rank on the wrong matrix); then the MLP task with attention-only LoRA.
Trained offline in PyTorch with the identical model, data and update rule (check: the browser engine reproduces PyTorch): 2,000 steps each; for each configuration the learning rate is picked from three values on a separate validation set with seed 0, as the paper tuned per method and dataset, and seeds 1 and 2 rerun at that rate. Points are means of the three seeds, bars span them. "Changed" counts only the sequences where the teacher disagrees with the base model: the part the update must learn.
512 trainable numbers, the toy's equivalent of the paper's 18M: r = 8 on one 32 × 32 matrix, r = 4 on two, r = 2 on four; the MLP pair at r = 2 is 640 (its matrices are 32 × 128).
The same measurements as §7.2 and §7.3, on adapters trained above (Wq, Wv; seeds 1 and 2; rank 4 and 16), with one thing the paper could not have: the true update's directions.
Heatmap: φ(i, j) of Equation 4 between the top-i right-singular vectors of the first A and the top-j of the second, computed live (Jacobi SVD in plain JS, checked against NumPy). Bars: ‖U⊤W V‖F with U, V the top-r singular directions of ΔW, of W itself, or random, as in Table 7. Adapter weights are stored at 12 bits, which perturbs only the smallest singular values.
The paper's hypothesis is about the update itself, so look at the update full fine-tuning finds when nothing constrains its rank: the singular values of ΔW = Wafter − W0 for each matrix, seed 1.
Every table that carries the argument, transcribed from the arXiv HTML (v2) with the printed precision kept, and every derived number recomputed by recompute.py from the paper's own formulas. Where a number does not reproduce, it says so.
LoRA: |Θ| = 2 × L̂LoRA × dmodel × r; adapters: L̂Adpt × (2d r + r + d) + 2L̂LNd; prefix-embedding d × (lp + li); prefix-layer L × d × (lp + li) (§5.1). Model shapes from the Hugging Face configs and GPT-3's d = 12,288, 96 layers.
One forward pass in milliseconds, mean of 100 trials on an NVIDIA Quadro RTX8000, with the printed ± (Table 1). Percentages recomputed from the milliseconds; all six reproduce. |Θ| is the adapters' trainable parameter count for each setting: 0.5M, 11M, 11M.
Bold: the best value in each column within each model size, computed here. * numbers published in prior works. The LoRA rows' 0.35M and 0.77M do not recount from rq = rv = 4 (recount).
Table 5: 18M trainable parameters in every row (Table 5). The grey band is the best row ± the paper's stated seed noise.
Table 6 (Table 6): accuracy against rank for three choices of matrices.
Validation accuracy with 100, 1k, 10k and 392k training examples (Table 16); the paper gives ±0.3 seed variance. Chance is 33.3%.
After 26,000 steps; some hyperparameters were tuned at r = 4 (Table 18).
A few printed values disagree between tables, and Appendix D.4 gives a wrong configuration for 37.7M; none changes a conclusion.
What later work changed in how LoRA is used, one step at a time, and what survived untouched. Each step marks the matrices that get adapters in a decoder block of today (orange; its SwiGLU MLP has three matrices where GPT-3's had two) and how the base is stored; every change carries its source. All of this is beyond the paper.
Step by step, 2021 to 2025
| Part of the recipe | 2021 paper | Practice since | Source |
|---|---|---|---|
| Frozen W0, update BA, B = 0 at start | yes | survived, the default in PEFT | PEFT LoRA guide |
| Merging for zero latency | yes | survived for single-task deployment; multi-tenant servers keep adapters unmerged and batch them | S-LoRA, vLLM |
| Which matrices | attention only, usually Wq, Wv | changed: all linear layers, the MLP mattering most | QLoRA §4, LoRA Without Regret |
| Scale | α/r, α fixed | both in use: α/r stays the default; α/√r (rsLoRA) is an option for high ranks | rsLoRA, PEFT use_rslora |
| Base precision | FP16 | changed where memory binds: a 4-bit NF4 base (QLoRA) | QLoRA |
| Learning rate against full fine-tuning | 40× on GPT-3 (2E-04 against 5E-06, Table 12) | about 10× is the measured optimum | LoRA Without Regret |
| Weight update form | W0 + BA | extended: DoRA learns a magnitude and applies LoRA to the direction | DoRA |
Every link opens in a new tab. Reading time of the resources below: 4h 08m.
ICLR 2022, the paper itself; the HTML version has the anchors this page links to. abstract page, PDF.
(45 min)
the authors' package, MIT licence; about 15 minutes for the README. It releases the RoBERTa, DeBERTa and GPT-2 adapters (1.5 to 2.3 MB each for GPT-2) but no GPT-3 code or weights.
(15 min)
Sebastian Raschka: the best empirical guide to r, alpha, which layers, and QLoRA trade-offs, from hundreds of runs.
(30 min)
Sebastian Raschka, Lightning AI: implement the roughly 20 lines that LoRA actually is; makes the mechanics stick.
(45 min)
John Schulman and Thinking Machines Lab, 29 September 2025: the modern authority on when LoRA matches full fine-tuning and how to configure it; partially overturns the original paper's layer advice.
(35 min)
Hugging Face: the library everyone actually uses to apply LoRA (LoraConfig, use_rslora, use_dora); the conceptual guides double as a good method overview.
(30 min)
Dettmers, Pagnoni, Holtzman, Zettlemoyer, May 2023: LoRA on a frozen 4-bit NF4 base with paged optimisers: a 65B model fine-tuned on one 48 GB GPU.
(40 min)
Edward Hu (video linked from the repository README; 7 min 28 s): the first author's own short walk through the reparametrisation and why the update can be low rank.
(8 min)
2023: 4-bit quantised frozen base plus LoRA, the combination that put fine-tuning on one GPU.
2020: the 175B model whose deployment cost motivated LoRA and on which it was stress-tested.
2018: the encoder family (RoBERTa, DeBERTa) of the GLUE experiments.
2023: preference post-training, in practice often run on LoRA adapters.
2024: RL post-training; LoRA Without Regret found RL needs very little adapter capacity.
2023: the serving side; vLLM batches many LoRA adapters over one base model.
2019: the 16-bytes-per-parameter accounting of Adam training that LoRA's memory saving is measured against.
2017: the Wq, Wk, Wv, Wo projections LoRA adapts.
PEFT and fine-tuning practice.
multi-adapter serving over one base model.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.