MauryaHub PYQ Practice

Large Language Models · End Term · May 2026 · AN

Large Language Models · End Term · May 2026 AN

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

0 / 20 published solutions

Question 2 MCQ · 2.0 marks

Consider the following Assertion (A) and Reason (R) about the Transformer encoder. **Assertion (A):** In a Transformer encoder, each token can attend to every other token in the input sequence through self-attention. **Reason (R):** The encoder's self-attention mechanism uses a causal mask to prevent each token from attending to tokens that appear later in the sequence. Choose the correct option:
6406537408066.
Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of Assertion (A).
6406537408067.
Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A).
6406537408068.
Assertion (A) is true, but Reason (R) is false.
6406537408069.
Assertion (A) is false, but Reason (R) is true
6406537408070.
Both Assertion (A) and Reason (R) are false.

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 MCQ · 2.0 marks

Which of the following statements regarding one-hot positional encoding and sinusoidal positional encoding is incorrect?
6406537408072.
The dot product between two sinusoidal positional encoding vectors strictly increases as the relative distance between their positions increases, taking values in the range [0,
Source diagram or notation
)
6406537408073.
The squared Euclidean norm of a sinusoidal positional encoding vector is a constant value independent of the position index
6406537408074.
For any two distinct positions, the dot product of their corresponding one-hot encoded vectors is zero, and the Euclidean distance between them is strictly constant
6406537408075.
One-hot positional encoding is incapable of mathematically representing relative distance between tokens

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 MCQ · 2.0 marks

You are designing an LLM to translate a sentence from English to Spanish with low computational complexity. The system has to consider a few possible sequences of words rather than committing to the single highest-probability word at every step. Which of the following decoding strategies is the most appropriate?
6406537408078.
Beam search
6406537408079.
Exhaustive search
6406537408080.
Top-p sampling with p = 0.85
6406537408081.
Greedy decoding

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 MCQ · 2.0 marks

In the Next Sentence Prediction task, how are the two input sentences distinguished by the BERT architecture?
6406537408082.
By utilizing separate transformer encoders for each sentence and concatenating the outputs.
6406537408083.
By adding learnable segment embeddings to the token and positional embeddings of the respective sentences.
6406537408084.
By inserting a [MASK] token between the two sentences.
6406537408085.
By ensuring two different heads in the Multi-Head Attention setup attend to the specific sentences.

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 NAT · 3.0 marks

Consider a mini-batch of 3 samples, each with 2 features. The input matrix X is given below, where rows represent individual samples and columns represent features:
Source diagram or notation
Layer Normalization is applied on this with a learned scale parameter
Source diagram or notation
and a shift parameter
Source diagram or notation
. What is the final output value of the first feature for the third sample?

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 SHORT_TEXT · 3.0 marks

Consider a tokenizer processing the word "lion". The vocabulary contains the following tokens along with the assigned log-probabilities.
Source diagram or notation
To determine the optimal tokenization, the tokenizer uses the forward decoding algorithm (Viterbi approach). Determine the most likely tokenization for the word "lion" using the algorithm. Instructions: Enter your answer as a lowercase string with the segments separated by a comma. For example, if the word is whereby and the answer has two segments where and by, enter the answer as **where,by** **NOTE:** Enter the exact answer without any extra space in the beginning or at the end.

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 NAT · 3.0 marks

Suppose the relative position between two tokens at positions
Source diagram or notation
and
Source diagram or notation
is defined as
Source diagram or notation
To limit the range of relative positions, clipping is applied using
Source diagram or notation
where
Source diagram or notation
. For a sequence of length
Source diagram or notation
, **how many pairwise relative-position values are modified** **by the clipping operation?**

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 NAT · 2.0 marks

Consider an LLM operating on a vocabulary consisting of 5 tokens. For a given context, the model produces the following logits:
Source diagram or notation
To obtain the next token during generation, the model uses top-p sampling with p = 0.80. Based on the above data, answer the given subquestions.
How many tokens are selected as candidate tokens?

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 NAT · 2.0 marks

