MauryaHub PYQ Practice

Large Language Models · End Term · Sep 2025 · FN

Large Language Models · End Term · Sep 2025 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 / 24 published solutions

Question 2 MCQ · 1.0 marks

What happens when you use Batch Normalization with a batch size of 1?
6406536036762.
It works perfectly fine
6406536036763.
The statistics become meaningless (mean=0, std=0)
6406536036764.
It automatically switches to Layer Normalization
6406536036765.
It uses the running statistics from training

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 MCQ · 2.0 marks

A language model outputs the following logits for the next token: {cat: 3.2, dog: 2.9, bird: 1.1, fish: 0.5, snake: -0.4} Before sampling, the decoding pipeline performs: • Temperature scaling with T = 2.0 • Top-K filtering with K = 3 After applying both steps, which tokens remain eligible for sampling?
6406536036766.
Only ''cat''
6406536036767.
'cat'' or ''dog''
6406536036768.
'cat'', ''dog'' or ''bird''
6406536036769.
'dog'', ''bird'' or ''fish''

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 MCQ · 2.0 marks

If a model's next-token probabilities are
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
, and
Source diagram or notation
, and Top-P is set to
Source diagram or notation
. Which set of tokens will be included in the nucleus for sampling?
6406536036770.
Tokens A, B, C, D, E
6406536036771.
Tokens A, B
6406536036772.
Tokens A, B, C
6406536036773.
Tokens A, B, C, D
6406536036774.
Tokens A, B, D

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 MCQ · 2.0 marks

In a WordPiece vocabulary-building step, the corpus contains the following tokenized sequences: •
Source diagram or notation
•
Source diagram or notation
The current vocabulary includes the tokens:
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
Two candidate merges are being evaluated: • Merge A:
Source diagram or notation
Source diagram or notation
Source diagram or notation
• Merge B:
Source diagram or notation
Source diagram or notation
Source diagram or notation
Based purely on WordPiece's likelihood-based merge selection, which merge is more likely to be chosen?
6406536036775.
Merge
Source diagram or notation
6406536036776.
Merge
Source diagram or notation
6406536036777.
Insufficient information to determine

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 MCQ · 2.0 marks

A research team wants to classify scientific abstracts into multiple topics simultaneously (e.g., ''ML'', ''biology'', ''statistics''), where each abstract may belong to more than one topic. They fine- tune BERT for this task. Which modification is MOST appropriate?
6406536036778.
Replace the [CLS] vector with an average of the top-4 attention heads
6406536036779.
Feed the [CLS] embedding into a linear layer with a sigmoid activation per label
6406536036780.
Use token embeddings individually and classify each token
6406536036781.
Use the [SEP] token embedding for multi-label prediction

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 MCQ · 1.0 marks

A company wants to automatically correct noisy OCR text extracted from scanned documents. The text contains spelling mistakes, missing words, and scrambled phrases. Which model should they fine-tune?
6406536036782.
BERT, because it masks tokens and predicts them independently
6406536036783.
BART, because it is trained with text corruption and autoregressive reconstruction
6406536036784.
GPT, because it is optimal for bidirectional correction
6406536036785.
BERT, because [CLS] captures global structure

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 MCQ · 1.0 marks

Computing the full self-attention matrix 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. Which step in the self-attention mechanism is primarily responsible for this quadratic scaling?
6406536036786.
Computing the softmax for each row
6406536036787.
Computing the matrix product
Source diagram or notation
6406536036788.
Multiplying the attention matrix
Source diagram or notation
with the value matrix
Source diagram or notation
6406536036789.
Performing layer normalization

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 MCQ · 1.0 marks

During autoregressive inference, key-value (KV) caching is used to avoid recomputing keys and values for previously generated tokens. If the KV cache is allowed to grow without any limit, which of the following failure modes can occur?
6406536036790.
GPU memory exhaustion
6406536036791.
Latency becoming quadratic in the output length
6406536036792.
Inability to perform parallel token generation
6406536036793.
Beam search collapsing to a single token

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 MCQ · 2.0 marks

Consider a sequence of length
Source diagram or notation
processed by a local
Source diagram or notation
mechanism with block size
Source diagram or notation
, where
Source diagram or notation
is a multiple of
Source diagram or notation
. The sequence is partitioned into
Source diagram or notation
non-overlapping contiguous blocks, and self-attention is computed
Source diagram or notation
(i.e., attention is restricted to the main diagonal blocks of the
Source diagram or notation
attention matrix). Ignoring the cost of linear projections for
Source diagram or notation
, what is the time complexity of the self- attention operation for one layer in terms of
Source diagram or notation
,
Source diagram or notation
, and the head dimension
Source diagram or notation
?
6406536036794.Source diagram or notation
6406536036795.Source diagram or notation
6406536036796.Source diagram or notation
6406536036797.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 MCQ · 2.0 marks

A 2D vector
Source diagram or notation
is rotated by
Source diagram or notation
using RoPE. What is the resulting vector?
6406536036798.Source diagram or notation
6406536036799.Source diagram or notation
6406536036800.Source diagram or notation
6406536036801.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 MCQ · 2.0 marks

If a model uses Absolute Positional Embeddings (APE), increasing the sequence length from 100 to 1000 requires:
6406536036802.
No new parameters
6406536036803.
900 additional positional embedding vectors
6406536036804.
A new rotation matrix
6406536036805.
A distance-based bias matrix

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 MCQ · 3.0 marks

