Log inStart free
LESSON 12.02 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

LoRA

Watch a frozen model learn to answer through two small matrices.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 12.02 · FINE-TUNING BAY175 WEIGHTS FROZEN · TRAINABLE 0
01
Stage 1 of 6 · Frozen base
LoRA keeps the 175 weights of the pretrained model frozen. The base model answers no question.
Explain it simply

Here is the small model from the last lesson, with its four grids of weights. LoRA will not change any of these 175 numbers, so they stay faded. Look at the three rows on top. After the word bot, the base model writes "what color is the" for the sky, not the word blue.

Three prompts in teal chips. The base model's words follow in dashed chips: sky: what color is the; grass: ? what color is; snow: . . . .. Four faded weight grids E, W1, W2 and U. Below, the 4 by 4 grid of W2.

tokensweights, B and Aanswers, singular valueslosszero, or not the target wordbeyond rank r
frozenweightsuserwhatcoloristhesky?botwhatcoloristheuserwhatcoloristhegrass?bot?whatcolorisuserwhatcoloristhesnow?bot....E60W120W220U751.670.501.13−0.77−0.982.26−1.930.040.29−2.531.310.360.14−2.18−1.311.65W2, frozenW2: 16 frozen weights, as in 12.01175 weights, all frozentrainable: 0memory: 4 B per weightE 60 · W1 20 · W2 20 · U 75frozenweightsuserwhatcoloristhesky?botwhatcoloristheuserwhatcoloristhegrass?bot?whatcolorisuserwhatcoloristhesnow?bot....E60W120W220U751.670.501.13−0.77−0.982.26−1.930.040.29−2.531.310.360.14−2.18−1.311.65W2, frozenW2: 16 frozen weights, as in 12.01175 weights, all frozentrainable: 0memory: 4 B per weightE 60 · W1 20 · W2 20 · U 75
Toy: the 2-layer model of 12.01, 175 frozen weights, 3 chat pairs
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
W frozen: ∇W is not used\sy{w}{param}{W}\ \text{frozen}:\ \nabla_{\sy{w}{param}{W}} \text{ is not used}
∣θ∣=175, trainable=0|\theta| = 175,\ \text{trainable} = 0

Training never writes to the base weights.

Common mix-ups

MYTHA LoRA model runs slower, because it adds two matrices.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01At 0 steps, does the LoRA model answer like the base model?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.