MauryaHub PYQ Practice

Large Language Models · End Term · May 2026 · FN

Large Language Models · End Term · May 2026 FN

← 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 NAT · 2.0 marks

Consider a Multi-Head Attention sub-layer with the following hyper-parameters: • Embedding dimension (
Source diagram or notation
) = 256 • Number of heads (
Source diagram or notation
) = 4 • key/value dimension per head (
Source diagram or notation
) =
Source diagram or notation
. Calculate the total number of trainable parameters contained **only** in the projection matrices
Source diagram or notation
and
Source diagram or notation
. (Ignore biases). Enter the integer value.

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 NAT · 2.0 marks

For T5-Base, the model dimension is 768 and FFN dimension is 3072. Ignore bias. Find the number of parameters in the FFN of one encoder layer.

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 NAT · 3.0 marks

A batch of 5 sentences is passed through a Transformer Encoder. The sequences are padded to a maximum length of 20 tokens. The embedding dimension (
Source diagram or notation
) is 64. What is the total number of elements (volume) in the output tensor produced by the final layer of the encoder for this batch?

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 NAT · 3.0 marks

Calculate the KV Cache memory size in Megabytes for a single request (batch size = 1) with the following parameters: • Number of layers: 24 • Embedding dimension (d_model): 1024 • Sequence length (n): 2048 tokens • Precision: 16-bit (2 bytes per element) • Assume standard Multi-Head Attention (MHA) where total KV dimension per layer is 2 x d_model (2 for K+V)

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 MCQ · 2.0 marks

In BERT's Next Sentence Prediction task, how are the negative (NotNext) examples created?
6406536959407.
By taking the sentence that immediately precedes the current sentence.
6406536959408.
By reversing the word order of the actual next sentence.
6406536959409.
By picking a random sentence from the corpus (50% of the time).
6406536959410.
By masking all verbs in the actual next sentence.

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 MCQ · 2.0 marks

What happens when a very large model is trained for many epochs on a relatively small dataset in the T5 scaling-law setting?
6406536959433.
The performance continues to improve linearly with more training steps.
6406536959434.
The performance degrades due to overfitting (memorization) of the training data.
6406536959435.
The model automatically learns to augment the data, preventing overfitting.
6406536959436.
The performance plateaus but does not degrade.

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 MCQ · 2.0 marks

**PagedAttention** is designed to address which specific inefficiency in Large Language Model (LLM) serving?
6406536959446.
High computational latency of matrix multiplication.
6406536959447.
Memory fragmentation and waste in the KV cache due to pre-allocating contiguous memory blocks for variable-length sequences.
6406536959448.
Low bandwidth of the internet connection during API calls.
6406536959449.
The difficulty of training models on long sequences.

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 MCQ · 2.0 marks

The standard Self-Attention mechanism has a time complexity of
Source diagram or notation
, where
Source diagram or notation
is the sequence length and
Source diagram or notation
is the embedding dimension. In Kernel-based Linear Attention methods (like Linear Transformers), the associativity of matrix multiplication is exploited to compute
Source diagram or notation
instead of
Source diagram or notation
. What is the resulting time complexity of this Linear Attention mechanism?
6406536959451.Source diagram or notation
6406536959452.Source diagram or notation
6406536959453.Source diagram or notation
6406536959454.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 MCQ · 2.0 marks

In a standard Transformer layer utilizing Rotary Positional Embeddings (RoPE), at which specific stage of the forward pass is the rotary transformation applied?
6406536959459.
To the input embeddings
Source diagram or notation
immediately before the Linear projections for
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
.
6406536959460.
To the
Source diagram or notation
and
Source diagram or notation
vectors simultaneously using a coupled weight matrix within the Attention head.
6406536959461.
To the
Source diagram or notation
and
Source diagram or notation
vectors independently, after their linear projections but before the scaled dot-product calculation.
6406536959462.
To the
Source diagram or notation
and
Source diagram or notation
vectors after the linear projections to ensure the entire latent space is rotationally invariant.

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 MCQ · 2.0 marks

In a Transformer using ALiBi, the attention score is modified as:
Source diagram or notation
Suppose a researcher proposes modifying ALiBi to:
Source diagram or notation
and claims that: “The model will still learn to focus on nearby tokens through training.” Which of the following is the most accurate critique of this proposal?
6406536959467.
The modification will not affect attention behavior significantly because softmax normalizes all scores, making additive biases irrelevant.
6406536959468.
The modification will cause instability because the attention scores will become negative for nearby tokens and positive for distant tokens.
6406536959469.
The modification is equivalent to scaling (Q) and (K) vectors differently and therefore does not fundamentally change the positional bias.
6406536959470.
The modification will bias attention toward distant tokens, and due to the exponential nature of softmax, this effect can dominate learned
Source diagram or notation
similarities, making it difficult for training to recover locality.

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 MSQ · 3.0 marks

Comparing the architectures of BERT and GPT, select all the **structural differences** that are true.
6406536959411.
BERT uses bidirectional self-attention, allowing tokens to attend to both left and right contexts.
6406536959412.
GPT uses masked (causal) self-attention, allowing tokens to attend only to previous tokens.
6406536959413.
BERT is an autoregressive model, while GPT is an autoencoding model.
6406536959414.
During pre-training, BERT predicts masked tokens, whereas GPT predicts the next token in the sequence.

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 MSQ · 3.0 marks

