Quiz Space

September 2024 term · Large Language Models · BSDA5004

LLM End Term: 22 December 2024, Set QDB4 (September 2024 term)

The IIT Madras BS Large Language Models (LLM) End Term paper sat on 22 Dec 2024, in the September 2024 term, set QDB4: 21 questions for 50 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
21
Marks
50
Duration
180 min
Numerical
6
MCQ
9
MSQ
5
Written
1

Updated

Official paper: IIT M DEGREE AN EXAM QDB4 22 Dec 2024 · No negative marking.

Question 1

+3 marksNumerical answer

The input embeddings for the words “learning”, “brings” and “joy” are h1=[1.0,0.5,1]h_1 = [1.0, 0.5, 1], h2=[1,0.25,0]h_2 = [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=[1110−11]WV=[00−1−111]W_Q = \begin{bmatrix} 1 & 1 \\ -1 & 1 \\ 0 & 1 \end{bmatrix} \quad W_K = \begin{bmatrix} 1 & 1 \\ 1 & 0 \\ -1 & 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.

Enter the value of first element i.e. with index (0,0) of ∂a3∂e3\frac{\partial a_3}{\partial e_3}

Show answer

Correct answer: 0.25 (accepted within ±0.05)

Question 2

+3 marksOne correct option

Assume that we have a large corpus of text. The vocabulary constructed from the text contains 10000 words. Of these, 100 words occurred only once in the entire corpus of text. The parameters of the embedding layer and the output layer of the model are shared. Suppose we create a batch of 256 samples (each sample is a sentence from the corpus). None of these samples contains any of the 100 rare words. Suppose we pre-train the model for one iteration using the batch of samples, then:

  1. A

    it is certain that the embeddings of none of these 100 rare words will get updated.

  2. B

    there is a chance that the embeddings of all or some of these 100 rare words will get updated

  3. C

    the embeddings of all these 100 rare words will defintely get updated

  4. D

    None of these

Show answer

Correct answer

  • B

    there is a chance that the embeddings of all or some of these 100 rare words will get updated

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 same text completion each time it is executed

  1. A

    Beam search with beam size 4

  2. B

    Greedy approach

  3. C

    Top-K with k = 2

  4. D

    None of these

Show answer

Correct answer

  • B

    Greedy approach

Question 4

+3 marksOne or more correct options

Assume that we have 12 sufficiently large supervised NLP datasets for different tasks like sentiment classification, textual entailment, language understanding and so on. Suppose we take all the samples (dropping labels) from these datasets to train the GPT model using the CLM objective.Then which of the following transfer learning approaches is (are) appropriate to transfer the knowledge to any of these 12 downstream tasks?

Select all that apply.

  1. A

    Zero shot learning

  2. B

    Few-shot learning

  3. C

    Full Fine-tuning

  4. D

    None of the given approaches are appropriate as the model has already been trained using samples from all the 12 datasets

Show answer

Correct answers

  • A

    Zero shot learning

  • B

    Few-shot learning

  • C

    Full Fine-tuning

Question 5

+2 marksOne correct option

What is the order of the language modeling pipeline?

  1. A

    First, the model, which handles text and returns raw predictions.The tokenizer then makes sense of these predictions and converts them back to text when needed.

  2. B

    First, the tokenizer, which handles text and returns IDs. The model handles these IDs and outputs a prediction, which can be some text.

  3. C

    The tokenizer handles text and returns IDs. The model handles these IDs and outputs a prediction. The tokenizer can then be used once again to convert these predictions back to some text.

  4. D

    None of these

Show answer

Correct answer

  • C

    The tokenizer handles text and returns IDs. The model handles these IDs and outputs a prediction. The tokenizer can then be used once again to convert these predictions back to some text.

Question 6

+2 marksOne correct option

Consider following statment and mark if it is true or false:
Repeating examples in the pre-training datasets are completely harmless for downstream performance.

  1. A

    TRUE

  2. B

    FALSE

Show answer

Correct answer

  • B

    FALSE

Question 7

+2 marksOne correct option

What is the time complexity of the computing attention matrix A with strided local attention (parameterized by c) and batch size of one? The symbols have the usual meaning.

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

Correct answer

  • A

Question 8

+2 marksOne correct option
  1. A

    k = 0 will perform same as compared to k = 600

  2. B

    k = 0 will perform worse compared to k = 600

  3. C

    k = 0 will perform better compared to k = 600

  4. D

    Value of k is irrelevant as the difference between position embeddings of two consicutive tokens remain the same.

Show answer

Correct answer

  • C

    k = 0 will perform better compared to k = 600

Question 9

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

Correct answer

  • A

Question 10

+2 marksNumerical answer

Consider the following dictionary with the number of word occurrences in a corpus:

python
wo = { "blast" : 2,
"bitterest" : 1,
"we" : 1,}

Note: Append </w> to each word at the end.

You will be working with word piece algorithm, answer the given sub questions in that context:

How many tokens are there in the initial vocabulary?

Show answer

Correct answer: 10

Question 11

+3 marksOne correct option

Consider the following dictionary with the number of word occurrences in a corpus:

python
wo = { "blast" : 2,
"bitterest" : 1,
"we" : 1,}

Note: Append </w> to each word at the end.

You will be working with word piece algorithm, answer the given sub questions in that context:

Which of the following pairs has the least score before any merge?

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

Correct answer

  • A

Question 12

+3 marksWritten answer

Consider the following dictionary with the number of word occurrences in a corpus:

python
wo = { "blast" : 2,
"bitterest" : 1,
"we" : 1,}

Note: Append </w> to each word at the end.

You will be working with word piece algorithm, answer the given sub questions in that context:

Which pair will be merged in the very first merge? Say the pair is (‘a’,‘b’), then enter “ab” (without quotes and white spaces). If there is a tie between two or more candidates, pick the one that occurs first in the original vocabulary.
NOTE: Enter the exact answer without any space in the beginning or at the end.

Show answer

Correct answer: la

Question 13

+3 marksNumerical answer

Consider the following dictionary with the number of word occurrences in a corpus:

python
wo = { "blast" : 2,
"bitterest" : 1,
"we" : 1,}

Note: Append </w> to each word at the end.

You will be working with word piece algorithm, answer the given sub questions in that context:

What is the score of the pair merged in the very first merge?

Show answer

Correct answer: 1.0

Question 14

+3 marksOne correct option

Consider the following dictionary with the number of word occurrences in a corpus:

python
wo = { "blast" : 2,
"bitterest" : 1,
"we" : 1,}

Note: Append </w> to each word at the end.

You will be working with word piece algorithm, answer the given sub questions in that context:

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

Correct answer

  • B

Question 15

+2 marksOne or more correct options

Consider the following statements about decreasing the size of the vocabulary

Select all that apply.

  1. A

    It increases number of tokens required to represent a sentence

  2. B

    It Increases the computational complexity computing attention matrix

  3. C

    It increases the context length T

  4. D

    None of these

Show answer

Correct answers

  • A

    It increases number of tokens required to represent a sentence

  • B

    It Increases the computational complexity computing attention matrix

  • C

    It increases the context length T

Question 16

+2 marksOne or more correct options

Choose the correct statements regarding an encoder-decoder transformer model:

Select all that apply.

  1. A

    Multi head masked attention block in decoder makes use of a mask.

  2. B

    Transformer model is an improvement over its RNN based predecessor for machine translation.

  3. C

    For machine tranlation task the input and output embedding layers have to be identical.

  4. D

    None of these.

Show answer

Correct answers

  • A

    Multi head masked attention block in decoder makes use of a mask.

  • B

    Transformer model is an improvement over its RNN based predecessor for machine translation.

Question 17

+2 marksOne or more correct options

Consider C4 pipeline. Which of the following will NOT pass through it as it is?

Select all that apply.

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

Correct answers

  • A
  • B
  • C
  • D
  • E

Question 18

+2 marksOne or more correct options

Which of the following are correct about GPT-1 model:

Select all that apply.

  1. A

    It is a decoder only model.

  2. B

    It uses absolute positional encoding.

  3. C

    It uses a composite dataset for pre-training.

  4. D

    None of these.

Show answer

Correct answers

  • A

    It is a decoder only model.

  • B

    It uses absolute positional encoding.

Question 19

+2 marksNumerical answer

How many entries of unnormalized attention matrix QK^(T) will be calculated with strided attention mechanism with c = 5. The sequence length is T = 32

Show answer

Correct answer: 164

Question 20

+2 marksNumerical answer

How many non zero entries will be there in the mask matrix M?

Show answer

Correct answer: 256

Question 21

+2 marksNumerical answer
Show answer

Correct answer: 3