InterviewStack.io LogoInterviewStack.io

LLM Fine-Tuning and Alignment Questions

Adapting foundation models to specific tasks and desired behavior. Covers transfer learning and using pretrained models, full and parameter-efficient fine-tuning, instruction tuning, and alignment methods such as RLHF and preference optimization. Focuses on when and how to customize a base model rather than prompt it, and the data and compute tradeoffs involved.

HardSystem Design
54 practiced

Architect an end-to-end RLHF training platform or pipeline for a production instruction-following assistant at scale (for example 100M preference pairs, supporting daily fine-tuning runs). Describe the major components (data ingestion, annotation service, preference store, reward-model training, policy-optimization cluster, artifact repository, serving layer, monitoring), data flow, sharding/partitioning strategies, and main compute/storage considerations and cost-saving opportunities (GPU/TPU sizing, checkpoint frequency and retention, throughput needs for offline and online scoring).

MediumTechnical
57 practiced

Implement a lightweight PyTorch module that wraps a torch.nn.Linear to add a LoRA-style low-rank update (A @ B) during forward pass. The wrapper should accept rank r and alpha scaling factor, support merging the LoRA updates into the main weight for inference, and maintain original weight unchanged. Provide clear method signatures and necessary forward code.

EasyTechnical
55 practiced

Define reward hacking in the context of RLHF for LLMs, and give two concrete examples (for example, a model producing safe-sounding but misleading content, or padding responses to exploit a length-based reward heuristic). What early-detection monitoring signals would reveal reward hacking, and what mitigations would you apply at the dataset, reward-model, and policy-training levels?

EasyTechnical
69 practiced

At a high level, explain the Low-Rank Adaptation (LoRA) technique for parameter-efficient fine-tuning. Describe the mathematical intuition (the W + BA formulation), where the low-rank adapters are typically inserted in a transformer block, what the rank r and scaling factor alpha hyperparameters control, how per-task adapters are stored, and why LoRA reduces training memory compared with full fine-tuning.

HardTechnical
61 practiced

You observe a policy trained with PPO collapsing to short, generic replies that nevertheless score highly with the reward model. Diagnose likely causes (algorithmic, data, reward-model issues) and propose a ranked list of fixes including changes to reward modeling, data collection, and training procedure.

Unlock Full Question Bank

Get access to all LLM Fine-Tuning and Alignment interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.