uiz Space

May 2025 term · Deep Learning · BSCS3004

Deep Learning End Term: 31 August 2025, Set QIC1 (May 2025 term)

The IIT Madras BS Deep Learning (Deep Learning) End Term paper sat on 31 Aug 2025, in the May 2025 term, set QIC1: 19 questions for 40 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
19
Marks
40
Duration
180 min
MCQ
6
MSQ
1
Numerical
12

Updated

Official paper: IIT M IMPROVEMENT FN EXAM QIC1 31 Aug 2025 · No negative marking.

Question 1

+2 marksOne correct option
  1. A

    XOR

  2. B

    AND

  3. C

    OR

  4. D

    NAND

  5. E

    None of these

Show answer

Correct answer

  • C

    OR

Question 2

+2 marksOne correct option

Based on the two statements provided choose the correct option?
Statement 1: Optimization’s primary goal is to reduce the training error.
Statement 2: Regularization helps to prevent overfitting, which in turn reduces the training error.

  1. A

    Both Statement 1 and Statement 2 are false.

  2. B

    Statement 1 is true, but Statement 2 is false.

  3. C

    Statement 1 is false, but Statement 2 is true.

  4. D

    Both Statement 1 and Statement 2 are true.

Show answer

Correct answer

  • B

    Statement 1 is true, but Statement 2 is false.

Question 3

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 4

+3 marksOne or more correct options

Consider a feedforward neural network with one hidden layer trained using backpropagation for a binary classification task. The network has the following architecture:

  • Input layer with 15 neurons
  • Hidden layer with 25 neurons
  • Output layer with 1 neuron

Assume that:

  • The activation function for both the hidden and output layers is the sigmoid function, σ(z)\sigma(z),
  • The derivative of the sigmoid function is σ′(z)=σ(z)(1−σ(z))\sigma'(z) = \sigma(z)(1 - \sigma(z)),
  • The loss function used is binary cross-entropy (BCE),
  • y^(i)\hat{y}^{(i)} is the output for the ii-th example, y(i)y^{(i)} is the true label, and hj(i)h_j^{(i)} is the output of the jj-th hidden neuron for the ii-th example,
  • There are no biases in the network.

Let wjw_j represent the weight connecting the jjth neuron of the hidden layer to the output neuron. Identify the correct weight update rule Δwj\Delta w_j for each type of gradient descent: Vanilla Gradient Descent (GD) ,mini-Batch Gradient Descent (BGD), and Stochastic Gradient Descent (SGD). (Recall: with BCE + sigmoid, the gradient w.r.t. the pre-activation simplifies to y^(i)−y(i)\hat{y}^{(i)} - y^{(i)}.

Select all that apply.

  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
Show answer

Correct answers

  • A
  • B
  • C

Question 5

+3 marksNumerical answer

Scaled Dot-Product Attention

You are given a simple transformer attention setup with the following configuration:

  • Embedding dimension: dmodel=2d_{\text{model}} = 2
  • Input sequence (sequence length = 2, each column vector in R2\mathbb{R}^2):

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

  • Dimension of queries and keys: dk=2d_k = 2
  • Projection matrices:

WQ=WK=[2−11−1],WV=[0112]W_Q = W_K = \begin{bmatrix} 2 & -1 \\ 1 & -1 \end{bmatrix}, \quad W_V = \begin{bmatrix} 0 & 1 \\ 1 & 2 \end{bmatrix}

Scaled Dot-Product Attention:

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.

Show answer

Correct answer: 10

Question 6

+3 marksNumerical answer

Scaled Dot-Product Attention

You are given a simple transformer attention setup with the following configuration:

  • Embedding dimension: dmodel=2d_{\text{model}} = 2
  • Input sequence (sequence length = 2, each column vector in R2\mathbb{R}^2):

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

  • Dimension of queries and keys: dk=2d_k = 2
  • Projection matrices:

WQ=WK=[2−11−1],WV=[0112]W_Q = W_K = \begin{bmatrix} 2 & -1 \\ 1 & -1 \end{bmatrix}, \quad W_V = \begin{bmatrix} 0 & 1 \\ 1 & 2 \end{bmatrix}

Scaled Dot-Product Attention:

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.

Show answer

Correct answer: 1.56 (accepted within ±0.04)

Question 7

+2 marksNumerical answer

Scaled Dot-Product Attention

You are given a simple transformer attention setup with the following configuration:

  • Embedding dimension: dmodel=2d_{\text{model}} = 2
  • Input sequence (sequence length = 2, each column vector in R2\mathbb{R}^2):

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

  • Dimension of queries and keys: dk=2d_k = 2
  • Projection matrices:

WQ=WK=[2−11−1],WV=[0112]W_Q = W_K = \begin{bmatrix} 2 & -1 \\ 1 & -1 \end{bmatrix}, \quad W_V = \begin{bmatrix} 0 & 1 \\ 1 & 2 \end{bmatrix}

Scaled Dot-Product Attention:

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.

Compute the final attention output:

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

What is the sum of the values in the first row of the Scaled Dot-Product Attention output?

(Answer up to 2 decimal places.)

Show answer

Correct answer: 3.99 (accepted within ±0.04)

Question 8

+2 marksOne correct option

Consider an image XX of size 4×44 \times 4, and a true label y=3y = 3. The image is passed through a convolutional neural network with a single filter followed by a ReLU and a max-pooling operation.

X=[1032010221101021],K=[101010101]X = \begin{bmatrix} 1 & 0 & 3 & 2 \\ 0 & 1 & 0 & 2 \\ 2 & 1 & 1 & 0 \\ 1 & 0 & 2 & 1 \end{bmatrix}, \quad K = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}

