Katkat

Explain Transformers, attention, decoding, RL, and evaluation

Scale AIMachine Learning Engineer · Technical Screen

Last updated

This question evaluates understanding of transformer architectures, self- and cross-attention mechanisms, autoregressive decoding and sampling strategies, reinforcement learning–based fine-tuning (RLHF), evaluation methodologies, and training/inference optimization techniques.

  • Explain the Transformer architecture and how self-attention works; discuss computational complexity and why multi-head attention helps.
  • Differentiate attention types (self vs. cross; scaled dot-product) and when to use them.
  • Define causal (autoregressive) decoding and how attention masks enforce causality.
  • Compare decoding/sampling strategies (greedy, temperature, top-k, nucleus/top-p, beam search); explain trade-offs in quality, diversity, and latency.
  • Describe how reinforcement learning is used to fine-tune LLMs (e.g., reward modeling, preference data, PPO or alternatives, KL control) and common stability challenges.
  • Propose an evaluation plan for LLMs (automatic metrics like perplexity/accuracy, task-based eval, human evaluation, safety/robustness), and how to avoid data leakage and ensure statistical significance.
  • Outline key optimization techniques for training/inference (optimizer and LR schedules, mixed precision, gradient checkpointing, parameter-efficient finetuning like LoRA, and distributed strategies such as DP/TP/ZeRO).