MauryaHub PYQ Practice

Large Language Models · End Term · Jan 2026 · AN

Large Language Models · End Term · Jan 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

In the standard Transformer **Decoder**, the Multi-Head Attention layer is "Masked". What is the specific purpose of this mask during training?
6406536924689.
To filter out padding tokens to save computation.
6406536924690.
To prevent the model from attending to the [CLS] and [SEP] special tokens.
6406536924691.
To preserve the auto-regressive property by ensuring that the prediction for position
Source diagram or notation
can only depend on known outputs at positions less than
Source diagram or notation
(preventing "peeking" into the future).
6406536924692.
To force the model to focus on the Encoder output rather than the Decoder input.

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 MCQ · 2.0 marks

In the **Span Corruption** pre-training objective used by T5 (similar to the "Denoising" objective in BART), the input is:
Source diagram or notation
(where
Source diagram or notation
and
Source diagram or notation
represent masked spans). What is the corresponding **Target** sequence that the decoder is trained to generate?
6406536924699.Source diagram or notation
6406536924700.Source diagram or notation
(containing only the missing contents delimited by sentinels)
6406536924701.Source diagram or notation
(The full original sentence)
6406536924702.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 MCQ · 2.0 marks

In **Strided Local Attention**, each token attends only to a local window of neighbors. While this reduces computational complexity to
Source diagram or notation
(linear in
Source diagram or notation
), what is a significant limitation of a single layer of such attention?
6406536924730.
It has a limited receptive field and cannot capture long-range dependencies directly.
6406536924731.
It requires more memory than full attention.
6406536924732.
It cannot be parallelized on GPUs.
6406536924733.
It causes the gradients to explode.

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 MCQ · 2.0 marks

A transformer layer with absolute positional encoding and another with ALiBi are compared on sequences extended from length 128 to 512, without retraining. Which numerical behavior is most likely for ALiBi in this extrapolation scenario?
6406536924746.
Attention scores remain numerically well-shaped because ALiBi biases scale linearly with distance, not with a fixed maximum length.
6406536924747.
The model cannot compute positional information beyond 128 because ALiBi stores one embedding per absolute position up to 128 only.
6406536924748.
ALiBi attention becomes undefined for positions beyond 128 because its biases require precomputed lookup tables that stop at 128.
6406536924749.
Attention scores collapse to near zero for distant positions because ALiBi uses fixed sinusoidal patterns tied to the original length 128.

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 MSQ · 3.0 marks

Based on the BERT pre-training phase, select all correct constraints and properties regarding the input data.
6406536924693.
The maximum context length (sequence length) supported is 512 tokens.
6406536924694.
The input text must be contiguous (long-range contiguous text), meaning sentences are not shuffled randomly.
6406536924695.
The vocabulary is built using BPE encoding.
6406536924696.
Special tokens
Source diagram or notation
(at the start) and
Source diagram or notation
(to separate sentences) are explicitly added to the input sequence.

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 MSQ · 3.0 marks

Select the statements that correctly distinguish fine-tuning from zero-shot prompting for GPT-style models.
6406536924703.
In Fine-Tuning, the weights of the pre-trained model (and often a new specific head) are updated using backpropagation on a labeled dataset.
6406536924704.
In Zero-Shot Prompting, the model weights are **frozen** (not updated); the task is formulated purely through the design of the input text (prompt).
6406536924705.
Zero-Shot Prompting generally achieves higher accuracy than Fine-Tuning when abundant labeled data is available.
6406536924706.
Fine-Tuning typically requires a task-specific output layer (like a linear classifier), whereas Zero-Shot Prompting relies on the model generating text directly.

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 NAT · 2.0 marks

You are using **Top-**
Source diagram or notation
**(Nucleus) Sampling** with
Source diagram or notation
.The model outputs the following sorted probability distribution for the next token: • "apple": 0.40 • "banana": 0.25 • "cherry": 0.15 • "date": 0.10 • "elderberry": 0.10 How many tokens will be included in the candidate pool from which the final token is sampled? Enter the integer count.

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 NAT · 2.0 marks

A Large Language Model is pre-trained for
Source diagram or notation
Source diagram or notation
steps. The batch size is
Source diagram or notation
sequences. The sequence length (context window) is
Source diagram or notation
tokens. Calculate the total number of **tokens** the model sees during pre-training.Enter your answer in **Billions (B)**. (e.g., if the answer is 500 Billion, enter 500).

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 NAT · 2.0 marks

The computational complexity and memory requirement of the Self-Attention mechanism is quadratic with respect to the sequence length
Source diagram or notation
. Specifically, the Attention Score matrix has a size of
Source diagram or notation
. If you **double** the input sequence length
Source diagram or notation
(e.g., from 512 to 1024) while keeping the embedding dimension (
Source diagram or notation
) constant, by what **factor** does the memory required to store the Attention Score matrix increase? Enter the integer value.

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 NAT · 3.0 marks

Suppose a language model outputs the following logits for a vocabulary of size 4:
Source diagram or notation
You apply High Temperature Sampling with temperature
Source diagram or notation
. After applying the softmax on the temperature-scaled logits, what is the probability assigned to the token "apple"? (Give your answer up to 2 decimal places). First, apply temperature scaling with
Source diagram or notation
:

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 NAT · 3.0 marks

