Skip to content
Instant download · PDF + web edition · Free sample of every book · 30-day refund promise
Latent Library Browse books
AI Engineering

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

  1. IntroductionIntroduction
  2. Chapter 1What Fine-Tuning Is
  3. Chapter 2What Fine-Tuning Is Good At
  4. Chapter 3What Fine-Tuning Is Bad At
  5. Chapter 4The Alternatives
  6. Chapter 5A Decision Framework
  7. Chapter 6Base Models and Instruction Models
  8. Chapter 7Choosing a Model Size
  9. Chapter 8Hosted Versus Self-Managed Fine-Tuning
  10. Chapter 9Licences
  11. Chapter 10What Training Examples Look Like
  12. Chapter 11How Many Examples?
  13. Chapter 12Sources of Examples
  14. Chapter 13Writing Good Examples
  15. Chapter 14Covering Edge Cases
  16. Chapter 15Cleaning the Dataset
  17. Chapter 16Label Agreement
  18. Chapter 17Train, Validation and Test Splits
  19. Chapter 18Balancing the Data
  20. Chapter 19Synthetic Data, Carefully
  21. Chapter 20Data Documentation
  22. Chapter 21Supervised Fine-Tuning
  23. Chapter 22Key Training Settings
  24. Chapter 23Overfitting and Memorisation
  25. Chapter 24Catastrophic Forgetting
  26. Chapter 25Parameter-Efficient Fine-Tuning
  27. Chapter 26LoRA, Worked Through
  28. Chapter 27Quantised Fine-Tuning
  29. Chapter 28Memory Budgets
  30. Chapter 29Preference Tuning
  31. Chapter 30Direct Preference Optimisation
  32. Chapter 31Collecting Preference Data
  33. Chapter 32Distillation
  34. Chapter 33Continued Pre-Training
  35. Chapter 34Evaluation Before Training
  36. Chapter 35Task Metrics
  37. Chapter 36Regression Testing
  38. Chapter 37Safety After Fine-Tuning
  39. Chapter 38Bias and Fairness
  40. Chapter 39Privacy
  41. Chapter 40Estimating Costs
  42. Chapter 41Serving Fine-Tuned Models
  43. Chapter 42Monitoring in Production
  44. Chapter 43Updating and Retraining
  45. Chapter 44Migrating to New Base Models
  46. Chapter 45Combining Fine-Tuning With Retrieval
  47. Chapter 46Governance
  48. Chapter 47How Fine-Tuning Changes a Model, Intuitively
  49. Chapter 48Choosing What to Put in the System Prompt
  50. Chapter 49Evaluating With Model Judges
  51. Chapter 50Small Models, Big Wins
  52. Chapter 51Formats, Templates and Tokens
  53. Chapter 52Multi-Turn and Tool-Use Fine-Tuning
  54. Chapter 53Multilingual Fine-Tuning
  55. Chapter 54Fine-Tuning Embedding Models
  56. Chapter 55Experiment Tracking and Reproducibility
  57. Chapter 56Security of the Fine-Tuning Pipeline
  58. Chapter 57Worked Example: A Ticket Classifier
  59. Chapter 58Worked Example: House Style
  60. Chapter 59Worked Example: When Fine-Tuning Failed
  61. Chapter 60Common Mistakes
  62. Chapter 61Team and Roles
  63. Chapter 62A Project Plan
  64. Chapter 63A Checklist
  65. AppendixExercises
  66. GlossaryGlossary

Who this book is for

ML engineers and technical leads with experience using language models who are considering custom training.

Details

FormatPDF + web edition
Length81 pages (approx.)
Chapters63
LevelIntermediate to Advanced
LanguageEnglish
TopicAI Engineering
AuthorLatent Library Editorial

Keep reading

You may also like

All books
$14.99
Details