Quiz Space

Deep Learning · End Term · 31 Aug 2025 · May 2025 term · Set QDD3

Question 8: Sequence Length : t Number of Heads : h Embedding dimensi…

Question 8

+2 marksNumerical answer
  • Sequence Length : tt
  • Number of Heads : hh
  • Embedding dimension : dmodeld_{\text{model}}
  • Input X∈Rdmodel×tX \in \mathbb{R}^{d_{\text{model}} \times t}
  • dk=dq=dmodelhd_k = d_q = \frac{d_{\text{model}}}{h}
  • WQ∈Rdq×dmodelW_Q \in \mathbb{R}^{d_q \times d_{\text{model}}}
  • WK∈Rdk×dmodelW_K \in \mathbb{R}^{d_k \times d_{\text{model}}}
  • WV∈Rdv×dmodelW_V \in \mathbb{R}^{d_v \times d_{\text{model}}}
  • Wo∈Rdmodel×(h×dv)W_o \in \mathbb{R}^{d_{\text{model}} \times (h \times d_v)}

Based on the above data, answer the given subquestions.

Suppose t=32t = 32, dmodel=64d_{\text{model}} = 64, h=2h = 2 and dv=16d_v = 16. What will be the shape of the output of the scaled dot-product attention operation for a single head, given by:

Attention(Q,K,V)=softmax(QTKdk)VT\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{Q^T K}{\sqrt{d_k}}\right) V^T

Compute the resulting output dimension and report the total number of elements in the resulting attention output.

Show answer

Correct answer: 512

Question 8 of 19 in the IIT Madras BS Deep Learning (Deep Learning) End Term paper sat on 31 Aug 2025, in the May 2025 term (IIT M IMPROVEMENT FN EXAM QIC1 31 Aug 2025). It carries 2 marks.

This question was also asked in

More questions from this paper

  1. Q1Consider the following two statements regarding model performance:\ Statement 1: A model achieving zero training loss i…
  2. Q2How does unsupervised layerwise pretraining help in alleviating the vanishing gradient problem?
  3. Q3A dataset is given by X = \begin{bmatrix} 1 & 2 & 0 & 5 & 0 \ 1 & 0 & 3 & 0 & 0 \ 1 & 1 & 0 & 1 & 1 \ 1 & -1 & 0 & 0 & …
  4. Q4Given the input matrix X and kernel K: X = \begin{bmatrix} 2 & 1 & 0 & 1 \ 0 & 1 & -1 & 0 \ 3 & 2 & 1 & -1 \ 1 & 0 & -2…
  5. Q5Suppose you are given three encoder hidden states at time t: h_j = h_1 = \begin{bmatrix} 1 \ 0 \end{bmatrix}, \quad h_2…
  6. Q6Suppose you are given three encoder hidden states at time t: h_j = h_1 = \begin{bmatrix} 1 \ 0 \end{bmatrix}, \quad h_2…
  7. Q7Suppose you are given three encoder hidden states at time t: h_j = h_1 = \begin{bmatrix} 1 \ 0 \end{bmatrix}, \quad h_2…
  8. Q9Sequence Length : t Number of Heads : h Embedding dimension : d_{\text{model}} Input X \in \mathbb{R}^{d_{\text{model}}…
  9. Q10Sequence Length : t Number of Heads : h Embedding dimension : d_{\text{model}} Input X \in \mathbb{R}^{d_{\text{model}}…
  10. Q11Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. W and …
  11. Q12Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. W and …
  12. Q13Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. W and …
  13. Q14Based on the above data, answer the given subquestions.
  14. Q15Based on the above data, answer the given subquestions.
  15. Q16Based on the above data, answer the given subquestions.
  16. Q17Based on the above data, answer the given subquestions.
  17. Q18Based on the above data, answer the given subquestions.
  18. Q19Based on the above data, answer the given subquestions.