Scaling & Efficient Architectures
Level: 2 (Recall / definitions / short derivations) Time limit: 30 minutes Total marks: 40
Answer all questions. Use notation for math where needed.
Q1. State the Chinchilla scaling-law finding in one sentence, and give the approximate rule for the compute-optimal ratio of training tokens to parameters . (4 marks)
Q2. The Chinchilla parametric loss is Identify what each of the three terms represents. (3 marks)
Q3. Given the standard compute approximation (FLOPs), a team has a fixed compute budget of FLOPs and wants a compute-optimal model with parameters. How many training tokens should they use? (4 marks)
Q4. Define "emergent abilities" in large language models, and give one commonly cited criticism of how emergence is measured. (4 marks)
Q5. In a Mixture-of-Experts (MoE) layer with a top- gating network: (a) Explain what the gating network outputs and how the top- selection is used. (3 marks) (b) Explain why MoE increases total parameter count but keeps per-token compute roughly constant. (3 marks)
Q6. Explain the load-balancing problem in MoE training, and state the purpose of the auxiliary load-balancing loss. (4 marks)
Q7. Distinguish tensor parallelism from pipeline parallelism in one sentence each, and state one drawback of pipeline parallelism. (5 marks)
Q8. In data-parallel training with ZeRO, briefly describe what is sharded across devices in Stage 1, Stage 2, and Stage 3. (3 marks)
Q9. For a transformer with layers, hidden dim , and sequence length , write the expression for the total number of scalar values stored in the KV-cache (assuming batch size 1, keys+values), and name one technique to reduce KV-cache size. (4 marks)
Q10. Speculative decoding uses a small "draft" model and a large "target" model. (a) Describe the basic mechanism in 1–2 sentences. (2 marks) (b) State the key property preserved by speculative decoding relative to sampling from the target model alone. (1 mark)
Answer keyMark scheme & solutions
Q1. (4 marks)
- Finding: For a fixed compute budget, model size and training data should be scaled in equal proportion; previous large models (e.g. GPT-3, Gopher) were undertrained — too large for their data. (2)
- Rule: Compute-optimal scaling requires roughly tokens per parameter. (2)
Q2. (3 marks)
- : irreducible loss — entropy of the data / Bayes error, unattainable floor. (1)
- : error due to finite model size (parameters). (1)
- : error due to finite training data (tokens). (1)
Q3. (4 marks)
- Rearranging : . (1)
- . (1)
- tokens. (1)
- (Sanity: , near the compute-optimal regime.) (1)
Q4. (4 marks)
- Emergent ability: a capability that is absent (near-random) in smaller models but appears abruptly once model scale (params/data/compute) crosses a threshold; not predictable by smooth extrapolation from small-model performance. (2)
- Criticism (any one): emergence may be an artifact of discontinuous / nonlinear metrics (e.g. exact-match accuracy); using smooth continuous metrics often shows gradual, predictable improvement. (2)
Q5. (6 marks) (a)
- Gating network outputs a score/logit per expert, converted (softmax) to weights; top- selects the highest-scoring experts. (2)
- Only those experts process the token; outputs combined as a weighted sum by the gate weights. (1)
(b)
- Total params scale with number of experts (all experts stored). (1.5)
- Per-token compute scales with (only experts activated per token), so FLOPs stay roughly constant as grows. (1.5)
Q6. (4 marks)
- Problem: routing can collapse so a few experts receive most tokens while others are starved, causing under-utilization and instability; some experts overflow capacity. (2)
- Auxiliary loss: penalizes imbalance (e.g. product of fraction of tokens routed to each expert and mean gate probability), encouraging uniform expert utilization. (2)
Q7. (5 marks)
- Tensor parallelism: splits individual layer's weight matrices/tensors across devices so a single operation is computed jointly. (2)
- Pipeline parallelism: splits the layers/stages of the model across devices, passing activations forward between stages. (2)
- Drawback of pipeline parallelism: pipeline bubbles (idle time) when stages wait for micro-batches. (1)
Q8. (3 marks)
- Stage 1: optimizer states sharded. (1)
- Stage 2: optimizer states + gradients sharded. (1)
- Stage 3: optimizer states + gradients + parameters sharded. (1)
Q9. (4 marks)
- KV-cache stores keys and values for every layer and every position: values (factor 2 for K and V). (3)
- Reduction technique (any one): Multi-Query Attention (MQA) / Grouped-Query Attention (GQA), quantization of cache, sliding-window / local attention, or eviction/paged KV. (1)
Q10. (3 marks) (a) Draft model cheaply generates several candidate tokens ahead; the target model verifies them in one parallel forward pass, accepting the longest valid prefix and continuing. (2) (b) The output distribution is identical to sampling from the target model (lossless / distribution-preserving); it only speeds up decoding. (1)
[
{"claim":"Q3: D = C/(6N) = 6e21/(6*1e10) = 1e11 tokens", "code":"C=Integer(6)*10**21; N=Integer(1)*10**10; D=C/(6*N); result = (D == 10**11)"},
{"claim":"Q3 sanity: D/N = 10", "code":"D=Integer(10)**11; N=Integer(10)**10; result = (D/N == 10)"},
{"claim":"Q9: KV-cache size = 2*L*s*d for L=32,s=2048,d=4096 gives 536870912", "code":"L,s,d=32,2048,4096; result = (2*L*s*d == 536870912)"},
{"claim":"Chinchilla approx: for N=1e10 compute-optimal tokens ~20N = 2e11", "code":"N=Integer(10)**10; result = (20*N == 2*10**11)"}
]