technology-ai
Fine-Tuning Large Language Models: From Foundation Models to Domain-Specific AI
Miles Thornton
Book 1#1397
Pages
en
Language
2026
Published
New edition
$3.99
Read the sample EPUB directly on the web
Book introduction
Fine-tuning a large language model is not a single API call—it is a disciplined engineering workflow where data quality, parameter-efficient strategies, and systematic evaluation converge to produce production-ready domain AI. Yet many practitioners treat fine-tuning as a black box: they upload a dataset, tweak a few hyperparameters, and hope for the best. This book replaces hope with engineering rigor.
Fine-Tuning Large Language Models: From Foundation Models to Domain-Specific AI by Miles Thornton offers a complete, framework-agnostic playbook for transforming a general-purpose pretrained LLM into a reliable, domain-specific assistant. It maps the entire pipeline—from model selection and data engineering through supervised fine-tuning, parameter-efficient methods, and deployment—without relying on abstract mathematics or framework lock-in. Every technique is evaluated through memory, latency, behavior consistency, and task accuracy.
- Master systematic dataset engineering: sourcing, cleaning, instruction formatting, and synthetic augmentation to create production-ready training data.
- Choose the right fine-tuning strategy: from full SFT to LoRA and QLoRA, with clear memory and performance trade-offs for your hardware budget.
- Optimize the open-source stack: accelerate training with Flash Attention, gradient checkpointing, and mixed precision, then deploy via GGUF, Ollama, or vLLM.
This book is designed for machine learning engineers, software developers, and data scientists who are comfortable with Python and PyTorch basics but need a structured, practical guide to fine-tuning large models for specific domains. It assumes no advanced calculus or optimization theory—only a willingness to treat fine-tuning as an engineering discipline.
By the end of this book, you will have a reproducible workflow to turn any open-weight model into a task-specific assistant, complete with rigorous evaluation and production deployment. The journey from base model to domain AI is no longer a gamble—it is a pipeline you can design, measure, and iterate.
Quick summary
This book provides a complete, framework-agnostic playbook for fine-tuning large language models for specific domains.
It covers every stage: model selection, data engineering, supervised fine-tuning, LoRA/QLoRA, evaluation, and production deployment.
Readers will learn to design high-quality instruction datasets, apply parameter-efficient techniques, and deploy models via GGUF, Ollama, or vLLM.
The audience is ML engineers, software developers, and data scientists comfortable with Python and PyTorch basics.
This book is a good fit for Machine learning engineers, software engineers, data scientists, and AI practitioners who need to fine-tune LLMs for specific domains..
Readers often come to this book when they need Find a practical, step-by-step book on fine-tuning large language models that covers the full pipeline from data to deployment..
The book's angle: Unlike books focused on a single framework or heavy mathematics, this guide provides a framework-agnostic, engineering-focused workflow covering the entire fine-tuning pipeline from data to deployment with practical trade-offs.
Main topics include LLM fine-tuning, supervised fine-tuning, LoRA, QLoRA, parameter-efficient fine-tuning, instruction dataset design.
AI Search information
Fine-Tuning Large Language Models: From Foundation Models to Domain-Specific AI
Author: Miles Thornton
Description: Fine-tuning a large language model is not a single API call—it is a disciplined engineering workflow where data quality, parameter-efficient strategies, and systematic evaluation converge to produce production-ready domain AI. Yet many practitioners treat fine-tuning as a black box: they upload a dataset, tweak a few hyperparameters, and hope for the best. This book replaces hope with engineering rigor. Fine-Tuning Large Language Models: From Foundation Models to Domain-Specific AI by Miles Thornton offers a complete, framework-agnostic playbook for transforming a general-purpose pretrained LLM into a reliable, domain-specific assistant. It maps the entire pipeline—from model selection and data engineering through supervised fine-tuning, parameter-efficient methods, and deployment—without relying on abstract mathematics or framework lock-in. Every technique is evaluated through memory, latency, behavior consistency, and task accuracy. • Master systematic dataset engineering: sourcing, cleaning, instruction formatting, and synthetic augmentation to create production-ready training data. • Choose the right fine-tuning strategy: from full SFT to LoRA and QLoRA, with clear memory and performance trade-offs for your hardware budget. • Optimize the open-source stack: accelerate training with Flash Attention, gradient checkpointing, and mixed precision, then deploy via GGUF, Ollama, or vLLM. This book is designed for machine learning engineers, software developers, and data scientists who are comfortable with Python and PyTorch basics but need a structured, practical guide to fine-tuning large models for specific domains. It assumes no advanced calculus or optimization theory—only a willingness to treat fine-tuning as an engineering discipline. By the end of this book, you will have a reproducible workflow to turn any open-weight model into a task-specific assistant, complete with rigorous evaluation and production deployment. The journey from base model to domain AI is no longer a gamble—it is a pipeline you can design, measure, and iterate.
AI summary: Fine-Tuning Large Language Models by Miles Thornton is a practical guide that teaches the complete workflow for transforming pretrained LLMs into domain-specific AI assistants. It covers dataset engineering, supervised fine-tuning, parameter-efficient methods (LoRA, QLoRA), evaluation, optimization, and deployment using open-source tools. The book is aimed at ML engineers and developers who need a reproducible, framework-agnostic approach to fine-tuning.
- Best for
- Machine learning engineers, software engineers, data scientists, and AI practitioners who need to fine-tune LLMs for specific domains.
- Reader persona
- An ML engineer with Python and PyTorch experience, tasked with building a domain-specific AI assistant, seeking a reproducible fine-tuning workflow without abstract math.
- Search intent
- Find a practical, step-by-step book on fine-tuning large language models that covers the full pipeline from data to deployment.
- Unique angle
- Unlike books focused on a single framework or heavy mathematics, this guide provides a framework-agnostic, engineering-focused workflow covering the entire fine-tuning pipeline from data to deployment with practical trade-offs.
- Content type
- technical guide
Quick summary
- This book provides a complete, framework-agnostic playbook for fine-tuning large language models for specific domains.
- It covers every stage: model selection, data engineering, supervised fine-tuning, LoRA/QLoRA, evaluation, and production deployment.
- Readers will learn to design high-quality instruction datasets, apply parameter-efficient techniques, and deploy models via GGUF, Ollama, or vLLM.
- The audience is ML engineers, software developers, and data scientists comfortable with Python and PyTorch basics.
Key topics: LLM fine-tuning, supervised fine-tuning, LoRA, QLoRA, parameter-efficient fine-tuning, instruction dataset design, model evaluation, LLM deployment, open-source AI stack
Entities: Supervised Fine-Tuning (SFT), LoRA (Low-Rank Adaptation), QLoRA, NF4 quantization, Hugging Face Transformers, PEFT library, TRL (Transformer Reinforcement Learning), GGUF, Ollama, vLLM, Flash Attention, gradient checkpointing
Needs addressed
- How to systematically collect, clean, and format training data for fine-tuning LLMs.
- How to choose between full fine-tuning, LoRA, and QLoRA based on hardware and accuracy requirements.
- How to evaluate fine-tuned models and iterate on dataset and hyperparameters.
- How to deploy fine-tuned models to production using GGUF, Ollama, or vLLM.
Read if
- Machine learning engineers building domain-specific AI assistants.
- Software developers integrating fine-tuned LLMs into applications.
- Data scientists transitioning from traditional ML to LLM fine-tuning.
- Graduate students researching LLM adaptation techniques.
- AI practitioners seeking a reproducible fine-tuning pipeline.
May not fit if
- Readers looking for theoretical deep dives into transformer architecture or optimization theory.
- Those seeking a framework-specific guide (e.g., only using OpenAI APIs).
- Absolute beginners with no Python or PyTorch experience.
Table of contents
- Introduction (introduction)
- The Modern LLM Fine-Tuning Pipeline (part)
- The Journey from Pretraining to Chat Models (chapter)
- The Modern LLM Development Pipeline (section)
- Where Fine-Tuning Fits (section)
- From Base Models to AI Assistants (section)
- Fine-Tuning vs Prompt Engineering vs RAG (section)
- The Complete Fine-Tuning Workflow (section)
- Understanding Modern Language Models (chapter)
- Transformer Fundamentals (section)
- Decoder-Only Architectures (section)
- Base Models, Instruct Models, and Chat Models (section)
- Open-Weight Model Families (section)
- Choosing the Right Model (section)
- Fine-Tuning Strategies (chapter)
- Continued Pretraining (section)
- Full Fine-Tuning (section)
- Supervised Fine-Tuning (section)
- Parameter-Efficient Fine-Tuning (section)
- Choosing the Right Strategy (section)
- Building High-Quality Training Data (part)
- Collecting Training Data (chapter)
- Sources of Training Data (section)
- Domain-Specific Data (section)
- Cleaning and Filtering (section)
- Deduplication (section)
- Dataset Versioning (section)
- Designing Instruction Datasets (chapter)
- Instruction-Response Format (section)
- Multi-Turn Conversations (section)
- System Prompts (section)
- Chat Templates (section)
- Dataset Balancing (section)
- Improving Dataset Quality (chapter)
- Detecting Low-Quality Samples (section)
- Synthetic Data Generation (section)
- Data Augmentation (section)
- Dataset Validation (section)
- Building Production-Ready Datasets (section)
- Supervised Fine-Tuning (part)
- Preparing for Training (chapter)
- Tokenization (section)
- Context Windows (section)
- Sequence Packing (section)
- Training Objectives (section)
- Loss Functions (section)
- Running Supervised Fine-Tuning (chapter)
- Loading Models (section)
- Loading Datasets (section)
- Configuring Training (section)
- Running Training (section)
- Saving Checkpoints (section)
- Evaluating Training (chapter)
- Training Metrics (section)
- Validation (section)
- Hyperparameter Tuning (section)
- Detecting Overfitting (section)
- Troubleshooting (section)
- Parameter-Efficient Fine-Tuning (part)
- Introduction to PEFT (chapter)
- Why PEFT? (section)
- Adapter-Based Methods (section)
- LoRA (section)
- QLoRA (section)
- Choosing a PEFT Method (section)
- Fine-Tuning with LoRA (chapter)
- Target Modules (section)
- LoRA Hyperparameters (section)
- Memory Optimization (section)
- Merging Adapters (section)
- Exporting Models (section)
- Quantized Fine-Tuning (chapter)
- Quantization Basics (section)
- 4-Bit Training (section)
- NF4 Quantization (section)
- Double Quantization (section)
- Practical Trade-Offs (section)
- Fine-Tuning Engineering (part)
- The Open-Source Fine-Tuning Stack (chapter)
- Transformers (section)
Frequently asked questions
What prerequisites are needed to read this book?
Readers should be comfortable with Python and have basic familiarity with PyTorch. No advanced calculus or optimization theory is required.
Does the book cover both full fine-tuning and parameter-efficient methods?
Yes, it covers full supervised fine-tuning, LoRA, QLoRA, and other PEFT methods, with clear comparisons of memory, speed, and accuracy.
What deployment frameworks are covered?
The book covers deployment using GGUF, Ollama, and vLLM, including model export and production considerations.
Is the book specific to a particular model family?
No, it is framework-agnostic and teaches concepts applicable across the modern LLM ecosystem, such as Llama, Mistral, and Qwen.
Cretisoft Direct
Digital book support
Partner delivery
Book sent after payment