Consider a **Strided Local Attention** mechanism where each token attends to a window of
Source diagram or notation
tokens (
Source diagram or notation
left,
Source diagram or notation
right). • Sequence Length (
Source diagram or notation
) = 1000 • Embedding Dimension (
Source diagram or notation
) = 64 • Window Size (
Source diagram or notation
) = 10 How many multiplications are performed to compute the unnormalized attention scores (
Source diagram or notation
) for one attention head?

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 MCQ · 3.0 marks

**Adapter Layers** are a parameter-efficient fine-tuning strategy. Where are these layers typically inserted within a Transformer block?
6406536924708.
Before the Self-Attention mechanism only.
6406536924709.
After the Feed-Forward Network (FFN) block and/or after the Self-Attention block.
6406536924710.
Replacing the Layer Normalization parameters.
6406536924711.
In parallel to the main residual connection.

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 MCQ · 3.0 marks

Why do standard LLM architectures include explicit Positional Encodings (like RoPE or Sinusoidal) despite the causal mask providing some implicit order?
6406536924716.
To reduce the memory footprint of the
Source diagram or notation
and
Source diagram or notation
matrices.
6406536924717.
To ensure that the model can only attend to future tokens.
6406536924718.
To provide a strong inductive bias that allows the model to learn structural and distance-based relationships more efficiently than relying on masking alone.
6406536924719.
To fix a mathematical error in the original Dot-Product Attention formula.

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 MCQ · 3.0 marks

In the context of **Grouped Query Attention (GQA)**, if we have
Source diagram or notation
query heads and
Source diagram or notation
groups, how many Key/Value heads are trained?
6406536924726.
1 Key/Value head (same as MQA).
6406536924727.Source diagram or notation
Key/Value heads (same as MHA).
6406536924728.Source diagram or notation
Key/Value heads (where
Source diagram or notation
).
6406536924729.Source diagram or notation
Key/Value heads.

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 MCQ · 3.0 marks

Consider **Multi-Query Attention (MQA)**. How does its architecture differ from standard Multi- Head Attention (MHA) to improve inference efficiency?
6406536924734.
It uses multiple query heads but only a single attention head.
6406536924735.
It maintains multiple Query heads but shares a single Key and Value head across all Query heads.
6406536924736.
It quantizes the Query vectors to 4 bits.
6406536924737.
It removes the Value vectors entirely and uses Keys as Values.

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MCQ · 3.0 marks

In a transformer with relative positional encoding (RPE), attention logits between a query at position 5 and keys at positions 3 and 7 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?
6406536924742.Source diagram or notation
6406536924743.Source diagram or notation
6406536924744.Source diagram or notation
6406536924745.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 MCQ · 3.0 marks

In ALiBi, the attention score is modified using a distance-based bias Suppose for a head the slope is:
Source diagram or notation
For a query at position
Source diagram or notation
, attending to keys at positions
Source diagram or notation
: What ALiBi bias values are subtracted from the logits for keys at positions 3, 5, and 8, respectively? Note: Assume absolute distances.
6406536924750.Source diagram or notation
6406536924751.Source diagram or notation
6406536924752.Source diagram or notation
6406536924753.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 MSQ · 2.0 marks

Which of the following statements about fine-tuning strategies such as gradual unfreezing and multi-task learning in the context of the T5 model are correct?
6406536924712.
In gradual unfreezing, layers are progressively unfrozen starting from the task-specific (top) layers toward the input (bottom) layers.
6406536924713.
Multi-task learning in T5 typically improves performance uniformly across all tasks.
6406536924714.
Multi-task pre-training (as used in T5) followed by task-specific fine-tuning often performs better than relying on multi-task learning alone.
6406536924715.
Gradual unfreezing can help mitigate catastrophic forgetting of pre-trained representations during T5 fine-tuning.

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 MSQ · 2.0 marks

Select all correct statements regarding **Local Attention Variants** (like Sparse, Dilated, or Windowed Attention).
6406536924722.
Many local attention variants reduce complexity toward linear with sequence length.
6406536924723.
They always outperform full attention on all tasks, regardless of sequence length.
6406536924724.
Stacking multiple layers of local attention increases the effective receptive field, similar to dilated convolutions in CNNs.
6406536924725.
They can be combined with global tokens (e.g., in BigBird) to ensure some tokens can attend to the entire sequence.

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 MSQ · 2.0 marks

Which of the following techniques are used in **Flash Attention** to speed up attention computation and save memory?
6406536924738.
**Tiling:** Breaking the large matrices into smaller blocks that fit into the fast SRAM.
6406536924739.
**Recomputation:** Recomputing the attention matrix during the backward pass instead of storing it in HBM.
6406536924740.
**Approximation:** Using a low-rank approximation of the attention matrix to avoid exact calculation.
6406536924741.
**Kernel Fusion:** Fusing multiple operations (MatMul, Mask, Softmax, Dropout) into a single kernel to reduce memory reads/writes.

A published solution is not available for this question yet.

Report a correction for Q21