esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

What Is QLoRA?

What QLoRA is, how it fits a big model onto one GPU, where it is limited, and how to answer it, explained simply for your AI interview.

In short

QLoRA is a way to fine-tune a large language model whose frozen weights are stored in 4 bits, with small LoRA adapters trained on top. Its authors say it lets you fine-tune a 65 billion parameter model on one 48GB GPU.

10 min readIntermediateCommon · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

QLoRA is a way to fine-tune a big language model on modest hardware. The model's frozen weights are stored in 4 bits instead of 16, and small LoRA adapters are trained on top. The paper says this fits tuning a 65 billion parameter model on one 48 gigabyte GPU. The catch is that quality and stability need checking, so I test every tune on my own tasks before I trust it.

What is QLoRA, in plain words?

A large language model is built from billions of numbers called weights. Fine-tuning changes some of them so the model suits your task, such as writing claims summaries in your insurer's house style. Full fine-tuning updates every weight, so it needs memory for all of them. A GPU is the graphics card that does the heavy maths of training.

QLoRA combines two ideas. The big model is stored in a smaller form, called quantization, where each weight takes 4 bits instead of 16. Then small adapters, called LoRA (low-rank adaptation), are added and trained, while the big model stays frozen.

Picture a law firm with a 40,000-page contract archive. To save shelf space, the archive is kept on compressed microfilm. Lawyers read it through the viewer and write their own notes on separate paper, and only the notes change. QLoRA works the same way: the archive is the frozen model, and the notes are the adapters.

Key words

Quantization
Storing numbers with fewer bits, so the model takes less memory.
Base model
The big model you start from. In QLoRA it stays frozen.
Adapter
A small set of extra weights that learn your task.
Frozen
Not allowed to change during training.

How does QLoRA train a model?

Each training step works like this. Your examples go into the model, the model answers, the answer is checked against the right one, and the error is sent back. In QLoRA the error travels back through the frozen 4-bit model, but only the adapters are updated.

One training step with QLoRA

Your training examples

your team's own labelled cases

Model in memory

Base model, 4-bit

frozen: its weights never change

LoRA adapters

the only weights that learn

Error on each answer

it changes only the adapters

Adapter file

saved and shared per task

  1. 1Training examples go into the model, in small batches.
  2. 2The model's answer is compared with the right one, and the error is measured.
  3. 3After training, only the adapters are saved and shared.
Your examples feed a frozen 4-bit base model with small adapters on top. The error is measured, and only the adapters change. Only that small adapter file is saved and shared.
  • “QLoRA backpropagates gradients through a frozen, 4-bit quantized pretrained language model”

    QLoRA paper, 2023

  • “QLoRA is a method that quantizes a model to 4-bits and then trains it with LoRA.”

    Hugging Face PEFT guide

  1. 1

    Freeze the big model

    Its weights are loaded in 4 bits, and training never changes them.

  2. 2

    Add small adapters

    LoRA matrices are attached to the layers. These are the only weights that learn.

  3. 3

    Save the adapters

    The output is a small adapter file. Your team keeps one per task and loads it on the same base model.

The Hugging Face PEFT library says these methods only add extra trainable parameters, so a quantized model can carry a small adapter on top. The adapter idea itself comes from LoRA, which freezes the base and trains small matrices in each layer.

Where does the memory saving come from?

The paper names three ideas. The 4-bit format does most of the work, and the other two are smaller helpers.

  • NF4, a 4-bit number format

    Built for weights that follow a normal bell curve. The paper calls it a new data type that is information theoretically optimal for normally distributed weights.

  • Double quantization

    The small scaling numbers that the 4-bit format needs (the paper calls them quantization constants) are compressed too, which cuts average memory use a little.

  • Paged optimizers

    Built to manage memory spikes. It is meant for the moments when memory use suddenly peaks during training.

A worked example makes the saving concrete. Made-up plan: a legal-tech team wants to tune a 65B open model on one 48 GB GPU. The code below counts only the stored weights.

Python
# A legal-tech team wants to tune a 65B open model on one 48 GB GPU.
# Made-up plan: counts only the stored weights, not activations, adapters or scaling numbers.
PARAMS = 65_000_000_000
GPU_GB = 48

def weights_gb(bits):
    return PARAMS * bits / 8 / 1e9