In a sequence of length
Source diagram or notation
, how many different attention pairs produce a distance of
Source diagram or notation
?
6406536036806.
3
6406536036807.
5
6406536036808.
6
6406536036809.
7

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 MCQ · 3.0 marks

For a sequence of length
Source diagram or notation
, how many learned positional vectors are required by the following methods? • Absolute Positional Encoding (APE) • Relative Positional Encoding (RPE) • ALiBi • NoPE (No Positional Encoding)
6406536036810.
APE = 10, RPE = 19, ALiBi = 0, NoPE = 0
6406536036811.
APE = 10, RPE = 10, ALiBi = 19, NoPE = 0
6406536036812.
APE = 20, RPE = 19, ALiBi = 1, NoPE = 1
6406536036813.
APE = 10, RPE = 2T = 20, ALiBi = 10, NoPE = 0

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 MCQ · 2.0 marks

Which of the following methods uses/use the concept: "The farther apart two tokens are, the less they should attend to each other''?
6406536036814.
RoPE
6406536036815.
APE
6406536036816.
ALiBi
6406536036817.
RPE

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 MCQ · 2.0 marks

You trained a model with max sequence length 512. At inference, you need to process sequence length 4096 without retraining. Which positional encoding will perform best out-of-the-box?
6406536036818.
APE
6406536036819.
RPE
6406536036820.
RoPE
6406536036821.
ALiBi

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MCQ · 2.0 marks

A model using ALiBi is extended from context length 1K
Source diagram or notation
8K. How many new ALiBi parameters are added?
6406536036822.
7000
6406536036823.
8000
6406536036824.
Depends on the number of distances
6406536036825.
0

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 NAT · 3.0 marks

A mini-batch has
Source diagram or notation
sentences, each padded to a length
Source diagram or notation
. Self-attention (single head) computes one score matrix per sentence. How many scalar scores are computed in total for a single head across the batch?

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 NAT · 2.0 marks

Suppose you are working on prefix language modeling. The sequence length is
Source diagram or notation
and the first two tokens represent the task-specific prefix. How many non-infinity elements are there in the mask for computing attention scores?

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 NAT · 2.0 marks

A model uses a hybrid attention pattern in which each token attends to: • A local window of size
Source diagram or notation
• A set of
Source diagram or notation
random tokens, • A set of
Source diagram or notation
global tokens. Compute the total number of attention computations per token (integer expression).

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 NAT · 2.0 marks

During deployment of a transformer-based Large Language Model (LLM), you want to estimate the memory usage of the KV cache for efficient batching. Compute the KV-cache memory required per token (in Bytes) for the following model configuration: • Number of Transformer Blocks (
Source diagram or notation
): 24 • Attention Heads per Layer (
Source diagram or notation
): 12 • Head Dimension (
Source diagram or notation
): 96 • Precision used for KV tensors: 2 Bytes (FP16)

A published solution is not available for this question yet.

Report a correction for Q21

Question 22 NAT · 3.0 marks

You are implementing a custom Block Sparse Attention kernel. Given a sequence length
Source diagram or notation
and block size
Source diagram or notation
, you decide to compute the main diagonal blocks plus one random off-diagonal block for each block-row. How many total
Source diagram or notation
block computations are performed?

A published solution is not available for this question yet.

Report a correction for Q22

Question 23 MSQ · 3.0 marks

A GPT-style causal language model is trained using the next-token prediction objective:
Source diagram or notation
During inference, the model must generate tokens autoregressively from left to right using only past context. Consider the following statements about GPT-style causal models.
6406536036831.
GPT cannot condition on future tokens during training because the causal mask zeros out all attention to positions
Source diagram or notation
6406536036832.
If two prefixes
Source diagram or notation
and
Source diagram or notation
have identical embeddings at all positions, GPT must assign identical next-token distributions for both contexts
6406536036833.
Removing positional encodings would force GPT to treat all permutations of the same set of tokens as equivalent contexts
6406536036834.
Causal masking ensures that the computational cost of training scales linearly with sequence length

A published solution is not available for this question yet.

Report a correction for Q23

Question 24 MSQ · 3.0 marks

Under which of the following decoding settings can the model produce different outputs across multiple runs on the same prompt?
6406536036835.
Top-K sampling with
Source diagram or notation
and temperature
Source diagram or notation
6406536036836.
Top-K sampling with
Source diagram or notation
and temperature
Source diagram or notation
6406536036837.
Nucleus (Top-p) sampling with
Source diagram or notation
and temperature
Source diagram or notation
6406536036838.
Greedy decoding after applying a temperature
Source diagram or notation
to the logits
6406536036839.
Beam search with beam width
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q24

Question 25 MSQ · 2.0 marks

Consider a BART encoder with sequence length
Source diagram or notation
and hidden size
Source diagram or notation
(fixed). Now suppose the sequence length is doubled from
Source diagram or notation
to
Source diagram or notation
, keeping all other parameters unchanged. Which of the following statements are true?
6406536036840.
Self-attention FLOPs increase by a factor of
Source diagram or notation
.
6406536036841.
Self-attention FLOPs increase by a factor of
Source diagram or notation
.
6406536036842.
FFN FLOPs increase by a factor of
Source diagram or notation
.
6406536036843.
FFN FLOPs increase by a factor of
Source diagram or notation
.

A published solution is not available for this question yet.

Report a correction for Q25