Articles

What Is LoRA? Low-Rank Adaptation Explained

LoRA fine-tunes a large model by training small low-rank matrices instead of its full weights. How it works, why it's cheap, and where it falls short.

Chisato Chisato · · 5 min read
Abstract purple rendering of interconnected neural pathways

LoRA, short for Low-Rank Adaptation, is a technique for fine-tuning a large model without updating most of its weights. Instead of adjusting the full weight matrices of a pretrained model, LoRA freezes them and trains a pair of much smaller matrices alongside each one, which are combined with the original weights at inference time. The result is a fine-tuning process that touches a tiny fraction of the parameter count, uses far less memory, and produces an adapter file that’s often measured in megabytes rather than gigabytes.

The problem it solves

A modern large language model can have weight matrices with billions of parameters spread across dozens of layers. Full fine-tuning means computing gradients and storing optimizer state for every one of those parameters — which for gradient-based optimizers like Adam means keeping multiple additional copies of the weights in memory just for training bookkeeping. That’s why full fine-tuning a large transformer typically demands the kind of multi-GPU setup only a well-resourced team can afford, and why swapping between several fine-tuned variants of the same base model means storing several full copies of the model.

LoRA sidesteps both costs. If you only need to adapt a model’s behavior — not relearn language from scratch — you don’t need to move every one of its parameters. You need to nudge its outputs in a particular direction, and it turns out that nudge can be represented compactly.

How the low-rank trick works

For a weight matrix W in the original model, LoRA freezes W entirely and adds an update ΔW, but instead of learning ΔW directly (which would be just as large as W), it factors ΔW into the product of two much smaller matrices, A and B, where the shared inner dimension r — the rank — is small, often somewhere between 4 and 64, compared to dimensions in the thousands for the original matrix.

During training, only A and B receive gradient updates; W never changes. At inference, the effective weight is W + BA, either computed on the fly or merged into a single matrix ahead of time so there’s no added latency. Because r is small, the combined size of A and B is a small fraction of W’s size — often well under 1% of the original parameter count for a given layer, depending on the rank chosen.

The rank r is the main knob you tune: a higher rank gives the adapter more capacity to represent complex changes in behavior, at the cost of a larger adapter and more compute; a lower rank is cheaper and faster to train but can underfit if the target task is far from the base model’s existing behavior.

Why this is more than just “fewer parameters”

The size reduction is the headline, but it changes the shape of the whole workflow:

  • Memory during training drops sharply. Optimizer state only needs to track the small A and B matrices, not the full model, which is often the difference between fitting on a single consumer GPU and needing a multi-GPU cluster.
  • Adapters are swappable. Because W is untouched, you can keep one frozen base model in memory and hot-swap different LoRA adapters on top of it — one for a customer-support tone, one for a coding assistant, one for a specific domain vocabulary — without duplicating the base model for each.
  • Storage and distribution are cheap. Sharing a fine-tuned variant means sharing a small adapter file rather than a full model checkpoint.
  • Merging is free at inference time. Once training is done, BA can be added directly into W, producing a standard dense model with no architectural changes and no runtime overhead from the adapter mechanism itself.

LoRA vs full fine-tuning

Full fine-tuningLoRA
Parameters updatedAll of themA small added set (rank-dependent)
Training memoryHigh — optimizer state for the full modelMuch lower
Output artifactA full model copyA small adapter
Swapping variantsRequires separate full modelsSwap adapters on one base model
Best forLarge behavior or knowledge shiftsTargeted style, tone, or task adaptation
Risk of catastrophic forgettingHigherLower, since original weights are frozen

QLoRA and quantized base models

A common pairing is LoRA on top of a quantized base model, often called QLoRA. The frozen base weights are stored in a lower-precision format to shrink their memory footprint further, while the LoRA adapter matrices are still trained in higher precision. Because the base model never receives gradient updates in the first place, quantizing it introduces less risk than it would for full fine-tuning, where precision loss in the weights being trained can compound over many optimizer steps.

Where LoRA fits versus other adaptation methods

LoRA sits in the middle of a spectrum of ways to change a model’s behavior without training from scratch. Prompting and retrieval-augmented generation change what the model sees at inference time without touching its weights at all — cheapest to iterate on, but limited by context window size and unable to change the model’s underlying style or reasoning patterns. Full fine-tuning sits at the other end — most expensive, but capable of the largest behavior shifts. LoRA and other parameter-efficient methods land in between: real weight changes, at a fraction of the cost, well suited to teaching a model a specific tone, format, or narrow domain rather than an entirely new skill.

It’s also distinct from model distillation, which trains a smaller model to mimic a larger one. LoRA doesn’t shrink the model — the base model stays the same size — it just makes the training of a variant cheap.

Where it falls short

LoRA’s low-rank assumption is also its limit: if the change you need doesn’t compress well into a low-rank update, a small rank will underfit no matter how long you train. Tasks that require deep, broad changes to how a model reasons — rather than a stylistic or narrow-domain shift — tend to favor full fine-tuning or a larger rank, which erodes some of the efficiency advantage. Choosing rank is also somewhat empirical; there’s no universal value that works well across every base model and task, so it typically takes some experimentation to land on a rank that balances quality against training cost.

The takeaway

LoRA fine-tunes a model by freezing its original weights and training a small pair of low-rank matrices that get added back in, rather than updating the full weight matrices directly. That cuts training memory dramatically, produces small swappable adapter files instead of full model copies, and merges into a normal dense model at inference with no extra latency. It’s the default choice for targeted adaptation — tone, format, narrow domains — while full fine-tuning still wins for changes broad enough that a low-rank update can’t capture them.

Chisato Chisato · · 5 min read

What Is Catastrophic Forgetting in AI Fine-Tuning?

Catastrophic forgetting is when training a model on new data erases skills it already had. Why it happens during fine-tuning, and how teams work around it.

#AI #LLMs #Machine Learning