Question 1
Teacher forcing for training an transformer model is:
mandatory.
optional.
The IIT Madras BS Large Language Models (LLM) Quiz 1 paper sat on 27 Oct 2024, in the September 2024 term: 19 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.
Teacher forcing for training an transformer model is:
mandatory.
optional.
Correct answer
optional.
Choose the correct statements regarding transformer architecture:
Residual connections are practically optional in a transformer model with 10 encoder layers and 10 decoder layers.
Having multiple heads helps in capturing different relationships between input tokens.
One hot encoding is a good choice for position encoding.
Batch normalization can be used instead of layer normalization.
None of these.
Correct answer
Having multiple heads helps in capturing different relationships between input tokens.
Based on the above data, answer the given subquestions.
Assume the model has two layers (N = 2). Calculate the total number of parameters in the model (excluding the embedding layer and output layer). Moreover, no bias was added to the neuron in the FFNN layers.
Correct answer: 230656
Based on the above data, answer the given subquestions.
How many parameters does the output layer have?
Correct answer: 48000
Based on the above data, answer the given subquestions.
How many parameters does the embedding layer have?
Correct answer: 32000
Based on the above data, answer the given subquestions.
At time step t = 1, the prediction probability for the words “Naan”, “transformer” and “padaththai” are 0.55,0.15 and 0.2, respectively. What is the probability for the word “rasithen”? If you think, the given information is insufficient enter -1
Correct answer: -1
Consider following input matrix to a single neural network layer:
It has 3 samples with 3 features each i.e. batch size is 3. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.
Note: assume , and 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?
Correct answer: 0.005 (accepted within ±0.005)
Consider following input matrix to a single neural network layer:
It has 3 samples with 3 features each i.e. batch size is 3. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.
Note: assume , and 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?
Correct answer: 0.005 (accepted within ±0.005)
Consider following input matrix to a single neural network layer:
It has 3 samples with 3 features each i.e. batch size is 3. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.
Note: assume , and for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.
Based on the above data, answer the given subquestions.
Correct answer: 9 (accepted within ±0.05)
Consider following input matrix to a single neural network layer:
It has 3 samples with 3 features each i.e. batch size is 3. Each column represents a sample. Left most column represents the first sample and topmost row represents the first feature vector.
Note: assume , and for both batch and layer normalization, if not mentioned explicitly. Use standard scaling.
Based on the above data, answer the given subquestions.
Correct answer: 12.5 (accepted within ±0.05)
Consider a vocabulary ,
([start], breaking, ground, a, is, seismology, study, experience, earth quake,[end]).
Assume that we have a pre-trained GPT model for text generation and the first input token to the model is always the special token [start]. The prediction probabilities outputted by the model are given below.
The columns of the matrix are in the same order as the words listed in the vocabulary set above
The zeroth row of the matrix is the output probability distribution by the model given the special [Start] token as input. Following the Greedy Search decoding strategy, the subsequent rows give the conditional probability distribution conditioned over the previous tokens. If you think the given information is insufficient for any sub-questions, then enter -1 as your answer
Based on the above data, answer the given subquestions.
Correct answer: 0.41
Consider a vocabulary ,
([start], breaking, ground, a, is, seismology, study, experience, earth quake,[end]).
Assume that we have a pre-trained GPT model for text generation and the first input token to the model is always the special token [start]. The prediction probabilities outputted by the model are given below.
The columns of the matrix are in the same order as the words listed in the vocabulary set above
The zeroth row of the matrix is the output probability distribution by the model given the special [Start] token as input. Following the Greedy Search decoding strategy, the subsequent rows give the conditional probability distribution conditioned over the previous tokens. If you think the given information is insufficient for any sub-questions, then enter -1 as your answer
Based on the above data, answer the given subquestions.
Correct answer: 1.6
Consider a vocabulary ,
([start], breaking, ground, a, is, seismology, study, experience, earth quake,[end]).
Assume that we have a pre-trained GPT model for text generation and the first input token to the model is always the special token [start]. The prediction probabilities outputted by the model are given below.
The columns of the matrix are in the same order as the words listed in the vocabulary set above
The zeroth row of the matrix is the output probability distribution by the model given the special [Start] token as input. Following the Greedy Search decoding strategy, the subsequent rows give the conditional probability distribution conditioned over the previous tokens. If you think the given information is insufficient for any sub-questions, then enter -1 as your answer
Based on the above data, answer the given subquestions.
Correct answer: -1
Consider a vocabulary ,
([start], breaking, ground, a, is, seismology, study, experience, earth quake,[end]).
Assume that we have a pre-trained GPT model for text generation and the first input token to the model is always the special token [start]. The prediction probabilities outputted by the model are given below.
The columns of the matrix are in the same order as the words listed in the vocabulary set above
The zeroth row of the matrix is the output probability distribution by the model given the special [Start] token as input. Following the Greedy Search decoding strategy, the subsequent rows give the conditional probability distribution conditioned over the previous tokens. If you think the given information is insufficient for any sub-questions, then enter -1 as your answer
Based on the above data, answer the given subquestions.
Suppose we use Top sampling, with , what is the probability of the predicted word equal to “Seismology” given the “[Start]“ token as the initial input ?
Correct answer: -1
Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he has configured the original architecture in the following manner:
Based on the above data, answer the given subquestions.
What will be the shape of positional embedding?
64 × 128
64 × 4
12 × 128
512 × 768
None of these.
Correct answer
64 × 128
Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he has configured the original architecture in the following manner:
Based on the above data, answer the given subquestions.
32 × 32
64 × 32
128 × 16
128 × 32
8 × 32
None of these.
Correct answer
128 × 32
Rajesh has created a GPT-like transformer model. However he doesn't have access to large compute infrastructure, so he has configured the original architecture in the following manner:
Based on the above data, answer the given subquestions.
16 × 16
32 × 32
64 × 64
128 × 128
None of these.
Correct answer
64 × 64
The input embeddings for the words “learning”, “brings” and “joy” are , , and , respectively. Note that the embeddings are row vectors. The projection matrices are as follows
The following quantities are computed as
Let denote the unnormalized attention score, denote the normalized attention score (ignore the scaling by ) and denote the linear combination of the value vectors for the word.
Suppose the gradient vector , then what is the gradient vector ? Enter the sum of gradients.
Correct answer: 0
Consider the embedding vector for a word, . Suppose the word is at position 2 in the given sentence. Add the corresponding position embedding to the word embedding to get , i.e. the sum of the elements in . Use the fixed-sinusoidal position embedding vector calculated using the formula given below
What is i.e. sum of first two elements of ?
Correct answer: 0.8 (accepted within ±0.05)