Skip to content
atlas

Low-rank adaptation (LoRA)

Also known as: LoRA adapter

A cheap way to fine-tune a big model - freeze the original weights and train only a small add-on that nudges its behaviour.

Draft - this entry has not been reviewed yet.

Formal

A fine-tuning method that keeps the model weights fixed and learns, for chosen layers, a pair of small extra weight tables whose product is added to the original; only a tiny share of the model parameters is trained and the add-on can be stored and swapped separately.

In plain English

Like clipping a thin lens over a camera instead of rebuilding it - the camera stays the same, the pictures change, and you can swap lenses in seconds.

In practice

A developer at a Danish accounting firm adapts an open model to the firm's standard reports on a single rented GPU; the result is a small adapter file loaded on top of the untouched base model.

Why it matters

It puts fine-tuning within reach of small teams, but adapter files shared online are a new, easily overlooked thing to vet, because one small file can quietly change how a trusted model behaves.

Technical deep dive

For a frozen weight matrix W₀ ∈ ℝ^(d×k), LoRA learns an update ΔW = BA with B ∈ ℝ^(d×r), A ∈ ℝ^(r×k) and rank r ≪ min(d, k), so the layer computes h = W₀x + (α/r)·BAx. A is initialised randomly and B with zeros, so training starts exactly at the pretrained model. The parameter saving is large: for a 4096 × 4096 projection, r = 8 gives 8 × (4096 + 4096) = 65,536 trainable values instead of about 16.8 million, roughly 0.4%. Gradients and optimiser state are needed only for A and B, which is where most of the memory saving comes from; the frozen base still has to be held in memory for the forward and backward passes.

Hu et al. (2021) applied LoRA to the attention query and value projections of GPT-3 175B and reported about 10,000 times fewer trainable parameters and a threefold reduction in GPU memory compared with full fine-tuning, with quality on par. Because BA has the same shape as W₀, it can be merged into the base weights after training, adding no inference latency; alternatively adapters stay separate so many task-specific adapters can share one base model, which serving systems exploit by batching requests for different adapters together. The method rests on the observation that fine-tuning updates have low intrinsic rank. Current practice often targets all linear layers, with ranks from about 4 to 64, using libraries such as Hugging Face PEFT.

QLoRA (Dettmers et al., 2023) trains LoRA adapters on top of a base model quantised to 4-bit NormalFloat, adding double quantisation of the quantisation constants and paged optimiser states, which made fine-tuning a 65-billion-parameter model possible on a single 48 GB GPU. Other variants include DoRA, which separates the magnitude and direction of the weight update, and rank-stabilised LoRA, which scales by α/√r instead of α/r so higher ranks remain effective.

LoRA is not a free replacement for full fine-tuning. Biderman et al. (2024) found that in continued training on code and mathematics it substantially underperforms full fine-tuning, whose weight updates had 10-100 times higher rank than typical LoRA settings, but that it also forgets less of the base model's other abilities. An adapter is bound to the exact base checkpoint it was trained on; loading it onto a different version or quantisation silently changes behaviour. Adapters are also a supply-chain artefact: OWASP's Top 10 for LLM Applications 2025 (LLM03) warns that a malicious LoRA adapter can compromise the integrity of a trusted base model, and research has shown that LoRA fine-tuning can cheaply strip safety training from aligned models, so third-party adapters need provenance checks and evaluation before use.

What to learn first

Everything this builds on, foundations first.

  1. Training data
  2. →Model training
  3. →Model weights
  4. →Low-rank adaptation (LoRA)

Relationships

A kind of
Fine-tuning
Used with
Quantization

Sources & further reading

Reference works

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Mentioned in

Check yourself

Loading…

Atlas is in beta.