Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DEGREE LEVEL : LARGE LANGUAGE MODELS (COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
In a self-attention mechanism, let the input be a matrix
, where
is the sequence length. If the dimension of the query projection matrix is
, what is the dimension of the Query matrix
?
Solution
In the scaled dot-product attention equation
, what is
the primary reason for dividing the dot product by
?
the primary reason for dividing the dot product by
Solution
Consider a Transformer Encoder stack consisting of
identical layers. If the input to the first layer is a sequence of word embeddings of shape
(where
and
), what is the shape of the output of the final (6th) layer?
Solution
In a standard Transformer encoder-decoder architecture, is masking typically applied in the cross- attention layer?
Solution
Consider the BERT architecture. During pre-training, it uses segment embeddings (
) to distinguish between sentences. However, during fine-tuning for a single-sentence classification task (e.g., Sentiment Analysis), how are these segment embeddings typically utilized?
Solution
Consider a decoding step in a language model where the logits for the next token are
. We apply a temperature scaling
before the softmax. As
(approaches zero), what does the resulting probability distribution
look like?
Solution
You are fine-tuning a pre-trained BERT model for a spam classification task. The input sequence is:
. Which vector from the final layer output is typically passed to the classification head (
)?
Solution
Select all statements that correctly describe the motivation and behavior of Multi-Head Attention as compared to single-head attention.
Solution
Given the vectorized self-attention calculation
, select all true statements regarding the matrix dimensions and operations. Assume
.
Solution
In the context of the Transformer architecture, which of the following statements correctly describe the source of the Query (
), Key (
), and Value (
) vectors during the Cross-Attention (Encoder-Decoder Attention) mechanism?
Solution
Consider the positional encoding for a given position
and dimension
is defined by:


Consider a Transformer model with a hidden state dimension
. You are calculating the positional embedding for the 4th word in a sequence (index
, using 0-based indexing). Calculate the value of the 6th element (index
) of the positional embedding vector for this word. (use radians for angle)
Consider a Transformer model with a hidden state dimension
Solution
Compute the attention score for hidden state
using the given function. Enter the final answer correct to two decimal places.
Solution
Normalize the attention scores using the softmax function to obtain the attention weights
. Submit
(i.e., the first element of the
vector). Enter the final answer correct to two decimal places.

Solution
Calculate the context vector
:

Provide the sum of all elements of
. Enter the final answer correct to two decimal places.
Provide the sum of all elements of
Solution
What is the number of parameters in the token embedding matrix?
Solution
What is the total number of parameters in the positional embedding matrix?
Solution
For ONE complete attention head, what is the total number of parameters (Q + K + V projections combined)?
Solution
After the multi-head attention computation, all head outputs are concatenated and projected back to the model dimension.
How many parameters are in the output projection matrix (weights only, excluding bias)?
How many parameters are in the output projection matrix (weights only, excluding bias)?
Solution
What is the total number of parameters in the complete FFN (including both weight matrices and bias vectors)?
Solution
Shape
Thickness [ / ]
3
All colors