AIF-C01 notes
Optimizing foundation models

Fine-Tuning

Fine-tuning tailors a general FM to a specific task or domain. It helps to:

  • Increase specificity for domain nuances
  • Improve accuracy on specialized tasks
  • Reduce biases from the original training data
  • Boost efficiency within a specific context

Fine-tuning approaches

ApproachWhat it doesGood for
Instruction tuningRetrains on prompts paired with desired outputsFollowing commands: chatbots, virtual assistants
RLHFSupervised training first, then reinforcement learning with a reward model built from human feedbackAligning output with human values and preferences
Domain adaptationTrains on an industry corpus, such as legal documents or medical recordsRelevance and accuracy in one domain
Transfer learningReuses a model trained for one task as the starting point for anotherEfficiency with less additional training
Continuous pretrainingKeeps feeding the model new dataStaying current with new vocabulary, trends, and research

Metrics such as ROUGE and BLEU and techniques such as model pruning are not fine-tuning methods.

Pre-training data versus fine-tuning data

Pre-trainingFine-tuning
Massive, diverse, broad coverageFocused on the task
Built to generalizeHighly relevant to the desired outputs
QuantityQuality over quantity: small, well-curated sets can go a long way

Key steps to prepare fine-tuning data

  1. Data curation: rigorous selection of only relevant data
  2. Labeling: accurate, relevant labels are paramount because they drive specialization in the target domain
  3. Governance and compliance with industry regulations
  4. Representativeness and bias checking
  5. Feedback integration: user or expert feedback, especially for RLHF

On this page