Advanced

LoRA and partial tuning

Full tuning moves every weight, which costs memory and produces a whole model per job. LoRA trains small add-on matrices instead, so a job is cheap and several jobs sit on one base model. The trade is capacity: a narrow adapter learns a narrow job well and a broad one poorly.

What you will see

A plateau at 0.61. If the job is broad, that plateau is the rank running out of capacity, not a converged run.

About 1 min of reading

Try It

Check the plateau.

1

The curve

held = [0.40, 0.55, 0.60, 0.61, 0.61] print(held)

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A plateau at 0.61. If the job is broad, that plateau is the rank running out of capacity, not a converged run.

Data Flow

Adapters sit on one base.
1 Load the base once
↓
2 Train small matrices
↓
3 Attach an adapter per job
↓
4 Switch adapters at serve time
Line by line

Read the first example one line at a time. A line that prints shows what appears on screen; the rest set things up quietly.

held = [0.40, 0.55, 0.60, 0.61, 0.61] sets nothing on screen
print(held) A plateau at 0.61. If the job is broad, that plateau is the rank running out of capacity, not a converged run.
Why this works
Match the tool to the job

A format or style job fits a small adapter. A job that needs the model to learn a whole new domain is closer to full tuning, and forcing it into a tiny adapter produces a quiet partial failure.

Merge only when serving needs it

Merging an adapter into the base makes one model and loses the ability to switch. Keep adapters separate until a serving constraint forces the merge.

Examples

Adapters stack

One base model with several adapters is several jobs. Switching the adapter switches the job, which is what makes a set of small tuned behaviours practical where full models would be many gigabytes each.

Rank is capacity

The adapter's rank is how much it can learn. A job that needs a large change in behaviour with a tiny rank learns a weak version of it, and the symptom is a held out score that plateaus early.

Target the right layers

Which layers get the adapter matters. A job that changes output shape usually needs the projection layers; a job that changes knowledge needs more, and more is closer to full tuning.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← The knobs that matter
Previous Lesson
The knobs that matter
Next Lesson
Generating examples at scale
Generating examples at scale →