Alignment practice problems

18 problems · 0 solved

Alignment is the stage after pretraining where a model learns to prefer answers that people actually want. Usually you show the model pairs of responses, one preferred and one rejected, and push its probabilities toward the better one while keeping it close to the original model. These problems turn the formulas from preference training into working code. You will train a reward model with the Bradley-Terry loss, score it by pairwise accuracy, estimate KL divergence from samples, compute the DPO loss and its gradient weights, write the IPO, KTO and SimPO losses, build per-token RLHF rewards with a KL penalty, and assemble the full PPO loss with GAE and value clipping, plus GRPO group-relative advantages. Start with the Easy problems on the Bradley-Terry loss and KL estimation. Then do DPO and its variants, and finish with PPO and GRPO. Post-training is where much of the current LLM work happens, and interviewers for research and fine-tuning roles expect you to explain how DPO differs from PPO and what the KL term protects against.

Easy 7

Medium 6

Hard 5

Related topics

All practice problems