Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Deep Learning
Transformers & self-attention
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
End Term · 31 Aug 2025 (FN)End Term
Read the passage below, then answer Q1–Q3

Based on the above data, answer the given subquestions.
Q1NAT3 Marks·Write the number
Your answer:- Q2NAT3 Marks·Write the number
Your answer: - Q3NAT2 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (AN)End Term
Read the passage below, then answer Q4–Q6

Based on the above data, answer the given subquestions.
Q4NAT2 Marks·Write the number
Your answer:- Q5NAT2 Marks·Write the number
Your answer: - Q6NAT1 Mark·Write the number
Your answer:
End Term · 13 Apr 2025 (AN)End Term
- Q7MCQ3 Marks·Choose one option
In the transformer architecture, which of the following are true regarding cross attention in the decoder?
- AThe query vectors come from the decoder stack, while the key and value vectors come from the encoder stack.
- BThe query and value vectors come from the decoder stack, while the key vectors come from the encoder stack.
- CThe query, key and value vectors come from the decoder stack.
- DThe query, key and value vectors come from the encoder stack.
Read the passage below, then answer Q8–Q10
Consider the multi-head self-attention mechanism in the encoder of a transformer with 8 heads. The word embedding dimension is 32. In a given head, the query, key and value vectors have the same dimension and each of them is 4. The sequence length is 5.
Based on the above data, answer the given subquestions.
Q8MCQ1 Mark·Choose one optionIn any given head, what is the dimension of the W_Q matrix?
- A32 × 4
- B32 × 32
- C4 × 4
- D32 × 8
- E5 × 5
- Q9MCQ1 Mark·Choose one option
In any given head, what is the dimension of the query-key product matrix?
- A5 × 5
- B4 × 4
- C8 × 8
- D32 × 32
- Q10NAT1 Mark·Write the number
Your answer: Read the passage below, then answer Q11–Q13

Based on the above data, answer the given subquestions.
Q11MCQ1 Mark·Choose one option
- A

- B

- C

- D

- A
- Q12MCQ1 Mark·Choose one option

- A

- B

- C

- D

- A
- Q13MCQ1 Mark·Choose one option
Which of the following is true?
- AThe mask matrix is added to the query-key product matrix before applying softmax.
- BThe mask matrix is added to the query-key product matrix after applying softmax.
- CThe mask matrix could be added either before or after the softmax.