Running Models YourselfLesson 76 of 82

Module 9 · Making it yours: adapters and training

QLoRA: training a 7B on the card you have

In this lesson

  • 10 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 3 of 9 in this chapter

This chapter’s goalDecide whether a stated failure calls for a better prompt, retrieval or weight training; produce a LoRA adapter on one consumer card from a dataset you built with the correct chat template and loss masking; distinguish generalisation from memorisation and from catastrophic forgetting using a held-out set and a general-capability check; serve or merge the adapter; and state which licences the resulting weights inherit.

This chapter’s media

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

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Where the memory goes when you train a 7B modelFull fine-tune: weights,gradients, optimiser90LoRA on a 16-bit base20QLoRA on a 4-bit NF4 base10GB of GPU memoryA frozen parameter needs no gradient and no optimiser state, which is where seventy of those gigabytesgo. Loading the base in 4-bit NF4 removes most of what is left. Sequence length is what bites next:halving it from 4,096 to 2,048 frees more memory than any other single change.
A frozen parameter needs no gradient and no optimiser state, which is where seventy of those gigabytes go. Loading the base in 4-bit NF4 removes most of what is left. Sequence length is what bites next: halving it from 4,096 to 2,048 frees more memory than any other single change.

Figure

A little at a time

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

Step 1 of 8Free · no account needed
Lesson steps

Where training memory actually goes

Inference needs weights plus a KV cache. Training needs four things, and three of them are invisible until you run out:

  • Weights. 7B at 16-bit is about 14GB.
  • Gradients. One per trainable parameter, same precision. Another 14GB for a full fine-tune.
  • Optimiser state. Adam keeps two moments per parameter, commonly in 32-bit: about 56GB for 7B.
  • Activations. Everything the backward pass needs, which scales with batch size and sequence length and is the term people forget.

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 Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘QLoRA: training a 7B on the card you have’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/qlora-on-one-card (Accessed: 29 November 2026).