Explain LLM fundamentals and trade-offs
Company: Amazon
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: hard
Interview Round: Onsite
Answer the following LLM fundamentals: How does subword tokenization (e.g., BPE) work and why is it used? Explain self-attention and the O(n^
2) cost; discuss techniques to reduce it (e.g., sparsity, sliding windows, KV cache). Contrast pretraining, instruction tuning, and RLHF/DPO. Describe a RAG architecture, including indexing choices (BM25 vs dense, chunking, embeddings) and how retrieval quality affects generation. When do you use prompting vs fine-tuning vs adapters? Explain quantization, KV caching, and batching for low-latency inference. How do you evaluate LLMs (e.g., task-specific metrics, human eval) and mitigate hallucinations and safety risks?
Quick Answer: Explain LLM fundamentals and trade-offs evaluates core ML concepts, assumptions, math intuition, training/evaluation trade-offs, and practical failure modes in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.