uiz Space

January 2025 term · Large Language Models · BSDA5004

Large Language Models Quiz 1: 23 February 2025 (January 2025 term)

The IIT Madras BS Large Language Models (LLM) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term: 18 questions for 40 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
18
Marks
40
Duration
120 min
MCQ
4
MSQ
4
Numerical
10

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 23 Feb 2025 · No negative marking.

Question 1

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

Correct answer

  • D

Question 2

+2 marksOne correct option

Consider following assertion and reason pair:
Assertion: A transformer model cannot be trained in autogregressive mode for machine translation task.
Reason: Teacher forcing improves the convergence rate.
Choose the correct statements

  1. A

    Assertion and Reason are both true and Reason is a correct explanation of Assertion.

  2. B

    Assertion and Reason are both true and Reason is not a correct explanation of Assertion.

  3. C

    Assertion is true but Reason is false.

  4. D

    Assertion is false but Reason is true.

Show answer

Correct answer

  • D

    Assertion is false but Reason is true.

Question 3

+3 marksOne correct option

Suppose we use a pre-trained model for text generation with the given prompt “I am going to”. Which of the following decoding strategies can be used such that the pre-trained model generates different text completion each time it is executed

  1. A

    Beam search with beam size 1

  2. B

    Greedy approach

  3. C

    Top-K with k = 2

  4. D

    None of these

Show answer

Correct answer

  • C

    Top-K with k = 2

Question 4

+2 marksOne or more correct options

Which of the following models, in general, struggle to encode a context when translating long sentences?

Select all that apply.

  1. A

    An RNN model

  2. B

    An RNN model with attention mechanism

  3. C

    A transformer model

Show answer

Correct answer

  • A

    An RNN model

Question 5

+2 marksOne or more correct options

Choose the correct statements

Select all that apply.

  1. A

    All the parameters of the GPT model are randomly initialized during pre- training

  2. B

    The model minimizes the CLM objective during fine-tuning to improve the performance

  3. C

    All parameters of the GPT model are randomly initialized during fine-tuning

  4. D

    In general, fine-tuning requires a dataset with labels

Show answer

Correct answers

  • A

    All the parameters of the GPT model are randomly initialized during pre- training

  • D

    In general, fine-tuning requires a dataset with labels

Question 6

+3 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • C

Question 7

+3 marksOne or more correct options

Which of the following decoding strategies is (are) appropriate for machine translation tasks? Assume we have infinite compute and the values for k ≥ 3, p > 0.35 where required.

Select all that apply.

  1. A

    Top-k sampling

  2. B

    Beam search with the beam size K = 2

  3. C

    Top-p sampling

  4. D

    Exhaustive search

  5. E

    None of these

Show answer

Correct answers

  • B

    Beam search with the beam size K = 2

  • D

    Exhaustive search

Question 8

+2 marksNumerical answer

Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.

  • Source vocabulary size =100= 100
  • Target vocabulary size =200= 200
  • maximum sequence length =32= 32
  • length of context window (T)(T) for both encoder and decoder =32= 32
  • number of heads nh=4n_h = 4
  • dff=4∗dmodeldff = 4 * dmodel
  • dq=dk=dv=dmodelnhdq = dk = dv = \frac{dmodel}{n_h}

Based on the above data, answer the given subquestions.

Suppose the number of learnable parameters in the source input-embedding layer is 3200, how many parameters are there in the positional embedding layer of the source language?

Show answer

Correct answer: 1024

Question 9

+3 marksNumerical answer

Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.

  • Source vocabulary size =100= 100
  • Target vocabulary size =200= 200
  • maximum sequence length =32= 32
  • length of context window (T)(T) for both encoder and decoder =32= 32
  • number of heads nh=4n_h = 4
  • dff=4∗dmodeldff = 4 * dmodel
  • dq=dk=dv=dmodelnhdq = dk = dv = \frac{dmodel}{n_h}

Based on the above data, answer the given subquestions.

How many parameters are there in the multi-head attention layer of the encoder (exclude the parameters in the WO matrix used for linear transformation and FFN layer)?

Show answer

Correct answer: 3072

Question 10

+3 marksNumerical answer

Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.

  • Source vocabulary size =100= 100
  • Target vocabulary size =200= 200
  • maximum sequence length =32= 32
  • length of context window (T)(T) for both encoder and decoder =32= 32
  • number of heads nh=4n_h = 4
  • dff=4∗dmodeldff = 4 * dmodel
  • dq=dk=dv=dmodelnhdq = dk = dv = \frac{dmodel}{n_h}

Based on the above data, answer the given subquestions.

How many parameters does the matrix WQ have in anyone head of the encoder?

Show answer

Correct answer: 256

Question 11

+1 markNumerical answer

Consider following input matrix to a single neural network layer:

X=[1238471114]X = \begin{bmatrix} 1 & 2 & 3 & 8 \\ 4 & 7 & 11 & 14 \end{bmatrix}

It has 4 samples with 2 features each i.e. batch size is 4. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.

Note: assume γ=1,β=0\gamma = 1, \beta = 0 and ϵ=10−6\epsilon = 10^{-6} for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.

Based on the above data, answer the given subquestions.

Say matrix F is computed by applying batch normalization on X, what will be sum of every element in first / topmost row of F?

