Hugging Face, End to EndLesson 60 of 75

Module 7 · Training and adapting, with the libraries the Hub is built on

LoRA: training 0.1% of the parameters

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 4 of 9 in this chapter

This chapter’s goalDecide from evidence whether a task needs fine-tuning at all, run a LoRA or QLoRA adaptation with Trainer or SFTTrainer on a single free GPU, read a loss curve well enough to name what is wrong, and publish an adapter a stranger can apply to the base model.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch2:08Not available
Full audiobookNot availableNot available
Training a 7B model: where the memory actually goesFull fine-tuning: weights,gradients, two optimiserstates56 GBLoRA over a bfloat16 base18 GBQLoRA over a 4-bit base7 GBThe weights are close to the same size in the first two rows. What collapses is the optimiser state,which shrinks by the same hundredfold factor as the trainable parameter count. The third row quantizesthe frozen base as well, which is what puts a seven-billion-parameter fine-tune on a free Colab card.
The weights are close to the same size in the first two rows. What collapses is the optimiser state, which shrinks by the same hundredfold factor as the trainable parameter count. The third row quantizes the frozen base as well, which is what puts a seven-billion-parameter fine-tune on a free Colab card.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

The observation it rests on

Full fine-tuning updates every weight. For a 7B model that means holding the weights, their gradients, and two optimiser states each: roughly four times the weight memory, so about 56 GB at bfloat16 before activations. No free GPU comes close.

LoRA starts from an empirical observation: the change fine-tuning makes to a weight matrix tends to be low-rank: expressible as the product of two much smaller matrices. So freeze the original weight W and learn a small update instead:

output = W·x + B·A·x, where A is r×d and B is d×r

With r=16 on a 4096×4096 matrix, A and B together hold about 131,000 numbers against the original’s 16.8 million: under one per cent. Across a whole model you typically train 0.1% to 1% of the parameters.

The consequences are what make it matter:

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.

Stuck on something?Ask Arjun, your AI tutor

How to cite: Addaly (2026) ‘LoRA: training 0.1% of the parameters’, in Hugging Face, End to End. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/hugging-face/lora-and-peft (Accessed: 29 November 2026).