Module resources

Fine-tuning

Checked sources to go further than the lessons. Back to the module.

Recommended learning sequence

Work through these in order.

  1. Quickstart (TRL documentation) (opens in a new tab)

    Hugging Face2026Documentation

    Start with the smallest runnable examples. The page shows SFTTrainer, DPOTrainer, GRPOTrainer and RewardTrainer each set up in a few lines on a 0.5-billion-parameter Qwen model, plus a trl command-line form for SFT, DPO and reward training only. It also lists a gradient-accumulation setting for out-of-memory runs.

  2. Supervised Fine-Tuning (Hugging Face LLM Course, chapter 11) (opens in a new tab)

    Hugging Face2026Course

    Then follow one full SFT run: chat templates, a brief introduction to input-output pairs, SFTConfig settings such as epochs, batch size, learning rate and warmup, packing, and reading training and validation loss. The page carries a few code gaps (unimported names, a missing loss graph), so check it against the TRL docs.

  3. Quicktour (PEFT documentation) (opens in a new tab)

    Hugging Face2026Documentation

    Next, make the run adapter-based. The page builds a LoraConfig, wraps a base model with get_peft_model, reports the trainable fraction (0.04 percent in its example), saves only the adapter weights, and reloads them with AutoPeftModel.

  4. Fine-tuning LLMs Guide (Unsloth documentation) (opens in a new tab)

    Unsloth2026Documentation

    Then compare a second toolchain for the same job. The guide walks from model and method choice through dataset, hyperparameters, training and deployment, and recommends starting with QLoRA. Its speed and memory figures are the vendor's own claims and the page shows no date, so treat them as claims to test.

  5. Using LLM-as-a-Judge For Evaluation: A Complete Guide (opens in a new tab)

    Hamel Husain2024Article

    Repeated on purpose: it is listed in module 10 and in module 13, lesson 5. Here it comes before the final step because a tuned model needs a test. The article proposes one domain expert giving binary pass or fail judgments with written critiques, then building and validating a judge against those labels.

  6. lm-evaluation-harness: a framework for few-shot evaluation of language models (opens in a new tab)

    EleutherAI2026Repository

    Repeated on purpose: it is listed in module 10. Finish hands-on: the README shows an lm_eval command for the Hugging Face backend and says a LoRA adapter is passed by adding peft=PATH to model_args. Run the base model and the adapter on the same tasks, then compare the scores.

All resources

Official documentation

  • Quicktour (PEFT documentation) (opens in a new tab)Essential

    Hugging Face2026Documentation

    A short route from LoraConfig to a saved adapter and back to inference, including add_adapter and set_adapter for several adapters on one base model. Pairs with the LoRA lesson's reference pages.

Further reading

  • Using LLM-as-a-Judge For Evaluation: A Complete Guide (opens in a new tab)

    Hamel Husain2024Article

    Repeated on purpose: it is listed in module 10 and module 13, lesson 5. A procedure for validating a model judge against one expert's labels. The article warns that a high raw agreement rate can hide errors when one class dominates, and that judges do not replace looking at the data.

Research papers

  • Tulu 3: Pushing Frontiers in Open Language Model Post-Training (opens in a new tab)

    Nathan Lambert, Jacob Morrison, Valentina Pyatkin, et al.2024Preprint

    Describes an open post-training recipe built on Llama 3.1 base models that combines supervised fine-tuning, DPO and a method called RLVR, with released data, code and an evaluation toolkit; the abstract says the open training datasets were decontaminated against the evaluation benchmarks. A preprint on arXiv; the listing shows no journal reference.

  • Zephyr: Direct Distillation of LM Alignment (opens in a new tab)

    Lewis Tunstall, Edward Beeching, Nathan Lambert, et al.2023Preprint

    Reports training a 7B chat model with distilled DPO on preference data ranked by a teacher model, with no human annotation. The abstract states that training takes only a few hours. A preprint with no venue listed.

Hands-on

Courses

  • Supervised Fine-Tuning (Hugging Face LLM Course, chapter 11) (opens in a new tab)

    Hugging Face2026Course

    A chapter walkthrough of SFT with TRL's SFTTrainer on a small model: chat templates, hyperparameters, packing, loss monitoring and evaluation, ending in a five-question quiz. Its closing suggestions are to rerun the notebook with other parameters or datasets and to contribute to the course.

  • CS336: Language Modeling from Scratch (opens in a new tab)

    Tatsunori Hashimoto, Percy Liang2026Course

    Repeated on purpose: it is listed in module 1 and module 10. For this module, the Spring 2026 schedule includes lectures on filtering and deduplication, SFT and RLHF, and RLVR, and Assignment 5 (Alignment and Reasoning RL), which applies SFT and reinforcement learning to math reasoning, with an optional part on safety alignment methods such as DPO. Lecture recordings and assignment code are public.