Course Objective & Scope
Supervised Fine-Tuning (SFT) is the workhorse of LLM adaptation, yet subtle implementation bugs—computing loss on user prompts, wasting GPU cycles on padding tokens, misconfiguring EOS tokens or pairing the wrong learning rate with effective batch size—silently degrade model quality. This course dives deep into the engineering mechanics of SFT.
Labs cover completion-only loss masking (-100 label masks), FlashAttention-2 with sequence packing, effective batch size and learning rate scaling laws, NEFTune noisy embeddings, and reproducible pipelines using Hugging Face TRL SFTTrainer and Axolotl. Participants build an optimised, reproducible SFT pipeline on an enterprise task.
Who Should Attend?
- AI and machine learning engineers building LLM training pipelines
- Data scientists looking to maximise SFT quality and GPU throughput
- MLOps/LLMOps engineers standardising training configurations
- Prerequisite: Python, PyTorch basics and familiarity with the Hugging Face ecosystem
Key Takeaways
- Mask prompt and system tokens so cross-entropy loss is computed strictly on assistant completions
- Eliminate padding waste and multiply training throughput with sequence packing and FlashAttention-2
- Tune learning rate, warmup ratio, scheduler and effective batch size for dataset scale
- Apply NEFTune, dropout and gradient clipping to prevent overfitting on small SFT datasets
- Debug training runs via gradient norms, token throughput and perplexity in Weights & Biases or MLflow
Curriculum
SFT Mechanics and Loss Masking
- Token-level cross-entropy loss and perplexity in causal language modelling
- Full-sequence loss versus completion-only masking (
labels = -100) - Isolating assistant turns in multi-turn chats and avoiding EOS token truncation bugs
Data Collators, Padding and Sequence Packing
- Dynamic padding, left-vs-right padding rules and length bucketing
- Contamination-free sequence packing with FlashAttention-2 position-ID resets
Hyperparameter Engineering and Regularisation
- Coupling effective batch size (
micro_batch * grad_accum * world_size) with learning rate - Cosine, linear and Warmup-Stable-Decay (WSD) schedules
- NEFTune noisy embeddings, weight decay and gradient clipping
Production Workflows with TRL SFTTrainer and Axolotl
- Programmatic TRL
SFTTrainer/SFTConfigversus declarative Axolotl YAML pipelines - Diagnosing gradient spikes, NaN losses and BF16/FP16 numerical instability
Workshop: End-to-End SFT Optimisation
- Benchmarking throughput and downstream accuracy before and after masking and packing
- Selecting the optimal checkpoint and generating a reproducible training report
Other Courses in This Category
-
Parameter-Efficient Fine-Tuning (PEFT): Architectures and Multi-Adapter Serving
Course on PEFT architectures—LoRA, DoRA, rsLoRA, VeRA, LoftQ, IA3 and Prefix Tuning—VRAM memory budgeting and serving dozens of dynamic adapters on a single base model with vLLM and SGLang.
- Live Course
- 5 modules
-
Practical LLM Fine-Tuning with LoRA and QLoRA
Hands-on training on Low-Rank Adaptation (LoRA) and 4-bit NormalFloat (NF4) QLoRA: rank/alpha tuning, target modules, double quantisation, paged optimizers and safe adapter merging.
- Live Course
- 5 modules
-
Instruction Tuning: Following Complex Instructions, Schemas and Domain Constraints
Course on designing and running instruction tuning so models reliably follow complex system prompts, strict JSON/schema constraints, corporate tone and refusal boundaries.
- Live Course
- 5 modules
-
Preference Optimization: DPO, ORPO, KTO and LLM Alignment
Advanced course on post-SFT alignment using DPO, IPO, KTO, ORPO and SimPO: building chosen/rejected preference datasets, tuning beta and KL constraints, and avoiding length bias and reward hacking.
- Live Course
- 5 modules
-
Synthetic Data Generation: Data Synthesis and Distillation for LLM Training
Hands-on course on generating high-diversity SFT and preference datasets in low-resource enterprise domains using teacher LLMs, Evol-Instruct, persona matrices, Distilabel and verification filters.
- Live Course
- 5 modules
-
Training Data Design: Dataset Architecture for LLM Fine-Tuning
Hands-on course on designing high-leverage SFT and multi-turn conversation datasets: the LIMA principle, task mixture ratios, expert annotation guidelines, schema design and dataset versioning.
- Live Course
- 5 modules
Get in touch