
"Give me a lever long enough and a fulcrum on which to place it, and I shall move the world."
Finetune, Gradient-Loving AI Agent
Part Overview
Part IV is the heart of the book for practitioners who want to customize LLMs. You will learn to generate synthetic training data, fine-tune models (full and parameter-efficient), distill large models into smaller ones, merge model weights, and align models with human preferences via RLHF, DPO, Constitutional AI, and RLVR. This is the most technically dense part of the book; take your time with the labs.
Chapters: 5 (Chapters 15 through 19). Builds on API and prompting skills from Part III and supplies the trained models used in Part V and beyond. The part closes with a Tools of the Trade chapter on the transformers / trl / peft / axolotl / lit-gpt training stack.
Off-the-shelf models only get you so far. Part IV teaches you to bend LLMs to your needs through synthetic data, fine-tuning, distillation, and alignment, turning general-purpose models into specialized tools you can trust.
- 17.1 LoRA & QLoRA
- 17.2 Advanced PEFT Methods
- 17.3 Training Platforms & Tools
- 17.3a Training Tool Comparison, Cloud Compute & Recommended Workflows
- 17.4 Soft Prompts: Prompt Tuning, Prefix Tuning, and P-Tuning
- 17.5 Knowledge Distillation for LLMs
- 17.6 Model Merging & Composition
- 17.7 Continual Learning & Domain Adaptation
What's Next?
This part begins with Chapter 15: Synthetic Data Generation & LLM Simulation. Each chapter builds on the previous one, so we recommend reading Part IV in order.