liveBook · Manning

Parameter-efficient fine-tuning

As explained in Domain-Specific Small Language Models

A family of fine-tuning methods that adapt a pretrained model using only a small subset of parameters or added modules to reduce compute and cost.

Parameter-efficient fine-tuning (PEFT) adapts a pretrained model by updating only a small fraction of its parameters or adding trainable modules. It reduces compute and cost while often preserving accuracy and robustness, making domain adaptation more practical than full fine-tuning. section 2.4 section 2.3

Common PEFT approaches include:

  • LoRA freezes pretrained weights and trains low-rank updates for selected weight matrices. section 2.4
  • Prefix tuning and prompt tuning optimize continuous task-specific vectors or prompt embeddings while keeping the model frozen. section 2.4
  • AdaLoRA reallocates its parameter budget according to importance scores, while LoftQ combines quantization with low-rank initialization. section 2.4
Figure 2.3 The LoRA fine-tuning process

Use the process diagram to see how LoRA preserves pretrained weights while training a smaller adaptation component. section 2.4

LoRA domain adaptation

A practical workflow loads FLAN-T5-small in 8-bit mode, prepares it for k-bit training, targets the q and v modules with a LoRA configuration, trains on the SAMSum dialogue-summarization dataset, saves the adapter, and reloads it for generation. section 2.4

How Domain-Specific Small Language Models covers it

How deep it goes
Explains the PEFT family, compares major methods, and works through LoRA training, saving, reloading, and inference.
Examples
Uses FLAN-T5-small, the SAMSum dataset, 8-bit loading, selected q and v modules, adapter checkpoints, and generated summaries.
What it assumes
Assumes a pretrained model and task-specific data while demonstrating tokenization, preprocessing, quantization preparation, and trainer configuration.
What you can do after
Apply via Hugging Face Transformers and PEFT to train, save, reload, and evaluate a LoRA adapter.
How it connects
Contrasts with full fine-tuning and RAG, and connects LoRA with quantization, prompt tuning, prefix tuning, and vector databases.

Also explained in

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

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.