Quiz Space

Large Language Models · Quiz 1 · 27 Oct 2024 · September 2024 term

Question 18: The input embeddings for the words “learning”, “brings” …

Question 18

+4 marksNumerical answer

The input embeddings for the words “learning”, “brings” and “joy” are h1=[0.5,0.25,1]h_1 = [0.5, 0.25, 1], h2=[0.1,0.25,0]h_2 = [0.1, 0.25, 0], and h3=[0.1,0.1,0.9]h_3 = [0.1, 0.1, 0.9], respectively. Note that the embeddings are row vectors. The projection matrices are as follows

WQ=[11−1101]WK=[011001]WV=[00−1−111]W_Q = \begin{bmatrix} 1 & 1 \\ -1 & 1 \\ 0 & 1 \end{bmatrix} \quad W_K = \begin{bmatrix} 0 & 1 \\ 1 & 0 \\ 0 & 1 \end{bmatrix} \quad W_V = \begin{bmatrix} 0 & 0 \\ -1 & -1 \\ 1 & 1 \end{bmatrix}

The following quantities are computed as

Q=HWQK=HWKV=HWVQ = HW_Q \quad K = HW_K \quad V = HW_V

Let eje_j denote the unnormalized attention score, aja_j denote the normalized attention score (ignore the scaling by dk\sqrt{d_k}) and zjz_j denote the linear combination of the value vectors for the j−thj - th word.

Suppose the gradient vector ∂L∂z3=[1,2]\frac{\partial L}{\partial z_3} = [1, 2], then what is the gradient vector ∂L∂e3\frac{\partial L}{\partial e_3}? Enter the sum of gradients.

Show answer

Correct answer: 0

Question 18 of 19 in the IIT Madras BS Large Language Models (LLM) Quiz 1 paper sat on 27 Oct 2024, in the September 2024 term (IIT M DEGREE AN EXAM QDB2 27 Oct 2024). It carries 4 marks.

More questions from this paper

  1. Q1Teacher forcing for training an transformer model is:
  2. Q2Choose the correct statements regarding transformer architecture:
  3. Q3Assume the model has two layers (N = 2). Calculate the total number of parameters in the model (excluding the embedding…
  4. Q4How many parameters does the output layer have?
  5. Q5How many parameters does the embedding layer have?
  6. Q6At time step t = 1, the prediction probability for the words “Naan”, “transformer” and “padaththai” are 0.55,0.15 and 0…
  7. Q7Consider following input matrix to a single neural network layer: X = \begin{bmatrix} 1 & 2 & 3 \ 4 & 7 & 11 \ -3 & 5 &…
  8. Q8Consider following input matrix to a single neural network layer: X = \begin{bmatrix} 1 & 2 & 3 \ 4 & 7 & 11 \ -3 & 5 &…
  9. Q9Consider following input matrix to a single neural network layer: X = \begin{bmatrix} 1 & 2 & 3 \ 4 & 7 & 11 \ -3 & 5 &…
  10. Q10Consider following input matrix to a single neural network layer: X = \begin{bmatrix} 1 & 2 & 3 \ 4 & 7 & 11 \ -3 & 5 &…
  11. Q11Consider a vocabulary \mathcal{V}, \mathcal{V} =([start], breaking, ground, a, is, seismology, study, experience, earth…
  12. Q12Consider a vocabulary \mathcal{V}, \mathcal{V} =([start], breaking, ground, a, is, seismology, study, experience, earth…
  13. Q13Consider a vocabulary \mathcal{V}, \mathcal{V} =([start], breaking, ground, a, is, seismology, study, experience, earth…
  14. Q14Consider a vocabulary \mathcal{V}, \mathcal{V} =([start], breaking, ground, a, is, seismology, study, experience, earth…
  15. Q15Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he …
  16. Q16Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he …
  17. Q17Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he …
  18. Q19Consider the embedding vector for a word, x = [0.1, 0.2, -0.3, 0.4]. Suppose the word is at position 2 in the given sen…