Contents
Map

09 · Post-Training & Fine-Tuning

Summary & Key Terms

View as:

Summary & Key Terms - Post-Training & Fine-Tuning

What We Learned

  • SFT teaches desired responses; PEFT updates a small fraction of parameters.
  • Preference optimization learns from comparisons; online RL learns from sampled outcomes and rewards.
  • Reference-policy constraints limit drift but do not guarantee safety or correctness.
  • Reasoning models spend compute on intermediate work; more thinking is not always better.
  • Use matching model/tokenizer revisions and chat templates throughout the training pipeline.
  • Configure LoRA or QLoRA to fit memory limits; decide whether to merge or serve adapters separately.
  • Mask prompt and padding tokens where the objective requires it, and read loss curves for over- and underfitting.
  • Compare base and tuned models on quality, latency, memory and cost on held-out data before adopting the tune - and watch for forgetting and reward hacking.

Key Acronyms, Concepts & Jargon

TermShort meaning
SFTSupervised Fine-Tuning: training on examples of desired responses.
PEFTParameter-Efficient Fine-Tuning: adapting a model with few trainable parameters.
LoRA / QLoRALow-Rank Adaptation / Quantized LoRA: train low-rank updates / do so on a quantized base.
Rank / alphaAdapter update size / its scaling parameter.
NF4NormalFloat 4: a 4-bit format used to quantize base weights in QLoRA.
Adapter mergeCombines learned adapter updates with base weights for deployment.
RL / RLHFReinforcement Learning / RL from Human Feedback: learn from rewards / human-derived preferences.
Reward model (RM)Predicts preference or quality to supply a training signal.
DPODirect Preference Optimization: learns from preferred/rejected pairs without an explicit RL rollout loop.
PPOProximal Policy Optimization: constrains policy updates during reward optimization.
GRPOGroup Relative Policy Optimization: uses group-relative rewards without a separate value critic.
GSPOGroup Sequence Policy Optimization: GRPO with a sequence-level importance ratio and clipping, for more stable RL.
RLVRReinforcement Learning with Verifiable Rewards: trains against checkable outcomes.
KL penaltyKullback-Leibler divergence penalty: discourages a policy from drifting away from a reference distribution.
CoT / test-time computeChain of Thought / inference work spent reasoning, searching or checking.
DistillationTrains a smaller or cheaper model using a stronger model's outputs.
Reward hacking / forgettingExploiting the reward without solving the task / losing earlier capabilities.
HF HubHugging Face Hub: versioned storage and sharing for models and datasets.
Transformers / datasetsLibraries for model/tokenizer loading / dataset processing.
TRLTransformer Reinforcement Learning: Hugging Face's SFT, DPO and GRPO trainers.
Chat templateFormats conversation roles and separators into the model's expected token sequence.
Loss maskingExcludes selected tokens, such as prompts or padding, from the training objective.
Held-out setData reserved for validation or testing rather than fitting the model.
Overfitting / quality deltaLearning training-specific patterns / measured change from the baseline.

Back to module overview

⚡AI-assisted content - always verify, always explore multiple perspectives·