Concepts / Parameter-Efficient Finetuning in Practice

Parameter-Efficient Finetuning in Practice

Finetuning updates a pre-trained model's weights so the model adapts to a specific task or dataset.

  • Programming

Why Finetuning Looks Routine

Many people who first hear about finetuning come away with a tidy picture: take a model that has already learned a great deal, run some additional training on a task you care about, and the model is now customized. Because the training step is often described as a single command, it is easy to assume the whole job is routine. This article tests that assumption. The goal is to build a clear picture of what finetuning is, why it became harder as models grew, and why the difficulty is not located where many beginners expect.

What do you think happens?

When you finetune a model for your own task, where do you expect the real effort to go?

  • Writing and running the training command

  • Choosing the right training hyperparameters

  • Preparing the surrounding data, its formatting, and the evaluation around the training loop

Reveal answer
Answer:

The real effort often goes into the surrounding context and data: curating the dataset, formatting it, and evaluating the result. The training procedure itself is often the easier part.

The source states that the hardest part of finetuning is often the surrounding context and data rather than the training procedure. Keep this prediction in mind, because the last section of this article returns to it.

What Finetuning Changes in a Pre-Trained Model

Definition

Finetuning updates a pre-trained model's weights so the model adapts to a specific task or dataset.

A pre-trained model starts from a general state. It has already learned a great deal from earlier training, and its weights encode that knowledge. Finetuning does not build a model from nothing. Instead, it nudges those existing weights so the model's behavior shifts toward the particular task or dataset a practitioner cares about. This is why finetuning is a form of adaptation: the model is adjusted from a general starting point toward a specific target.

The idea of reusing knowledge from one training effort in another is older than the modern vocabulary. Transfer learning is the older name for the general strategy of carrying what a model learned in one setting into a related one. Finetuning is one of the practical forms that strategy takes. Its purpose is to shift a general model toward the particular behavior a practitioner needs, rather than to construct a new model from scratch.

In its early days, finetuning looked a lot like pre-training. Both involved updating the model's entire set of weights. That approach worked when models were smaller, but as models grew, updating every weight became impractical for most practitioners. The rest of this article follows that problem and the responses to it.

Why Updating Every Weight Stops Scaling

The core relationship is simple: the more parameters you update during finetuning, the more memory the finetuning process requires. Full finetuning updates every weight, so its memory demand grows with the size of the model. The diagram below shows the main things that full finetuning keeps in memory at the same time: the weights themselves, the gradients computed during training, and the optimizer states. Each added parameter adds to all three, which is why the total footprint multiplies as models grow.

Model weightsevery parameter is updatedTotal memory held atoncegrows with trainableparametersGradientscomputed for each trainablevalueOptimizer statesextra values kept duringtrainingadds toadds toadds to
What does GPU memory hold during full finetuning, and why does each added parameter multiply the footprint?

Memory is only part of the constraint. Most practitioners do not have access to enough hardware, time, and data to perform full finetuning on foundation models. These three limits interact. A setup that could fit the memory might still be too slow to be practical, and a setup with enough compute might still lack the data needed to make the result useful. Any response to the memory problem therefore has to be judged against all three limits, not memory alone.

Two Responses to Memory Pressure

Two families of techniques respond directly to the memory problem. They approach it from different angles, and it helps to keep those angles separate before looking at any detail. One family reduces how many values are trained. The other reduces how many bits each stored value uses. The subsections below take them one at a time.

LoRA and the Low-Rank Idea

The source zooms into LoRA, which stands for Low-Rank Adaptation. LoRA is a technique used for finetuning that is both parameter-efficient and data-efficient. It is also modular, which makes it much easier to serve and to combine multiple LoRA models. Low-rank factorization is the underlying idea the source names as the basis for this family of methods, and it is one reason LoRA appears throughout the finetuning literature.

At a high level, the update to a frozen weight matrix is represented as the product of two small low-rank matrices. The frozen matrix is left alone. The two small matrices are multiplied together to form an update, and that update is added to the frozen weights. Only the two small matrices are trained, so the number of trainable values is much smaller than the number in the full weight matrix. The diagram below shows how these pieces relate.

Frozen weightmatrixnot trainedSmall matrix AtrainedWeight updateproduct of A and BAdapted weightsfrozen weights plus updateSmall matrix Btrainedmultiplied togetherformskept as baseadded to
How do the two small matrices combine with the frozen weight matrix, and why does this shrink the number of trainable values?
Worked example

Counting trainable values for one weight matrix

