Skip to main content
Primary: Phase 7GitHub Repository / HandbookAdvancedFree Learning Material
Hugging Face

Alignment Handbook

Production recipes, hyperparameter configurations, and open-source training scripts for aligning language models (such as Zephyr and SmolLM-Instruct) using SFT, LoRA/QLoRA, and DPO.

Maintained by the Hugging Face H4 team, the Alignment Handbook contains the exact reproducible recipes, YAML hyperparameter configs, and multi-GPU/QLoRA scripts used to train top-performing open instruction models. It demonstrates why learning rates must drop an order of magnitude from SFT to DPO, how chat templates are validated, and how to prevent catastrophic forgetting during post-training.

Resource Tracking

Course status is tracked independently from roadmap topic checkboxes so you can mark external courses without altering your topic mastery percentage.

Suggested Learning Position

Phase 7 Production Recipe Codebase (Modules 7.1–7.5)

Language:English
Access & Link Verification

100% free Apache-2.0 licensed open-source GitHub repository and technical handbook.

Status: Verified (2026-11-09)

What You Will Learn from This Resource

  • Apply battle-tested hyperparameter recipes for SFT, QLoRA, and DPO post-training.
  • Structure multi-stage alignment pipelines (Base -> SFT -> DPO) reproducibly.
  • Diagnose and prevent alignment tax, reward over-optimization, and catastrophic forgetting.

Recommended Prerequisites

Review these foundations before starting so you get the most out of this material:

  • Familiarity with SFT, LoRA/QLoRA, and DPO concepts (Modules 7.1–7.3).

Topics & Keywords

Alignment HandbookZephyrSFTDPOQLoRAGitHub Repository
Curriculum Integration

How This Resource Fits Into Your AI & LLM Roadmap

Open Interactive Roadmap

Phase-Specific Study Recommendations (1)

Phase 7 · Resource 7.4Practice & Reference

Alignment Handbook

In Phase 7: Post-training & Alignment

Inspect the `recipes/` directory when choosing learning rates, LoRA ranks, and DPO `beta` hyperparameters for your Phase 7 assistant model.

Continue Exploring
Browse Full Library
Phase 7Recommended StartInteractive Course
Hugging Face
AdvancedFree Learning Material

smol-course — Fine-Tuning Language Models

Practical hands-on course focused on post-training small and medium open-weight language models: chat templates, Supervised Fine-Tuning (SFT), LoRA/QLoRA parameter-efficient adaptation, preference alignment (DPO/ORPO), and evaluation.

smol-courseSFTSupervised Fine-TuningLoRAQLoRA
Your Status:
Phase 7Documentation / Tutorials
Hugging Face
AdvancedFree Learning Material

TRL Documentation and Tutorials

Official documentation and technical guides for TRL (Transformer Reinforcement Learning), covering `SFTTrainer`, `RewardTrainer`, `PPOTrainer`, `DPOTrainer`, and `GRPOTrainer`.

TRLSFTDPORLHFPPO
Your Status: