Contents

34 / 153

The LoRA Deep Dive

What a LoRA actually is

Chapter 33

6 min read

Reviewed v78 · August 2026

WHY THIS SECTION EXISTS

LoRAs are the single most important customization technology in modern generative imagery. They are the reason a person without a research lab can teach a frontier model to generate their face, their brand, their illustration style, or a fictional character, using a few dozen training images and a few hours on a consumer Graphics Processing Unit (GPU). They are also the reason an entire economy of style packs, character packs, and effect packs exists outside the model labs themselves. Understanding how LoRAs work is the difference between treating image models as fixed black boxes and treating them as flexible substrates you can shape to your purposes. This section covers the technique from five different angles: the math, the training process, the artist's playbook, the operator's playbook, and the strategic implications.

Start with the problem LoRAs were invented to solve. You have a frontier image model, call it FLUX, with twelve billion parameters. You want it to generate images of your face, or your brand's products, or your illustration style. The model does not know any of these things. It was trained on five billion images scraped from the public internet, and you are not in the training set. There are two ways you could teach it.

The first way is full fine-tuning. You take the entire twelve-billion-parameter model and continue training it on your images. Every weight in the model gets updated. This works, but it has three problems. It needs an enormous amount of GPU memory because you need to hold the model, the gradients, the optimizer state, and the activations in memory simultaneously, for a twelve-billion-parameter model that means roughly 200 gigabytes of GPU memory, which costs thousands of dollars per hour to rent. It overwrites the existing knowledge in the model in subtle ways, so the fine-tuned model often gets worse at things that have nothing to do with your training data. And you end up with a complete copy of the model weights, twelve billion numbers stored on disk, which is twenty-something gigabytes, too big to share casually.

The second way is what LoRA does. Instead of updating the model's existing weights, you freeze them entirely, they never change, and you add a small number of new trainable parameters that sit alongside the original weights. During training, only these new parameters are updated. During inference, the model computes its output using the original weights plus a small contribution from the new parameters. The trick is that the new parameters are structured in a clever mathematical form that makes them dramatically smaller than the original weights while still being expressive enough to teach the model meaningful new behaviors. A LoRA for FLUX might add 50 to 200 megabytes of new parameters to a model whose base weights are 24 gigabytes. That's roughly 0.5 to 1 percent of the size of the full model.

01

The mathematical idea: low-rank decomposition

The 'LoRA' name stands for Low-Rank Adaptation, and the word 'low-rank' is doing all the work in that name. It refers to a specific kind of mathematical structure that the new trainable parameters are forced to take. To understand it, you need to know one fact about how neural networks work.

Inside a transformer or a U-Net (a U-shaped convolutional network), most of the computation happens through matrix multiplications. A given layer takes an input vector, multiplies it by a weight matrix (a big rectangular grid of numbers), and produces an output vector. The weight matrix for a single layer of a large model might be 4096 by 4096, that's about 16.8 million parameters in just one layer, and a model has hundreds of such layers. The total parameter count of FLUX comes from the cumulative size of all these weight matrices across all the model's layers.

When you fine-tune a model, you are computing an update to each of these weight matrices, a delta that gets added to the original weights. For a 4096-by-4096 weight matrix, the naive update is itself a 4096-by-4096 matrix, which is the same 16.8 million numbers. The insight behind LoRA, which goes back to a 2021 paper by Edward Hu and seven colleagues at Microsoft, is that this update doesn't actually need to be a full 4096-by-4096 matrix. Empirically, the effective changes that occur during fine-tuning have a property called 'low intrinsic rank', they can be represented as the product of two much smaller matrices without losing the important information.

Here is the trick. Instead of updating the weight matrix directly, you decompose the update into two new matrices: matrix A, which is 4096 by r, and matrix B, which is r by 4096. The number r is called the rank, and it is much smaller than 4096, typically somewhere between 4 and 128. When you multiply A and B together, you get a 4096-by-4096 matrix that looks like a normal weight update, but it only required 4096 × r + r × 4096 parameters to specify, which for r=32 is about 262 thousand numbers instead of 16.8 million. That is roughly a 65× reduction in trainable parameters per layer, and the savings compound across hundreds of layers. For the original LoRA paper applied to GPT-3 (175 billion parameters), the technique reduced the number of trainable parameters by ten thousand times and the GPU memory requirements by three times compared to full fine-tuning.

During training, only A and B are updated. The original weight matrix stays frozen. During inference, the model computes its output using the original weight matrix plus the product of A and B, scaled by a factor we will discuss in a moment. The mathematical fact that makes this all work is that the actual changes the model needs to learn during fine-tuning are simpler than the model itself, most of the model's existing knowledge stays useful, and the fine-tuning is teaching it a specific narrow skill that requires only a small number of independent directions of change in the parameter space. Low-rank decomposition is a way of forcing the fine-tuning to live in those few important directions.

Fig.diagram
xW (frozen)d x d · never trainedthe pretrained model, untouchedAd x rrank rBr x d+hh = Wx + BAxW is huge and frozen.B and A are tiny and trained.r is often 8 to 32.a few MB, not a few GB.A LoRA IS THE DETOUR, NOT THE MODEL. YOU SHIP THE ORANGE PATH; THE FROZEN W STAYS ON EVERYONE'S DISK ALREADY.
The LoRA architecture. The original weight matrix is frozen, it never changes during training. Two new small matrices A and B are added in parallel and only those get updated. At inference time, the model uses the original weights plus the product of A and B.

Check your understanding

pass: 5 of 7

Answer at least 5 of 7 correctly to unlock the next chapter.

  1. 1. Roughly what fraction of a base model's size is a typical LoRA?

  2. 2. What does a LoRA do to the base model's original weights during training?

  3. 3. In the low-rank decomposition, the update is split into matrices A and B; what is the number 'r' called and its typical range?

  4. 4. For a 4096x4096 weight matrix at rank r=32, roughly how many parameters does the LoRA update need instead of 16.8 million?

  5. 5. Where did the LoRA technique originate?

  6. 6. Why is full fine-tuning of a twelve-billion-parameter model so expensive in memory?

  7. 7. In the textbook analogy, what does the 'low-rank' constraint correspond to?

The weekly briefing

Get the week's moves in your inbox.

A short, sourced digest of what actually moved across generative AI, every week. Free.

Free. One email a week, no spam, unsubscribe anytime. Prefer a reader? RSS.