Model Online / On-Site
Duration
Modules 5 modules

Course Objective & Scope

LoRA and QLoRA are the industry standard for fine-tuning 7B-to-70B open-weight models on a single enterprise GPU. Yet choosing arbitrary rank/alpha ratios, targeting only attention layers or naively merging a LoRA adapter into a 4-bit quantised base model can silently ruin downstream quality.

This hands-on course covers low-rank matrix decomposition ($\Delta W = B A$), 4-bit NormalFloat (nf4) quantisation, double quantisation, paged AdamW optimizers, Unsloth custom triton kernels and lossless merging back into 16-bit base weights. Participants fine-tune and benchmark an 8B–32B model using QLoRA on a real task.

Who Should Attend?

  • AI engineers fine-tuning large language models on single or constrained GPU setups
  • Data scientists who want principled control over LoRA and QLoRA hyperparameters
  • ML engineers preparing trained adapters for production inference engines
  • Prerequisite: Python, PyTorch basics and familiarity with Hugging Face

Key Takeaways

  • Select LoRA rank r, lora_alpha, lora_dropout and target modules for any task
  • Configure QLoRA with NF4 quantisation, double quantisation and BF16 compute dtypes
  • Prevent out-of-memory (OOM) spikes using paged optimizers and gradient checkpointing
  • Merge QLoRA adapters cleanly into 16-bit base weights without double-quantisation degradation
  • Benchmark 16-bit LoRA against 4-bit QLoRA across VRAM usage, training speed and task accuracy

Curriculum

LoRA Mechanics and Hyperparameter Selection
  • The intrinsic rank hypothesis, Gaussian/zero initialisation of $A$ and $B$, and $\alpha / r$ scaling
  • Why targeting all linear layers (Attention + MLP projections) beats q_proj, v_proj alone
  • How rank selection (r=8, 16, 32, 64, 128) affects capacity and overfitting
QLoRA: 4-Bit NormalFloat and Paged Optimizers
  • Information-theoretically optimal 4-bit NormalFloat (nf4) and block-wise quantisation
  • Double Quantization: quantising the quantisation constants to save additional VRAM
  • Preventing sequence-length OOM spikes with Paged AdamW (8-bit and 32-bit) optimizers
Speed and Memory Optimisation (bitsandbytes & Unsloth)
  • Setting bnb_4bit_compute_dtype=torch.bfloat16 and on-the-fly dequantisation during forward/backward passes
  • Cutting VRAM by 50%+ with Unsloth Triton kernels and smart gradient checkpointing
Adapter Merging and Quantisation Pitfalls
  • The common anti-pattern: why calling merge_and_unload() directly on a 4-bit model degrades quality
  • The right pipeline: merging into a clean FP16/BF16 base checkpoint before downstream AWQ/GGUF export
Workshop: Single-GPU QLoRA Training and Benchmarking
  • Running ablation experiments across rank sizes and target module sets
  • Comparing 16-bit LoRA and 4-bit QLoRA on task accuracy, throughput and peak VRAM

Other Courses in This Category

  • 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.

    LLM Customisation & Model Adaptation Corporate
    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.

    LLM Customisation & Model Adaptation Corporate
    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.

    LLM Customisation & Model Adaptation Corporate
    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.

    LLM Customisation & Model Adaptation Corporate
    Live Course
    5 modules
  • Model Evaluation and Fine-Tuning Evals for Custom LLMs

    Course on evaluating fine-tuned LLMs for task accuracy, catastrophic forgetting regressions, hallucination and safety drift using lm-evaluation-harness, custom task suites and pairwise arena comparisons.

    LLM Customisation & Model Adaptation Corporate
    Live Course
    5 modules
  • Open-Weight Model Adaptation: Customising Llama, Qwen, Mistral and Gemma

    Course on adapting open-weight models—Llama, Qwen, Mistral, Gemma and DeepSeek—for enterprise use: architectural differences, custom tokens, post-training quantisation (AWQ/GGUF/FP8) and self-hosted serving.

    LLM Customisation & Model Adaptation Corporate
    Live Course
    5 modules

Get in touch