Consider an LLM operating on a vocabulary consisting of 5 tokens. For a given context, the model produces the following logits:
Source diagram or notation
To obtain the next token during generation, the model uses top-p sampling with p = 0.80. Based on the above data, answer the given subquestions.
After renormalization of the probabilities, what is the highest probability value among those? (Round off to three decimal places)

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 MCQ · 3.0 marks

How did the GPT-2 model initially demonstrate "zero-shot domain transfer" capabilities on complex tasks like summarization and translation?
6406537408086.
By utilizing specialized adapter layers trained explicitly for translation and summarization datasets.
6406537408087.
By formatting the raw input text with natural language prompts to induce task-specific outputs without updating model weights.
6406537408088.
By executing a secondary pre-training phase exclusively on Wikipedia and BookCorpus.
6406537408089.
By modifying the decoder architecture into a bidirectional encoder for specific tasks.

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 MCQ · 3.0 marks

Match the following unsupervised objectives (I,II,III) to their corresponding Target output structures (A,B,C) based on the following: I. Prefix Language Modelling II. Masked Seq-to-Seq pretraining III. Random spans A. Interleaved sentinel tokens and missing text B. The entire original text sequence C. The suffix of the original text
6406537408090.
I-A, II-B, III-C
6406537408091.
I-B, II-C, III-A
6406537408092.
I-C, II-A, III-B
6406537408093.
I-C, II-B, III-A
6406537408094.
I-B, II-A, III-C

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 MCQ · 3.0 marks

Consider the original text "The quick brown fox jumps over the lazy dog". If the input for a prefix language modelling objective is "The quick brown fox", what will the target be?
6406537408095.Source diagram or notation
6406537408096.Source diagram or notation
6406537408097.Source diagram or notation
6406537408098.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 MCQ · 3.0 marks

Consider a transformer model that uses strided local attention with a fixed window size c. If the sequence length T is doubled, by what factor does the computational time complexity of the attention mechanism change?
6406537408101.
1
6406537408102.
2
6406537408103.
4
6406537408104.
8

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 MCQ · 3.0 marks

What is the primary trade-off made by utilizing KV Cache during autoregressive decoding?
6406537408105.
It reduces inference latency but utilizes smaller batch size
6406537408106.
It increases generation speed but reduces model accuracy
6406537408107.
It reduces computational overhead but increases memory usage
6406537408108.
It reduces training time by storing intermediate token representations

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 NAT · 4.0 marks

A Large Language model uses Grouped Query Attention with a KV cache during inference. Consider the following model configuration: • Precision: FP16 (16-bit floating point) • Number of Transformer layers : 32 • Number of Query attention heads : 32 • Number of Key attention heads : 8 • Number of Value attention heads : 8 • Head dimension : 128 • Batch size : 4 • Maximum sequence length per request : 1024 tokens **Assume 2 bytes per FP16 value and 1 MB = 1048576 bytes** **calculate the total memory required for the KV cache expressed in MB. Enter the value** **rounded to the nearest integer**

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MSQ · 3.0 marks

Which of the following statements about length generalization in Large Language Models (LLMs) are correct?
6406537408109.
Length generalization is the ability of an LLM to maintain effective performance on sequences longer than the sequence lengths predominantly used during training.
6406537408110.
Length generalization refers specifically to improving computational efficiency when processing longer sequences.
6406537408111.
Length generalization can depend on the model architecture, positional encoding scheme, training procedure, and the nature of the task.
6406537408112.
Exposure to a wider range of sequence lengths during training can improve an LLM's ability to generalize to longer sequences.

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 MCQ · 1.0 marks