Suppose a frozen weight matrix has 1000 rows and 1000 columns. Compare the number of values a full update would train with the number a low-rank update of rank 8 would train. This scenario is illustrative and is not taken from the source.

  1. 1
    Full update

    Updating every entry of a 1000 by 1000 matrix trains 1,000,000 values.

  2. 2
    Matrix A

    A low-rank matrix A with 1000 rows and rank 8 has 8 columns, so it holds 1000 times 8, which is 8,000 values.

  3. 3
    Matrix B

    A matrix B with rank 8 rows and 1000 columns holds 8 times 1000, which is 8,000 values.

  4. 4
    Low-rank total

    Only A and B are trained, so the total is 8,000 plus 8,000, which is 16,000 values.

  5. 5
    Comparison

    16,000 is about 1.6 percent of 1,000,000, so the trainable count is far smaller while the frozen matrix stays untouched.

Result

The low-rank update trains roughly 1.6 percent as many values as a full update of the same matrix. This is the mechanism behind LoRA's parameter efficiency.

Combining Finetuned Models Through Merging

The idea of combining finetuned models leads to model merging. Its goal is to combine multiple models into one model that works better than the individual models do separately. The source lists several use cases, including on-device deployment and model upscaling, and it also covers general approaches to merging. Merging responds to the same pressure from a different direction: rather than making each finetuning run cheaper, it aims to get more value out of the finetuned models that already exist.

The Surrounding Work Around Training

Returning to the prediction from the opening: the training loop is only one stage in a finetuning project. Data has to be curated, formatted into the form the training procedure expects, and then evaluated to check whether the adapted model does what the task needs. The diagram below lays these stages out in order.

Curate datasetchoose data for the taskFormat examplesshape data for trainingFinetune modelthe training procedureEvaluate resultscheck the adapted modelAdapted modelthe final resultfeedsfeedsfeedsproduces
What steps surround the training procedure itself, and in what order do data and evaluation feed into the final adapted model?

The source's own framing points the same way. The hardest part of finetuning is often located in the surrounding context and data rather than in the training procedure. A well-run training step on poorly chosen or badly formatted data can still produce a model that does not serve the task, so the earlier stages carry much of the weight of the outcome.

Deciding Whether to Finetune at All

The source frames a practical question many practitioners face: whether to finetune a model at all. The chapter it comes from begins with the reasons for finetuning and the reasons for not finetuning. It also discusses when to finetune versus when to use retrieval-augmented generation, often called RAG. Treating finetuning as one option among several, rather than as the default, is part of working with it well.

In the real world

Consider a team that wants a model to answer questions about its own internal documents. Before choosing finetuning, the team would weigh the cost of curating and formatting training data, the memory and time limits discussed earlier, and whether retrieving relevant documents at answer time would meet the need. This scenario is illustrative and is not a case from the source; it shows how the ideas above combine in a single decision.

Mistakes Beginners Make With Finetuning

  • Common mistake

    Assuming the training command is the whole job

    Why it fails

    The source says the hardest part is often the surrounding context and data, so the training step is usually a small share of the effort.

    Do this instead

    Plan time for dataset curation, formatting, and evaluation before and after training.

  • Common mistake

    Treating memory as the only constraint

    Why it fails

    Hardware, time, and data interact. A setup that fits in memory may still be too slow or lack the data needed for a useful result.

    Do this instead

    Check all three limits together before deciding on an approach.

  • Common mistake

    Confusing PEFT with quantized training

    Why it fails

    PEFT reduces the number of trainable parameters, while quantized training reduces the number of bits used for each value. They attack different factors.

    Do this instead

    Name which factor a technique reduces before comparing it with another.

  • Common mistake

    Assuming finetuning is always the right first step

    Why it fails

    The source explicitly discusses when to finetune versus when to use RAG, so finetuning is one option among several.

    Do this instead

    Weigh finetuning against alternatives such as RAG for the specific task.

Checking Your Understanding of the Pressure Chain

MEDIUM

Without looking back, trace the chain of reasoning in this article in your own words. Start with why full finetuning became impractical, name one response that reduces trainable values and one that reduces bits per value, and finish by explaining why the surrounding data work still matters even after a efficient technique is chosen.

Hints
  • Start from the rule that more updated parameters means more memory.
  • Recall that PEFT freezes the base weights and quantized training lowers precision.
  • Think about what the adapted model depends on besides the training step.

Key Takeaways

  • Finetuning updates a pre-trained model's weights so it adapts to a specific task or dataset, building on knowledge the model already has rather than starting from nothing.
  • Full finetuning became impractical as models grew because the more parameters you update, the more memory the process needs, and hardware, time, and data limits interact with that memory constraint.
  • PEFT reduces trainable parameters by freezing base weights, quantized training reduces bits per value, LoRA represents updates as products of small low-rank matrices, and model merging combines finetuned models into one.
  • The hardest part of finetuning is often the surrounding context and data, including dataset curation, formatting, and evaluation, rather than the training procedure itself.

Related concepts

More concepts starting with P