Skip to content

Fine-Tuning

Training a pre-trained model on specific data for narrow tasks: company style, response format, jargon.

Why is it needed

A pre-trained model is trained on 'the whole internet', but it doesn't know your specific tasks. Fine-tuning adjusts it to the specifics.

What changes and what stays the same

Changes Does not change
Style and tone Exact facts
Output format Knowledge of new dates
Behavior in dialogue The model does not 'remember' documents

For working with facts, use RAG instead of fine-tuning.

Full fine-tuning vs efficient

Full fine-tuning changes all billions of weights — server GPUs are needed. Efficient methods change a small portion of parameters:

  • LoRA — low-rank matrices;
  • QLoRA — LoRA over a quantized model;
  • PEFT — a general family of methods.

Types of fine-tuning

  • SFT — on pairs 'query → response';
  • RLHF — on human evaluations;
  • DPO — on pairs 'better/worse'.

See also

← All terms