Natural Language Processing · free preview
Post-Training with Instructions and Preferences
Instruction tuning, parameter-efficient fine-tuning with LoRA, preference data and the Bradley-Terry model, reward models, KL-regularized alignment, and DPO.
1. Post-Training with Instructions and Preferences
Post-Training with Instructions and Preferences
2. Learning from preferences
Learning from preferences
3. A toy reward model in NumPy
A toy reward model in NumPy
4. Bradley-Terry preference probability
Two responses have reward scores and . Compute , rounding to three decimals.
5. Reward model loss on one pair
For one preference pair the reward model scores the winner above the loser. Compute the loss , rounding to three decimals.
6. LoRA parameter count
A frozen weight matrix is , and LoRA adapts it with matrices of shapes and . How many trainable parameters does LoRA add? Answer with the number.
7. Why the KL penalty
In preference-based alignment, the optimization maximizes reward minus times the KL divergence to a reference policy. What goes wrong with reward alone?
8. What DPO eliminates
Direct Preference Optimization optimizes the same KL-regularized objective as reward-model RL. What does it skip, and why is that possible?
Practice this interactively
Free account · instant grading · spaced review that schedules itself.
Start this course for free