Based on the architectural comparison experiments (Encoder-Decoder vs. Decoder-only vs. Encoder-only) discussed in the lectures:
6406536959437.
Encoder-Decoder architectures generally perform best for sequence-to- sequence tasks like Translation and Summarization.
6406536959438.
A Decoder-only model with a **Prefix-LM** objective can match the performance of an Encoder-Decoder model.
6406536959439.
Sharing parameters between the encoder and decoder always improves performance regardless of task.
6406536959440.
Encoder-only models (like BERT) are typically less suitable for generation tasks compared to Encoder-Decoder models.

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 MSQ · 3.0 marks

Select all true statements regarding **KV Caching** during the autoregressive inference of LLMs.
6406536959455.
It trades off increased memory usage for reduced computational latency.
6406536959456.
It avoids recomputing the Key and Value vectors for tokens that have already been processed in previous steps.
6406536959457.
It is essential during the training phase to speed up backpropagation.
6406536959458.
The memory required for the KV cache grows linearly with the sequence length and batch size.

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 MSQ · 2.0 marks

Select all correct statements regarding Decoding Strategies in language generation.
6406536959415.
Beam Search with a beam width
Source diagram or notation
is mathematically equivalent to Greedy Search.
6406536959416.
Greedy search is deterministic and often leads to repetitive or degenerative text loops.
6406536959417.
Top-
Source diagram or notation
sampling guarantees that the generated text will always be grammatically correct.
6406536959418.
Top-
Source diagram or notation
(Nucleus) sampling allows for a dynamic vocabulary size at each step, whereas Top-
Source diagram or notation
uses a fixed number of candidates.

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 MSQ · 2.0 marks

In a feature-based approach using a pretrained transformer (like BERT) for a Multiple-Choice QA task, which of the following statements regarding the methodology are correct? (Select all that apply)
6406536959419.
The weights of the pretrained transformer are updated via backpropagation during the training phase.
6406536959420.
The input must be formatted as multiple pairs, such as [CLS] Question [SEP] Choice_n, creating a distinct representation for each candidate answer.
6406536959421.
The final prediction is determined by passing the fixed output representations through a trainable linear layer and applying a Softmax function.
6406536959422.
The model generates the correct answer string token-by-token using an autoregressive decoding strategy like Greedy Search.

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MCQ · 3.0 marks

A Transformer processes a sequence of length 5 using 6 identical self-attention layers. Count the total number of allowed attention links across all layers and Choose the option representing the correct pair (A) BERT (B) GPT
6406536959423.
BERT: 150, GPT: 90
6406536959424.
BERT: 90, GPT: 150
6406536959425.
BERT: 150, GPT: 150
6406536959426.
BERT: 90, GPT: 90
6406536959427.
BERT: 30, GPT: 36
6406536959428.
BERT: 36, GPT: 30

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 MCQ · 3.0 marks

Consider the architecture of **BART**. Which of the following descriptions best match its structural design?
6406536959429.
A Decoder-only model similar to GPT, but with bidirectional attention in the first layer.
6406536959430.
An Encoder-only model similar to BERT, but trained with a causal masking objective.
6406536959431.
An encoder-decoder model where the encoder processes a corrupted input bidirectionally and the decoder autoregressively reconstructs the original sequence.
6406536959432.
A dual-encoder model where one encoder processes the context and another processes the query.

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 MCQ · 3.0 marks

Why is **Flash Attention** considered an "IO-aware" algorithm?
6406536959442.
It reduces the number of parameters in the model to fit in GPU memory.
6406536959443.
It compresses the input data using JPEG-like encoding before processing.
6406536959444.
It optimizes the movement of data between the high-bandwidth memory (HBM) and the faster on-chip SRAM to avoid memory bandwidth bottlenecks.
6406536959445.
It writes all intermediate attention matrices to the hard disk to save RAM.

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 MCQ · 3.0 marks

In a transformer with relative positional encoding (RPE), attention logits between a query at position 4 and keys at positions 2 and 6 depend on relative distances
Source diagram or notation
where
Source diagram or notation
is the position of query and
Source diagram or notation
is the position of key. Suppose the learned scalar biases as per RPE are: •
Source diagram or notation
•
Source diagram or notation
•
Source diagram or notation
•
Source diagram or notation
•
Source diagram or notation
The base (content-only) attention logits are: •
Source diagram or notation
•
Source diagram or notation
What are the final attention logits after incorporating RPE?
6406536959463.Source diagram or notation
6406536959464.Source diagram or notation
6406536959465.Source diagram or notation
6406536959466.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 MCQ · 3.0 marks

An engineer is designing a Transformer model capable of length extrapolation (handling sequences longer than those seen during training) while minimizing the number of trainable weights. They are evaluating Absolute Positional Encodings (APE), Relative Positional Encodings (RPE), Rotary Positional Encodings (RoPE), and Attention with Linear Biases (ALiBi).Which of the following statements correctly describes the parameterization and behavior of these techniques?
6406536959471.
RoPE is considered a learned encoding because the model must optimize the rotation angles
Source diagram or notation
as trainable parameters during the backpropagation phase.
6406536959472.
The engineer should choose APE or RPE to minimize weights, as both rely exclusively on fixed sinusoidal functions without requiring a lookup table.
6406536959473.
RoPE and ALiBi are preferable for this use case because they utilize fixed mathematical transformations, whereas standard APE and RPE typically require learning position- specific embedding weights.
6406536959474.
ALiBi is the only technique among the four that requires the model to learn a unique "slope" parameter for each attention head to determine the rate of penalty decay.

A published solution is not available for this question yet.

Report a correction for Q21