Parameters:

  • Convolution: stride S=2S = 2, padding P=1P = 1
  • Max pooling: filter size F=2F = 2, stride S=2S = 2, padding P=0P = 0

Based on the above data, answer the given subquestions.

What is the output of the convolution layer after applying ReLU?

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

Correct answer

  • B

Question 9

+1 markNumerical answer

Consider an image XX of size 4×44 \times 4, and a true label y=3y = 3. The image is passed through a convolutional neural network with a single filter followed by a ReLU and a max-pooling operation.

X=[1032010221101021],K=[101010101]X = \begin{bmatrix} 1 & 0 & 3 & 2 \\ 0 & 1 & 0 & 2 \\ 2 & 1 & 1 & 0 \\ 1 & 0 & 2 & 1 \end{bmatrix}, \quad K = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}

Parameters:

  • Convolution: stride S=2S = 2, padding P=1P = 1
  • Max pooling: filter size F=2F = 2, stride S=2S = 2, padding P=0P = 0

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 6

Question 10

+2 marksNumerical answer

Consider an image XX of size 4×44 \times 4, and a true label y=3y = 3. The image is passed through a convolutional neural network with a single filter followed by a ReLU and a max-pooling operation.

X=[1032010221101021],K=[101010101]X = \begin{bmatrix} 1 & 0 & 3 & 2 \\ 0 & 1 & 0 & 2 \\ 2 & 1 & 1 & 0 \\ 1 & 0 & 2 & 1 \end{bmatrix}, \quad K = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}

Parameters:

  • Convolution: stride S=2S = 2, padding P=1P = 1
  • Max pooling: filter size F=2F = 2, stride S=2S = 2, padding P=0P = 0

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 6

Question 11

+2 marksNumerical answer

Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. WW and CC are the matrices that contain the word and context embeddings respectively. The columns in each matrix correspond to the embeddings. Both matrices are of shape 2×32 \times 3:

W=[goodbadugly10−1−110],C=[goodbadugly1−111−1−1]W = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & 0 & -1 \\ -1 & 1 & 0 \end{bmatrix}, \quad C = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & -1 & 1 \\ 1 & -1 & -1 \end{bmatrix}

The context window is 1, meaning, the next word is predicted using just the current word as context. Recall that we use softmax to make predictions at the output.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 36.31 (accepted within ±35.69)

Question 12

+2 marksOne correct option

Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. WW and CC are the matrices that contain the word and context embeddings respectively. The columns in each matrix correspond to the embeddings. Both matrices are of shape 2×32 \times 3:

W=[goodbadugly10−1−110],C=[goodbadugly1−111−1−1]W = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & 0 & -1 \\ -1 & 1 & 0 \end{bmatrix}, \quad C = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & -1 & 1 \\ 1 & -1 & -1 \end{bmatrix}

The context window is 1, meaning, the next word is predicted using just the current word as context. Recall that we use softmax to make predictions at the output.

Based on the above data, answer the given subquestions.

The CBOW model is now used to generate a “sentence” or a string of words. First we pass the word “good” and retain the word with highest probability as the output, say word1, which is in turn passed as input to the model. If the model is run this way for exactly three time steps, what is the sentence that it outputs? Note that the sentence here is “word1 word2 word3”.

  1. A

    bad ugly good

  2. B

    good bad ugly

  3. C

    bad bad bad

  4. D

    good good good

  5. E

    bad ugly bad

Show answer

Correct answer

  • A

    bad ugly good

Question 13

+3 marksOne correct option

Consider a CBOW model for learning word embeddings. The vocabulary is made up of three words, {good, bad, ugly}. WW and CC are the matrices that contain the word and context embeddings respectively. The columns in each matrix correspond to the embeddings. Both matrices are of shape 2×32 \times 3:

W=[goodbadugly10−1−110],C=[goodbadugly1−111−1−1]W = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & 0 & -1 \\ -1 & 1 & 0 \end{bmatrix}, \quad C = \begin{bmatrix} \text{good} & \text{bad} & \text{ugly} \\ 1 & -1 & 1 \\ 1 & -1 & -1 \end{bmatrix}

The context window is 1, meaning, the next word is predicted using just the current word as context. Recall that we use softmax to make predictions at the output.

Based on the above data, answer the given subquestions.

Now consider updating the word embeddings using the sample “good good”. The first “good” in the string is used as context and the second “good” as the true label. Use cross entropy as the loss function and run one iteration of gradient descent with η = 1 starting with the existing values for the embeddings.
Find the updated word embedding for “good” and choose the most appropriate option from below. Note that you have to compute the updated word embedding for “good” and not its context embedding.

  1. A

    (1.76, -0.24)

  2. B

    (1.24, -0.76)

  3. C

    (1.76, 1.76)

  4. D

    (1.76, -1.76)

  5. E

    (1.24, -1.24)

Show answer

Correct answer

  • A

    (1.76, -0.24)

Question 14

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Find s1.

Show answer

Correct answer: 0.25

Question 15

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Find s2.

Show answer

Correct answer: 0.5

Question 16

+1 markNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 1

Question 17

+3 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.125

Question 18

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 2

Question 19

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 1