Under the hood · 5 of 8 Fine-tuning

How can a small patch change a big model?

Fine-tuning teaches a model something new by changing its numbers. LoRA keeps the model as it is and trains a thin patch next to each layer instead. Pick how wide the patch is, its rank, and see how much of a full fine-tune it gets.

Three new texts for a model that knows Millbrook, from a small change to a big one:

The next word after "driver", before and after

Every driver …

Training…

The patch for the last layer: 16 × 85 numbers

Light: a number went up. Grey: it went down. Each map is shaded to its own largest change. A full fine-tune changes all 1,360. LoRA trains B and A, and adds B × A to the frozen layer.

The same fine-tune, at each rank

Solid: share of the full fine-tune's gain. Outline: numbers trained, against a full fine-tune.

Rank against the gain it reaches

Solid: a lot to learn. Dashed: the other two texts. Rings: your rank.

After LoRA, or the gain it reaches Before, or the numbers it trains A full fine-tune
rank: 2how many directions the patch can change
1234681216
target_modules on Qwen3-8B

Training the model…

Gain reached

–

Of what a full fine-tune gets on this text.

Numbers trained here

–

Of – in this tiny network.

Numbers trained on Qwen3-8B

–

Fine-tuning changes the numbers

Training on new text nudges the model's numbers so the new text becomes less surprising. A full fine-tune nudges every one of them.

LoRA trains a thin patch

LoRA keeps the model as it is. Next to each layer it trains two thin strips, B and A, and adds their product to the layer's numbers.

Rank is the patch's width

The rank is how many directions the patch can change things in. A small change lives in a few directions, so a low rank holds most of it.

The trap

LoRA shrinks what you train and save. The whole model still has to load, in memory and at its own precision, with the patch on top.

Open Under the hood for the formulas, with the numbers from this fine-tune.

Why knowing this helps you

Tools like Unsloth, Axolotl and the PEFT library run LoRA for you. A few settings decide how it goes.

Start at rank 16

PEFT defaults to rank 8 and Unsloth to 16, and Unsloth's Qwen3 notebooks use 32. Raise it only if a held-out check shows the model is still missing what you taught it.

Patch every layer

Patching the feed-forward layers as well as attention usually helps, at a few times the trained numbers. It is still a small share of the model.

Adapters are small files

A rank-16 patch on every weight of Qwen3-8B is about 44 million numbers, under 100 MB at 16 bits, so you can keep one per task and swap them on the same base model.

Mind the scale

Tools also ask for alpha, which scales the patch. A common start is alpha equal to the rank or twice it; change rank and alpha together.

Checked on 2026-10-06 against PEFT's LoraConfig, Unsloth's docs, library defaults and Qwen3 notebooks, the QLoRA paper (Dettmers et al., 2023) on patching every layer, and the Qwen3-8B config for the adapter size.

Where this goes next

Next: learning rate

Every fine-tune here took the same step size. How big a step should be, and why too big a step ruins a model.

Then: overfitting

Train too long on too little text and the model learns it by heart, forgetting what it knew.

Every number on this page comes from a C engine compiled to WebAssembly, which trains the network and every patch in your browser. The texts are made up; the Qwen3-8B shapes are from its published config.