Quiz Space

Large Language Models · Quiz 1 · 13 Jul 2025 · May 2025 term

Question 15: Question Description Embedding dimension : d_{model} = 4…

Question 15

+2 marksOne correct option

Question Description

  • Embedding dimension : dmodel=4d_{model} = 4
  • Input sequence (sequence length =2= 2, dmodel=4d_{model} = 4) :

X=[10021002]X = \begin{bmatrix} 1 & 0 \\ 0 & 2 \\ 1 & 0 \\ 0 & 2 \end{bmatrix}

  • Number of heads: 2 (each head operates on 2 dimensions)
  • For both the heads dK=dQ=dV=2d_K = d_Q = d_V = 2
  • Weight matrices for WQ,WK,WVW_Q, W_K, W_V first head :

WQ1,WK1,WV1=[11112222]W_Q^1, W_K^1, W_V^1 = \begin{bmatrix} 1 & 1 & 1 & 1 \\ 2 & 2 & 2 & 2 \end{bmatrix}

  • Weight matrices for WQ,WK,WVW_Q, W_K, W_V second head :

WQ2,WK2,WV2=[10101121]W_Q^2, W_K^2, W_V^2 = \begin{bmatrix} 1 & 0 & 1 & 0 \\ 1 & 1 & 2 & 1 \end{bmatrix}

  • The output from both heads are concatenated, then projected by:

WO=[0.500000.50000100001]W_O = \begin{bmatrix} 0.5 & 0 & 0 & 0 \\ 0 & 0.5 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

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

Based on the above data, answer the given subquestions.

Concatenate the outputs from both the attention heads, then apply the output projection matrix Wo to produce the final output of the multi-head attention mechanism. Select the correct result of this operation.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 15 of 21 in the IIT Madras BS Large Language Models (LLM) Quiz 1 paper sat on 13 Jul 2025, in the May 2025 term (IIT M DEGREE AN EXAM QDB2 13 July 2025). It carries 2 marks.

More questions from this paper

  1. Q1Transformers process input tokens:
  2. Q2What is the purpose of the softmax function in the attention mechanism?
  3. Q3What is the main difference between GPT and BERT pre-training objectives?
  4. Q4In Top-K sampling for language generation, increasing the value of K typically has which of the following effects?
  5. Q5Why are residual connections important in transformer architectures?
  6. Q6Which of the following statements are true regarding causal language modeling (CLM)?
  7. Q7Which of the following are valid reasons why transformer-based large language models are widely used in natural languag…
  8. Q8Which elements are included in BERT’s input representation for Next Sentence Prediction?
  9. Q9How does Top-p (nucleus) sampling differ from Top-K sampling in language generation?
  10. Q10Consider the embedding vector for a word, x = [0.5, -0.4, 0.3, -0.2]^T. Suppose the word is at position 3 in the given …
  11. Q11Suppose a language model outputs the following logits for a vocabulary of size 4: | Token | Logit | |---|---| | the | 2…
  12. Q12Figure question
  13. Q13Question Description Embedding dimension : d_{model} = 4 Input sequence (sequence length = 2, d_{model} = 4) : X = \beg…
  14. Q14Question Description Embedding dimension : d_{model} = 4 Input sequence (sequence length = 2, d_{model} = 4) : X = \beg…
  15. Q16For the given input matrix X and multihead attention output MHA(X), apply a residual connection and store the result in…
  16. Q17Based on the above data, answer the given subquestions.
  17. Q18Based on the above data, answer the given subquestions.
  18. Q19The table presents the conditional probability distribution over vocabulary tokens at each timestep during sequence gen…
  19. Q20The table presents the conditional probability distribution over vocabulary tokens at each timestep during sequence gen…
  20. Q21The table presents the conditional probability distribution over vocabulary tokens at each timestep during sequence gen…