Show answer

Correct answer: 0.005 (accepted within ±0.005)

Question 12

+1 markNumerical answer

Consider following input matrix to a single neural network layer:

X=[1238471114]X = \begin{bmatrix} 1 & 2 & 3 & 8 \\ 4 & 7 & 11 & 14 \end{bmatrix}

It has 4 samples with 2 features each i.e. batch size is 4. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.

Note: assume γ=1,β=0\gamma = 1, \beta = 0 and ϵ=10−6\epsilon = 10^{-6} for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.

Based on the above data, answer the given subquestions.

Say matrix F is computed by applying layer normalization on X, what will be sum of every element in first / leftmost column of F?

Show answer

Correct answer: 0.005 (accepted within ±0.005)

Question 13

+2 marksNumerical answer

Consider following input matrix to a single neural network layer:

X=[1238471114]X = \begin{bmatrix} 1 & 2 & 3 & 8 \\ 4 & 7 & 11 & 14 \end{bmatrix}

It has 4 samples with 2 features each i.e. batch size is 4. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.

Note: assume γ=1,β=0\gamma = 1, \beta = 0 and ϵ=10−6\epsilon = 10^{-6} for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 11 (accepted within ±0.05)

Question 14

+2 marksNumerical answer

Consider following input matrix to a single neural network layer:

X=[1238471114]X = \begin{bmatrix} 1 & 2 & 3 & 8 \\ 4 & 7 & 11 & 14 \end{bmatrix}

It has 4 samples with 2 features each i.e. batch size is 4. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.

Note: assume γ=1,β=0\gamma = 1, \beta = 0 and ϵ=10−6\epsilon = 10^{-6} for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 6.5 (accepted within ±0.05)

Question 15

+2 marksNumerical answer

Consider following corpus (in italics), which is used train a GPT like (i.e. decoder only) model for causal language modeling:

Sachin Tendulkar is called God of Cricket. Sachin has broken many records. Sachin has highest number of centuries.

Sachin Pilgaonkar is a famous actor in Marathi cinema. Sachin has acted in, directed and produced numerous films. Sachin has broken many stereotypes.

Assume each word in the above corpus is a token. Tokens are case insensitive i.e. “The” is same as “the”. Ignore special characters (e.g. period (.), semi colon (;), etc.)

Note: Estimate the joint probabilities using the Bayesian approach (no independence assumption) for the given corpus.

xix_i represents ithi^{th} token from left to right. Tokens appear in italics.

Answer the given sub questions:

Show answer

Correct answer: 1.42 (accepted within ±0.05)

Question 16

+2 marksNumerical answer

Consider following corpus (in italics), which is used train a GPT like (i.e. decoder only) model for causal language modeling:

Sachin Tendulkar is called God of Cricket. Sachin has broken many records. Sachin has highest number of centuries.

Sachin Pilgaonkar is a famous actor in Marathi cinema. Sachin has acted in, directed and produced numerous films. Sachin has broken many stereotypes.

Assume each word in the above corpus is a token. Tokens are case insensitive i.e. “The” is same as “the”. Ignore special characters (e.g. period (.), semi colon (;), etc.)

Note: Estimate the joint probabilities using the Bayesian approach (no independence assumption) for the given corpus.

xix_i represents ithi^{th} token from left to right. Tokens appear in italics.

Answer the given sub questions:

Show answer

Correct answer: 2.38 (accepted within ±0.05)

Question 17

+3 marksNumerical answer

Consider following corpus (in italics), which is used train a GPT like (i.e. decoder only) model for causal language modeling:

Sachin Tendulkar is called God of Cricket. Sachin has broken many records. Sachin has highest number of centuries.

Sachin Pilgaonkar is a famous actor in Marathi cinema. Sachin has acted in, directed and produced numerous films. Sachin has broken many stereotypes.

Assume each word in the above corpus is a token. Tokens are case insensitive i.e. “The” is same as “the”. Ignore special characters (e.g. period (.), semi colon (;), etc.)

Note: Estimate the joint probabilities using the Bayesian approach (no independence assumption) for the given corpus.

xix_i represents ithi^{th} token from left to right. Tokens appear in italics.

Answer the given sub questions:

Show answer

Correct answer: 2.38 (accepted within ±0.05)

Question 18

+2 marksOne correct option

Consider following corpus (in italics), which is used train a GPT like (i.e. decoder only) model for causal language modeling:

Sachin Tendulkar is called God of Cricket. Sachin has broken many records. Sachin has highest number of centuries.

Sachin Pilgaonkar is a famous actor in Marathi cinema. Sachin has acted in, directed and produced numerous films. Sachin has broken many stereotypes.

Assume each word in the above corpus is a token. Tokens are case insensitive i.e. “The” is same as “the”. Ignore special characters (e.g. period (.), semi colon (;), etc.)

Note: Estimate the joint probabilities using the Bayesian approach (no independence assumption) for the given corpus.

xix_i represents ithi^{th} token from left to right. Tokens appear in italics.

Answer the given sub questions:

Once the model is sufficiently trained, which of the following tokens will have the highest probability to be the next token, if the input is “Sachin has”:

  1. A

    broken

  2. B

    acted

  3. C

    highest

  4. D

    None of these

Show answer

Correct answer

  • A

    broken