LLM Fine-Tuning with LoRA and QLoRA

Study LLM Fine-Tuning with LoRA and QLoRA with full lessons, revision notes and quick reference, across 29 lessons.

16 modules. 29 lessons. Self-paced.

Roles this course prepares you for

Course curriculum

No exam weights apply. Lessons follow practical prerequisites, from setup and measurement to LoRA, evaluation, quantisation, QLoRA, adapter use and responsible release.

Free to read: 5 lessons, no account needed

Start here (2 lessons)
  1. What fine-tuning changes, and how this course works (read now)

    • Describe what supervised fine-tuning, LoRA and QLoRA change in a model, in one sentence each.
    • Explain how the course measures success and why every run starts from a baseline.
  2. Set up and verify the course environment (read now)

    • Create the practice folder and environment, install the pinned libraries and download the course models at pinned revisions.
    • Verify versions, devices, the NF4 backend and every model's checksum, offline.
    • Recognise model files the course never loads.
Decide before you train (1 lessons)
  1. Decide when fine-tuning is the right tool (read now)

    • Compare prompting, few-shot examples, retrieval, ordinary code and fine-tuning for a described need.
    • Write a fine-tuning brief with a baseline, an acceptance metric, splits, a budget and a stopping rule.
How models learn from chat examples (2 lessons)
  1. Tokens, special tokens and chat templates (read now)

    • Tokenise text, decode token IDs and identify special tokens.
    • Apply a chat template with and without the generation prompt and explain any default system message.
  2. Next-token loss, loss masks and stop tokens (read now)

    • Explain next-token cross-entropy with label shifting and the ignore index.
    • Build a completion-only loss mask and match TRL's labels.
    • Diagnose a model that never stops or answers in the wrong format.

With course access: 24 lessons

Build and audit the data (2 lessons)
  1. Build a fine-tuning dataset

    • Write prompt-completion examples in the conversational format as JSON Lines.
    • Generate the course dataset with a seeded script and split it without overlap.
  2. Audit a dataset before training

    • Write an audit that finds schema errors, invalid completions, duplicates, split leakage, over-length examples, label imbalance and text resembling personal data.
Measure a baseline (1 lessons)
  1. Measure a baseline

    • Generate deterministically with the chat template and parse replies defensively.
    • Measure zero-shot and few-shot baselines and validation loss.
LoRA from first principles (2 lessons)
  1. Build a LoRA layer by hand

    • Explain the frozen weight plus a scaled low-rank update and why B starts at zero.
    • Implement a LoRA linear layer and match PEFT's output.
  2. Configure LoRA with PEFT

    • List a model's linear layers and choose target modules.
    • Predict trainable parameter counts and explain why optimiser memory falls.
Your first LoRA fine-tune (2 lessons)
  1. Train your first LoRA adapter

    • Run SFTTrainer with a LoraConfig on the CPU within the budget, explaining each setting.
    • Read the training log and say what it cannot tell you.
  2. Checkpoint, resume and save an adapter

    • Stop and resume a run so its loss curve continues.
    • Identify which saved files are needed to load an adapter, and which are pickle files to keep private.
Evaluate honestly (2 lessons)
  1. Evaluate on held-out data

    • Choose between runs on validation data and score the chosen adapter once on test.
    • Break results down by field and explain individual errors.
  2. Check regressions and run-to-run variation

    • Compare base and adapter behaviour on the probe set by stated properties.
    • Repeat a run with several seeds and judge differences against the spread.
Tune and diagnose (2 lessons)
  1. Tune LoRA settings from evidence

    • Run a small sweep within budget and justify one choice from validation evidence.
    • Explain rsLoRA and name DoRA as a variant.
  2. Diagnose failed training runs

    • Diagnose overfitting, under-training, divergence, a wrong mask, a template mismatch, the wrong device or dtype, and a falling loss with no task gain.
Memory and 4-bit quantisation (3 lessons)
  1. Where training memory goes

    • Estimate weights, gradients, optimiser states and activations for full fine-tuning, LoRA and QLoRA.
    • Measure footprint and peak memory and explain the gap.
  2. Quantise weights to 4 bits by hand

    • Quantise and restore a tensor with blockwise absmax scaling and the NF4 levels.
    • Match bitsandbytes' result and compare NF4, FP4 and uniform 4-bit error.
  3. Load a model in 4 bits

    • Load the course model with BitsAndBytesConfig and measure footprint, speed and output drift.
    • Explain the compute data type and why embeddings stay 16-bit.
QLoRA (2 lessons)
  1. Train a QLoRA adapter

    • Train LoRA adapters on an NF4 base on the CPU with float32 compute.
    • Explain what is frozen, what is cast and whether gradient checkpointing is on.
  2. Compare full fine-tuning, LoRA and QLoRA

    • Compare the three methods on quality, trainable parameters, memory, step time and file size.
    • Recommend a method for two hardware budgets.
Use adapters (2 lessons)
  1. Load, switch and disable adapters

    • Load adapters onto their base, switch between two and compare with the adapter disabled.
  2. Merge adapters and check the result

    • Merge an adapter, save the standalone model and confirm it matches the unmerged model.
    • Measure what changes when a QLoRA adapter meets the float32 base.
Run and document a fine-tuned model (2 lessons)
  1. Write an inference script

    • Write a separate offline inference script with input checks, stop tokens and output validation that reproduces the test metrics.
  2. Write a model card

    • Write a model card with base and revision, configuration, data and licence, metrics with split and seeds, regressions, limitations and intended use.
Fine-tune responsibly (2 lessons)
  1. Licences, data and sharing

    • Check model and data licences and what Apache-2.0 requires when sharing.
    • Keep personal data out and refuse untrusted model files.
  2. Test memorisation and behaviour

    • Plant fake canaries, train, and test whether the adapter reproduces them.
    • Rerun the behaviour probes and state what the results do and do not show.
Final challenge (1 lessons)
  1. Final challenge

    • Fine-tune an adapter for a new task within the CPU budget, meet the acceptance checks and justify every choice in a short report.
Optional: use a GPU you own (1 lessons)
  1. Optional: run the course on a GPU you own

    • Run the course scripts on a CUDA or Apple silicon GPU in a separate environment and compare with the CPU.

Study views

  • Full Course
  • Revision
  • Quick Reference

Unlock all 29 lessons

Course access opens every lesson and adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

Know what is included

Independent learning material from Vectametric. Not affiliated with or endorsed by the organisations behind the tools it teaches. Practice exams and projects are separate. Completing a course is not a professional certification.

Questions about courses

Are these video courses or reading courses?

The current courses use written lessons, examples and diagrams. Full Course, Revision and Cheat Sheet or Quick Reference views cover the same learning sequence at different levels of detail.

Which course should I start with?

Choose a Certification Course for a named exam, a Career Path Course for a role-led sequence, or a Skill Course for a focused subject. Read its level, prerequisites and curriculum before enrolling.

Do revision notes replace the full lessons?

No. Start with the full explanations, then use revision notes to refresh your understanding. Cheat sheets are concise study references, not a substitute for learning or permission to use notes during an official exam.

Are practice exams and projects included?

No. Course access, practice-exam bundles and project access are separate. An official certification, exam booking or voucher is not included.

How long do I have access?

The course page and checkout show the current online access period and price, including free enrollment where offered. Access starts when enrollment is confirmed and does not auto-renew.

Can I read lessons before enrolling?

Yes. Each course opens its first lessons to read without an account, and some courses are open in full. The course curriculum marks the lessons you can read now. Course access adds the remaining lessons, the Revision and Cheat Sheet or Quick Reference views, saved progress, bookmarks and personal notes.

Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy