Fine-Tuning Language Models in Practice
An Independent Engineer's Guide to Customizing Open-Weight and Hosted Models with SFT, LoRA, Preference Tuning and Evaluation
-
- $0.99
-
- $0.99
Publisher Description
A practical, independent guide to fine-tuning language models for engineers who need a model that does one job reliably and cheaply. Following one fictional insurance company that adapts an open-weight model to extract claim data, draft customer replies and call tools, the book starts with the decision: when prompting or retrieval is enough and when fine-tuning pays off. It then shows how to choose a base model and read its license and acceptable-use policy, design and label training data, use synthetic data within provider terms, clean data and remove personal information, and get chat templates and loss masking right. You will train with full fine-tuning, LoRA and QLoRA using PyTorch, Hugging Face Transformers, PEFT and TRL, estimate memory, compute and cost with worked numbers, and go beyond supervised fine-tuning with DPO and related preference methods, reinforcement learning with verifiable rewards and GRPO, and distillation. Later chapters cover distributed training, evaluation with task metrics, LLM judges and safety checks, forgetting, adapter merging, quantization and serving, hosted services, MLOps, model cards and responsible release. Includes a hands-on lab, checklists, study questions with answers and a glossary.
This book is an independent publication and is not authorized, sponsored or endorsed by any company whose products it mentions. All trademarks belong to their respective owners and are used only for identification. This book was drafted with generative AI tools and checked with automated tools. Tools, features and prices change often; confirm them in current documentation.