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.
- 18
- 40
- 120 min
- 4
- 4
- 10
Show answer
Correct answer
Question 2
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
Assertion and Reason are both true and Reason is a correct explanation of Assertion.
Assertion and Reason are both true and Reason is not a correct explanation of Assertion.
Assertion is true but Reason is false.
Assertion is false but Reason is true.
Show answer
Correct answer
Assertion is false but Reason is true.
Question 3
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
Beam search with beam size 1
Greedy approach
Top-K with k = 2
None of these
Show answer
Correct answer
Top-K with k = 2
Question 4
Which of the following models, in general, struggle to encode a context when translating long sentences?
An RNN model
An RNN model with attention mechanism
A transformer model
Show answer
Correct answer
An RNN model
Question 5
Choose the correct statements
All the parameters of the GPT model are randomly initialized during pre- training
The model minimizes the CLM objective during fine-tuning to improve the performance
All parameters of the GPT model are randomly initialized during fine-tuning
In general, fine-tuning requires a dataset with labels
Show answer
Correct answers
All the parameters of the GPT model are randomly initialized during pre- training
In general, fine-tuning requires a dataset with labels
Question 6
Show answer
Correct answers
Question 7
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.
Top-k sampling
Beam search with the beam size K = 2
Top-p sampling
Exhaustive search
None of these
Show answer
Correct answers
Beam search with the beam size K = 2
Exhaustive search
Question 8
Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.
- Source vocabulary size
- Target vocabulary size
- maximum sequence length
- length of context window for both encoder and decoder
- number of heads
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
Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.
- Source vocabulary size
- Target vocabulary size
- maximum sequence length
- length of context window for both encoder and decoder
- number of heads
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
Consider the following configuration for the Vannila transformer architecture with one encoder layer and one decoder layer.
- Source vocabulary size
- Target vocabulary size
- maximum sequence length
- length of context window for both encoder and decoder
- number of heads
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
Consider following input matrix to a single neural network layer:
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 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?
Show answer
Correct answer: 0.005 (accepted within ±0.005)
Question 12
Consider following input matrix to a single neural network layer:
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 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?
Show answer
Correct answer: 0.005 (accepted within ±0.005)
Question 13
Consider following input matrix to a single neural network layer:
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 and 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
Consider following input matrix to a single neural network layer:
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 and 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
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.
represents 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
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.
represents 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
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.
represents 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
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.
represents 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”:
broken
acted
highest
None of these
Show answer
Correct answer
broken