Level 1 — RecognitionPretraining & Fine-Tuning LLMs

Pretraining & Fine-Tuning LLMs

20 minutes30 marksprintable — key stays hidden on paper

Level: 1 — Recognition Time limit: 20 minutes Total marks: 30


Section A — Multiple Choice (1 mark each)

Choose the single best answer.

Q1. Which architecture type is GPT based on? A) Encoder-only B) Decoder-only C) Encoder–decoder D) Convolutional

Q2. BERT's core pretraining objective is: A) Next-token (autoregressive) prediction B) Masked Language Modeling (MLM) C) Contrastive image-text matching D) Reinforcement learning from human feedback

Q3. The T5 model frames every NLP task as: A) Classification over fixed labels B) A text-to-text problem C) A token-tagging problem D) A retrieval problem

Q4. In LoRA, the pretrained weight matrix WW is adapted by adding a product of two low-rank matrices BABA. If WRd×kW \in \mathbb{R}^{d\times k} and rank rr, the shapes of BB and AA are: A) BRd×r, ARr×kB\in\mathbb{R}^{d\times r},\ A\in\mathbb{R}^{r\times k} B) BRr×d, ARk×rB\in\mathbb{R}^{r\times d},\ A\in\mathbb{R}^{k\times r} C) BRd×k, ARk×dB\in\mathbb{R}^{d\times k},\ A\in\mathbb{R}^{k\times d} D) BRr×r, ARr×rB\in\mathbb{R}^{r\times r},\ A\in\mathbb{R}^{r\times r}

Q5. QLoRA primarily reduces memory by: A) Removing attention layers B) Quantizing the frozen base model (e.g., to 4-bit) while training LoRA adapters C) Pruning tokens from input D) Increasing the LoRA rank

Q6. Catastrophic forgetting refers to: A) The GPU running out of memory B) A model losing previously learned knowledge when trained on new tasks C) Forgetting to save checkpoints D) Vanishing gradients in RNNs

Q7. Which is a form of parameter-efficient fine-tuning (PEFT)? A) Full fine-tuning B) Adapter layers C) Pretraining from scratch D) Data cleaning

Q8. Knowledge distillation trains a smaller "student" model to mimic: A) Random noise B) A larger "teacher" model's outputs C) The raw dataset labels only D) Its own earlier checkpoints exclusively

Q9. INT4 quantization compared to FP16 primarily gives: A) Higher numerical precision B) Reduced memory footprint C) More parameters D) Longer context windows

Q10. Instruction tuning fine-tunes a model on: A) Only raw web text B) Datasets of (instruction, response) pairs C) Image captions D) Reward signals from a critic


Section B — Matching (1 mark each, 5 marks)

Q11. Match each term (11a–11e) to its correct description (i–v).

Term Description
11a. GPT (i) Encoder-only model using MLM
11b. BERT (ii) Text-to-text unified framework
11c. T5 (iii) Decoder-only autoregressive model
11d. LoRA (iv) Low-rank adaptation of weight updates
11e. Prefix tuning (v) Prepends trainable vectors to the input/keys-values

Section C — True/False with Justification (2 marks each: 1 for verdict, 1 for justification)

Q12. In feature extraction, all weights of the pretrained model are updated during downstream training. (T/F + justify)

Q13. Full fine-tuning updates more parameters than LoRA for the same model. (T/F + justify)

Q14. Deduplication and quality filtering are standard steps in pretraining data curation. (T/F + justify)

Q15. Masked Language Modeling and next-token prediction are both self-supervised objectives. (T/F + justify)

Q16. GPTQ is a training algorithm that increases model precision to FP32. (T/F + justify)

Q17. Adapter layers add small trainable modules inside transformer blocks while keeping most original weights frozen. (T/F + justify)

Q18. Supervised fine-tuning (SFT) uses labeled input-output pairs. (T/F + justify)


End of paper.

Answer keyMark scheme & solutions

Section A (10 marks)

Q1 — B. GPT is decoder-only; it uses causal (masked) self-attention for autoregressive generation. (1)

Q2 — B. BERT pretrains with MLM (plus next-sentence prediction in the original); it is bidirectional, not autoregressive. (1)

Q3 — B. T5 casts translation, classification, summarization, etc. all as text-in → text-out. (1)

Q4 — A. ΔW=BA\Delta W = BA must match WRd×kW\in\mathbb{R}^{d\times k}, so BRd×rB\in\mathbb{R}^{d\times r} and ARr×kA\in\mathbb{R}^{r\times k}, giving product d×kd\times k. (1)

Q5 — B. QLoRA keeps the base model frozen in 4-bit (NF4) precision and trains only LoRA adapters, drastically cutting memory. (1)

Q6 — B. Learning a new task can overwrite weights encoding old knowledge → catastrophic forgetting. (1)

Q7 — B. Adapters are a canonical PEFT method (train few added params). (1)

Q8 — B. Distillation transfers knowledge from teacher (often via soft logits) to a compact student. (1)

Q9 — B. Fewer bits per weight → smaller memory, at the cost of precision. (1)

Q10 — B. Instruction tuning uses (instruction, response) demonstration pairs to improve task-following. (1)

Section B (5 marks)

Q11: 11a→(iii), 11b→(i), 11c→(ii), 11d→(iv), 11e→(v). (1 mark each)

Section C (14 marks; 1 verdict + 1 justification each)

Q12 — FALSE. In feature extraction the backbone is frozen; only a new head/classifier is trained. Full fine-tuning is what updates all weights. (1+1)

Q13 — TRUE. Full fine-tuning updates all d×kd\times k weights, whereas LoRA trains only r(d+k)r(d+k) params with rmin(d,k)r\ll\min(d,k), far fewer. (1+1)

Q14 — TRUE. Curation pipelines routinely deduplicate, filter low-quality/toxic text, and remove boilerplate to improve pretraining quality. (1+1)

Q15 — TRUE. Both derive labels from the raw text itself (no human labels): masked tokens / next token are the supervision. (1+1)

Q16 — FALSE. GPTQ is a post-training quantization method that reduces precision (e.g., to INT4/INT3), not a precision-increasing trainer. (1+1)

Q17 — TRUE. Adapters insert small bottleneck MLP modules within each transformer layer; original weights stay frozen, only adapters train. (1+1)

Q18 — TRUE. SFT trains on labeled input→output demonstrations via supervised loss. (1+1)

[
  {"claim": "LoRA param count r(d+k) is far less than full d*k for d=1024,k=1024,r=8",
   "code": "d,k,r=1024,1024,8; full=d*k; lora=r*(d+k); result = lora < full and lora==16384 and full==1048576"},
  {"claim": "LoRA shapes: B(d x r) times A(r x k) yields d x k",
   "code": "from sympy import MatrixSymbol; d,k,r=6,5,2; B=MatrixSymbol('B',d,r); A=MatrixSymbol('A',r,k); P=B*A; result = (P.shape==(d,k))"},
  {"claim": "INT4 uses 4 bits vs FP16 16 bits, a 4x reduction",
   "code": "result = (16/4)==4"}
]