Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Large Language Models
End Term · 31 Aug 2025 (Afternoon)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
- Q1MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q2MCQ2 Marks·Choose one option
A GPT model is trained using causal language modeling. During training, for a sequence of T = 4 tokens, which of the following correctly represents the attention mask matrix applied to the attention logits?
- A

- B

- C

- D

- A
- Q3MCQ2 Marks·Choose one option

- A(a) : Random Local Attention, (b) : Strided Local Attention, (c) : Sparse Block Attention, (d) : Local + Global Attention
- B(a) : Strided Local Attention, (b) : Local + Global Attention, (c) : Random Local Attention, (d) : Sparse Block Attention
- C(a) : Strided Local Attention, (b) : Random Local Attention, (c) : Local + Global Attention, (d) : Sparse Block Attention
- D(a) : Sparse Block Attention, (b) : Local + Global Attention, (c) : Strided Local Attention, (d) : Random Local Attention
- Q4MSQ3 Marks·Choose all correct options
Which of the following preprocessing steps are commonly used when preparing data for transformer models like BERT?
- AAdding special tokens such as [CLS] and [SEP] to the sequence
- BSplitting tokens into subword units using a model-specific tokenizer
- CRemoving all punctuation marks to ensure cleaner embeddings
- DAdding positional information to each token embedding
- Q5MSQ3 Marks·Choose all correct options
Which modifications are used in transformers to handle longer sequences efficiently?
- AUsing sparse attention patterns to reduce computational complexity
- BApplying low-rank matrix factorization to approximate attention
- CIncreasing only the feed-forward network width without modifying attention
- DReplacing the softmax function in attention with other activation function for faster training
- Q6MSQ3 Marks·Choose all correct options
In Transformer models that use relative position embeddings (such as in Transformer-XL or T5), clipping is often applied to the relative position indices. Which of the following statements about clipping in relative position embeddings are correct?
- AClipping ensures that very large relative distances are mapped to a fixed maximum distance.
- BWithout clipping, the model would require embeddings for every possible relative distance, which is infeasible for long sequences.
- CClipping increases the precision of embeddings for large relative distances.
- DClipping introduces an upper bound k such that all distances greater than k are mapped to the same index.
- Q7NAT2 Marks·Write the number
Your answer: Read the passage below, then answer Q8–Q9
Q8NAT3 Marks·Write the numberFor the input “you enjoy tea often”, compute the final representation of the word “enjoy” after the attention layer (i.e., after applying W_Q, W_K, W_V , attention weights, and W_O). Enter the sum of the elements in the resulting vector.
Your answer:- Q9NAT2 Marks·Write the number
Suppose the input sentence is “tea you enjoy often”. Using the same matrices and processing method, what is the attention score (i.e., softmax entry from A) for the query word “tea” attending to key word “often”?
Your answer: Read the passage below, then answer Q10–Q12

Based on the above data, answer the given subquestions.
Q10MCQ2 Marks·Choose one optionChoose the correct representation of π for the given mask image.
- Aπ = (2, 1, 3, 4, 0)
- Bπ = (0, 4, 3, 1, 2)
- Cπ = (0, 3, 4, 2, 1)
- DAll of these
- Q11NAT1 Mark·Write the number
How many permutations of π are possible for n = 5?
Your answer: - Q12NAT2 Marks·Write the number
What percentage of entries in the attention matrix are zero (i.e., the sparsity)?
Your answer: Read the passage below, then answer Q13–Q17

Based on the above data, answer the given subquestions.
Q13MCQ2 Marks·Choose one option
- A(0, 1, 2, 3, 4, 5)
- B(-1, 0, 1, 2, 3, 4)
- C(-3, -2, -1, 0, 1, 2)
- D(-2, -1, 0, 1, 2, 3)
- Q14MCQ2 Marks·Choose one option

- A[−0.4,−0.4,−0.4,−0.4]
- B[−0.1,−0.1,−0.1,−0.1]
- C[−0.8,−0.8,−0.8,−0.8]
- D[−0.2,−0.2,−0.2,−0.2]
- Q15NAT3 Marks·Write the number
Your answer: - Q16NAT2 Marks·Write the number
Your answer: - Q17NAT3 Marks·Write the number
Your answer: