Fine-Tuning Language Models
When, Why and How to Adapt a Model to Your Task
- Pages
- 81
- Chapters
- 63
- Level
- Intermediate–Advanced
- Format
- E-book
About this book
Fine-tuning is powerful and often unnecessary. This book helps you decide when it is the right tool, and then do it well.
It starts with the alternatives (better prompts, examples and retrieval) and a clear decision framework. It then covers preparing training data, supervised fine-tuning, parameter-efficient methods such as LoRA, quantised training, preference tuning, and distillation into smaller models. Chapters on evaluation, avoiding regressions and catastrophic forgetting, cost estimation and deployment complete the picture.
Examples are framework-neutral and focus on decisions you will face in real projects.
What you will learn
- When fine-tuning beats prompting and retrieval, and when it does not
- Preparing high-quality training data
- Supervised fine-tuning and its key settings
- LoRA and other parameter-efficient methods
- Preference tuning and distillation
- Evaluating, deploying and maintaining tuned models
Table of contents
- IntroductionIntroduction
- Chapter 1What Fine-Tuning Is
- Chapter 2What Fine-Tuning Is Good At
- Chapter 3What Fine-Tuning Is Bad At
- Chapter 4The Alternatives
- Chapter 5A Decision Framework
- Chapter 6Base Models and Instruction Models
- Chapter 7Choosing a Model Size
- Chapter 8Hosted Versus Self-Managed Fine-Tuning
- Chapter 9Licences
- Chapter 10What Training Examples Look Like
- Chapter 11How Many Examples?
- Chapter 12Sources of Examples
- Chapter 13Writing Good Examples
- Chapter 14Covering Edge Cases
- Chapter 15Cleaning the Dataset
- Chapter 16Label Agreement
- Chapter 17Train, Validation and Test Splits
- Chapter 18Balancing the Data
- Chapter 19Synthetic Data, Carefully
- Chapter 20Data Documentation
- Chapter 21Supervised Fine-Tuning
- Chapter 22Key Training Settings
- Chapter 23Overfitting and Memorisation
- Chapter 24Catastrophic Forgetting
- Chapter 25Parameter-Efficient Fine-Tuning
- Chapter 26LoRA, Worked Through
- Chapter 27Quantised Fine-Tuning
- Chapter 28Memory Budgets
- Chapter 29Preference Tuning
- Chapter 30Direct Preference Optimisation
- Chapter 31Collecting Preference Data
- Chapter 32Distillation
- Chapter 33Continued Pre-Training
- Chapter 34Evaluation Before Training
- Chapter 35Task Metrics
- Chapter 36Regression Testing
- Chapter 37Safety After Fine-Tuning
- Chapter 38Bias and Fairness
- Chapter 39Privacy
- Chapter 40Estimating Costs
- Chapter 41Serving Fine-Tuned Models
- Chapter 42Monitoring in Production
- Chapter 43Updating and Retraining
- Chapter 44Migrating to New Base Models
- Chapter 45Combining Fine-Tuning With Retrieval
- Chapter 46Governance
- Chapter 47How Fine-Tuning Changes a Model, Intuitively
- Chapter 48Choosing What to Put in the System Prompt
- Chapter 49Evaluating With Model Judges
- Chapter 50Small Models, Big Wins
- Chapter 51Formats, Templates and Tokens
- Chapter 52Multi-Turn and Tool-Use Fine-Tuning
- Chapter 53Multilingual Fine-Tuning
- Chapter 54Fine-Tuning Embedding Models
- Chapter 55Experiment Tracking and Reproducibility
- Chapter 56Security of the Fine-Tuning Pipeline
- Chapter 57Worked Example: A Ticket Classifier
- Chapter 58Worked Example: House Style
- Chapter 59Worked Example: When Fine-Tuning Failed
- Chapter 60Common Mistakes
- Chapter 61Team and Roles
- Chapter 62A Project Plan
- Chapter 63A Checklist
- AppendixExercises
- GlossaryGlossary
Who this book is for
ML engineers and technical leads with experience using language models who are considering custom training.
Details
| Format | PDF + web edition |
|---|---|
| Length | 81 pages (approx.) |
| Chapters | 63 |
| Level | Intermediate to Advanced |
| Language | English |
| Topic | AI Engineering |
| Author | Latent Library Editorial |
Keep reading