for bits in (16, 4):
    gb = weights_gb(bits)
    fits = "fits" if gb < GPU_GB else "does not fit"
    print(f"{bits:>2}-bit weights: {gb:6.1f} GB, {fits} in {GPU_GB} GB")

Output

16-bit weights:  130.0 GB, does not fit in 48 GB
 4-bit weights:   32.5 GB, fits in 48 GB

Our arithmetic: 65 billion weights at 2 bytes each is about 130 GB, and at 4 bits, about 32.5 GB. The 4-bit copy fits, with about 15 GB left for adapters, batches of training data and working space. The 16-bit copy does not fit before training even starts.

The same 65B model, stored two ways on one 48 GB card

Regular 16-bit tuning

65B weights at 16-bit

about 130 GB of weights alone

QLoRA

65B weights at 4-bit

about 32.5 GB of weights alone

Too big for 48 GB

the GPU runs out of memory

Fits on one 48 GB GPU

room left for adapters and work

  1. 1Stored at 16 bits, the weights alone are too big for the card.
  2. 2Stored at 4 bits, the same model leaves room to train.
The same 65 billion weights, stored two ways on one 48 GB card. Regular 16-bit storage fails before training starts, while 4-bit storage leaves room to train the adapters.

Tip

Asked for the numbers? Say they count the weights only. Working memory for the batches and results during training adds more, so the real margin is smaller.

What is the catch?

The paper says QLoRA keeps full 16-bit task performance on its tests. The Hugging Face guide adds the warning that matters in practice.

  • “We present QLoRA, an efficient finetuning approach that reduces memory usage enough to finetune a 65B parameter model on a single 48GB GPU while preserving full 16-bit finetuning task performance.”

    QLoRA paper, 2023

  • “after a model is quantized it isn't typically further trained for downstream tasks because training can be unstable due to the lower precision of the weights and activations”

    Hugging Face PEFT guide

So QLoRA buys memory with some risk. Quantized weights can make training less stable. The paper's authors also say chatbot benchmarks are not trustworthy, so a score that looks good on a public test may not match your own work. Measure your tune on your own tasks, and compare it with a regular tune when you can.

Tip

Asked how you would decide? Start with the memory you have, then test quality on your own data. Do not promise the same quality as a full tune without measuring it.

How would you choose between QLoRA and a full tune?

  • Full tune

    Every weight trained

    All 65 billion weights are stored at 16 bits, and training also needs memory for gradients and optimizer states. One 48 GB card cannot hold that.

  • QLoRA

    Base frozen, adapters trained

    The base sits at 4 bits and only small adapters learn, so one 48 GB card can do the job.

I would say what I do first: check the memory, pick QLoRA if memory is the limit, then measure quality on my own examples before anyone relies on the result.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: a frozen base model at 4 bits, with LoRA adapters trained on top.
  • What the 4 bits buy: far less memory, so a 65B model can fit on one 48 GB GPU.
  • Only the adapters learn, and only they are saved.
  • The three memory ideas: NF4, double quantization, paged optimizers.
  • The honest catch: quality and stability need checking on your own tasks.
  • How you would decide: start from the memory you have, then measure.

Common traps

  • Trap"QLoRA trains the whole model in 4 bits."

    BetterNo. The base is frozen at 4 bits, and the adapters are the only part that learns.

  • Trap"4-bit means the model loses quality, so never use it."

    BetterThe paper reports full 16-bit task performance on its tests. The real risk is stability, so measure on your own tasks.

  • Trap"QLoRA is just a smaller LoRA."

    BetterThe difference is how the frozen base is stored: QLoRA stores it at 4 bits.

Can you spot the wrong plan?

Spot the wrong plan

Your team's plan says: "Load the 65B model at 16 bits, then add LoRA adapters, all on one 48GB GPU." Which part breaks?

Quick check

Which change makes a 65B tune fit one 48GB GPU?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q284What is LoRA?10 min
  2. Q283What is PEFT?11 min
  3. Q286What does LoRA rank mean?10 min
  4. Q282What is full fine-tuning?10 min
  5. Q281Fine-tune vs RAG vs prompting: when to use which?10 min
  6. Q287What is SFT / instruction tuning?11 min

Last updated on 26 November 2026

Tuning a model on your own data?

I design and build AI products and agents, the interface and the system behind them. Book a short call and tell me what hardware, data and results you have.