liveBook · Manning

Parameter-efficient fine-tuning

As explained in LLM Customization and Fine-Tuning

Adapting a pretrained model by updating only a small number of added or selected parameters rather than all its weights.

When prompting has plateaued, adapting a model’s behavior may be more useful than adding more instructions. Parameter-efficient fine-tuning (PEFT) does this by training a small set of task-specific parameters instead of updating every model weight. Typically, 0.1% to 5% of parameters are trained, although that can still mean millions of parameters. section 4.9 section 5.0

PEFT methods include additive approaches, which introduce trainable components, and selective approaches, which train a subset of existing parameters. LoRA is a common additive approach: it inserts small, trainable low-rank matrices alongside frozen weights. The resulting adapter is combined with the base model at inference and can be swapped for another task’s adapter. section 5.0 section 5.2

Figure 5.2 LoRA leaves the pretrained base model frozen and trains only a small adapter added on top, typically about 1% of the parameters, then combines the two at inference to produce the adapted model.

The diagram shows how a trained LoRA adapter combines with a frozen base model at inference. section 5.0

Choose the adaptation approach against the actual constraint:

  • Use retrieval-augmented generation (RAG) when knowledge changes frequently or answers need verifiable citations. Retrieval quality limits what the model can use; RAG can also be combined with a LoRA-adapted model. section 1.6.2 section 5.13
  • Start with LoRA for behavior adaptation when prompting is insufficient. It typically approaches full fine-tuning quality for suitable tasks while training a small fraction of the parameters. section 1.6.2 section 5.13
  • Consider QLoRA when GPU memory is the constraint. It combines LoRA with a 4-bit frozen base; in the cited 4B-model setup, training memory falls from 8–12 GB to 4–6 GB. section 1.6.2 section 5.0
  • Consider full fine-tuning when evaluation shows LoRA’s capacity ceiling limits performance. Updating every parameter offers more expressiveness but requires more compute, training time, and monitoring. section 5.13 section 1.6.2

Clinical-note adaptation

In a two-hospital study, Qwen3 models were adapted with LoRA at rank 16 to detect perioperative complications in clinical notes. On the second hospital’s cases, the 4B model’s F1 rose from 0.28 to 0.64, compared with 0.69 for human experts. The models ran locally, keeping patient records within the hospital. section 5.2

Budget for data and evaluation, not just GPU time. One Qwen3-4B adapter trains about 33 million parameters—under 1% of the base model—and a cited run took about 11 minutes on a single 24 GB GPU. After tuning, check for safety regressions against known harmful prompts and include explicit refusal examples in training data. section 1.6.2 section 5.13

How LLM Customization and Fine-Tuning covers it

How deep it goes
Explains PEFT families and LoRA’s low-rank matrices, then addresses memory, safety checks, and selection tradeoffs.
Examples
Uses a Qwen3-4B adapter run and a two-hospital clinical-note study to illustrate cost and task performance.
What you can do after
Evaluate adaptation options using task performance, GPU memory, data work, and safety checks.
How it connects
Connects PEFT with prompting, retrieval-augmented generation, quantization, and full fine-tuning.

Also explained in

Compare how 8 books explain parameter-efficient fine-tuning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLM Customization and Fine-Tuning. The section links point to the parts of the book it draws on.