Consider the following matrices for Transformer architechture. The token representations at positions
Source diagram or notation
and
Source diagram or notation
are
Source diagram or notation
The query and key projection matrices are
Source diagram or notation
and
Source diagram or notation
**RoPE Frequency** For RoPE, use the frequency formula
Source diagram or notation
All angles are measured in **radians**. **RoPE Rotation Matrix** For position
Source diagram or notation
, define the RoPE rotation matrix as
Source diagram or notation
The position-dependent query and key vectors are
Source diagram or notation
and
Source diagram or notation
Therefore, their unnormalized attention score is
Source diagram or notation
Using the property
Source diagram or notation
the attention score can be expressed using the relative position:
Source diagram or notation
where the relative position is
Source diagram or notation
. For
Source diagram or notation
calculate the unnormalized RoPE attention score
Source diagram or notation
Based on the above data, answer the given subquestions.
Compute
Source diagram or notation
and select the correct option
6406537408114.Source diagram or notation
6406537408115.Source diagram or notation
6406537408116.Source diagram or notation
6406537408117.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 MCQ · 1.0 marks

Consider the following matrices for Transformer architechture. The token representations at positions
Source diagram or notation
and
Source diagram or notation
are
Source diagram or notation
The query and key projection matrices are
Source diagram or notation
and
Source diagram or notation
**RoPE Frequency** For RoPE, use the frequency formula
Source diagram or notation
All angles are measured in **radians**. **RoPE Rotation Matrix** For position
Source diagram or notation
, define the RoPE rotation matrix as
Source diagram or notation
The position-dependent query and key vectors are
Source diagram or notation
and
Source diagram or notation
Therefore, their unnormalized attention score is
Source diagram or notation
Using the property
Source diagram or notation
the attention score can be expressed using the relative position:
Source diagram or notation
where the relative position is
Source diagram or notation
. For
Source diagram or notation
calculate the unnormalized RoPE attention score
Source diagram or notation
Based on the above data, answer the given subquestions.
Compute
Source diagram or notation
and select the correct option
6406537408118.Source diagram or notation
6406537408119.Source diagram or notation
6406537408120.Source diagram or notation
6406537408121.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 NAT · 2.0 marks

Consider the following matrices for Transformer architechture. The token representations at positions
Source diagram or notation
and
Source diagram or notation
are
Source diagram or notation
The query and key projection matrices are
Source diagram or notation
and
Source diagram or notation
**RoPE Frequency** For RoPE, use the frequency formula
Source diagram or notation
All angles are measured in **radians**. **RoPE Rotation Matrix** For position
Source diagram or notation
, define the RoPE rotation matrix as
Source diagram or notation
The position-dependent query and key vectors are
Source diagram or notation
and
Source diagram or notation
Therefore, their unnormalized attention score is
Source diagram or notation
Using the property
Source diagram or notation
the attention score can be expressed using the relative position:
Source diagram or notation
where the relative position is
Source diagram or notation
. For
Source diagram or notation
calculate the unnormalized RoPE attention score
Source diagram or notation
Based on the above data, answer the given subquestions.
Construct the corresponding RoPE rotation matrix (
Source diagram or notation
) and submit the maximum value in it. (correct upto 2 decimal places) • All angles are measured in **radians**.

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 NAT · 3.0 marks

Consider the following matrices for Transformer architechture. The token representations at positions
Source diagram or notation
and
Source diagram or notation
are
Source diagram or notation
The query and key projection matrices are
Source diagram or notation
and
Source diagram or notation
**RoPE Frequency** For RoPE, use the frequency formula
Source diagram or notation
All angles are measured in **radians**. **RoPE Rotation Matrix** For position
Source diagram or notation
, define the RoPE rotation matrix as
Source diagram or notation
The position-dependent query and key vectors are
Source diagram or notation
and
Source diagram or notation
Therefore, their unnormalized attention score is
Source diagram or notation
Using the property
Source diagram or notation
the attention score can be expressed using the relative position:
Source diagram or notation
where the relative position is
Source diagram or notation
. For
Source diagram or notation
calculate the unnormalized RoPE attention score
Source diagram or notation
Based on the above data, answer the given subquestions.
Computing the final dot product
Source diagram or notation
. (correct upto 2 decimal places)

A published solution is not available for this question yet.

Report a correction for Q21