LLMs & Generative AI

Pretraining, Fine-Tuning & Instruction Tuning

Pretraining learns broad capability from massive data; fine-tuning specializes behavior; instruction tuning and preference optimization shape the model toward useful human-facing responses.
  • Pretraining creates general language capability
  • Fine-tuning changes weights for a narrower distribution
  • Instruction tuning teaches task-following
  • Preference optimization ranks outputs by human preference
  • RAG is often better than fine-tuning for changing knowledge
Which adaptation lever?
NeedUsually preferWhy
Add current/private factsRAGKnowledge stays inspectable and updateable
Enforce strict shapeStructured output + validationFormat can be checked in code
Teach stable style/domain behaviorFine-tuningExamples become behavior
Improve instruction-followingInstruction tuning / prompt designTask behavior becomes clearer
Improve subjective preferencePreference optimizationLearns ranking of outputs
Sources
  • Hugging Face LLM CourseFine-tuning a pretrained model; Fine-tune LLMs
  • Training Language Models to Follow Instructions with Human FeedbackInstruction following with human feedback
  • OpenAI API DocumentationFine-tuning guidance