uiz Space

May 2026 term · Large Language Models · BSDA5004

Large Language Models End Term: 13 September 2026, Set 1 (May 2026 term)

The IIT Madras BS Large Language Models (LLM) End Term paper sat on 13 Sept 2026, in the May 2026 term, set 1: 18 questions for 50 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
18
Marks
50
Duration
180 min
MCQ
9
Numerical
7
Written
1
MSQ
1

Updated

Official paper: Large Language Models 13 Sep 26 (Session 2) · No negative marking.

Question 1

+2 marksOne correct option

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:

  1. A

    Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of Assertion (A).

  2. B

    Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A).

  3. C

    Assertion (A) is true, but Reason (R) is false.

  4. D

    Assertion (A) is false, but Reason (R) is true

  5. E

    Both Assertion (A) and Reason (R) are false.

Show answer

Correct answer

  • C

    Assertion (A) is true, but Reason (R) is false.

Question 2

+2 marksOne correct option

Which of the following statements regarding one-hot positional encoding and sinusoidal positional encoding is incorrect?

  1. A
  2. B

    The squared Euclidean norm of a sinusoidal positional encoding vector is a constant value independent of the position index

  3. C

    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

  4. D

    One-hot positional encoding is incapable of mathematically representing relative distance between tokens

Show answer

Correct answer

  • A

Question 3

+2 marksOne correct option

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?

  1. A

    Beam search

  2. B

    Exhaustive search

  3. C

    Top-p sampling with p = 0.85

  4. D

    Greedy decoding

Show answer

Correct answer

  • A

    Beam search

Question 4

+2 marksOne correct option

In the Next Sentence Prediction task, how are the two input sentences distinguished by the BERT architecture?

  1. A

    By utilizing separate transformer encoders for each sentence and concatenating the outputs.

  2. B

    By adding learnable segment embeddings to the token and positional embeddings of the respective sentences.

  3. C

    By inserting a [MASK] token between the two sentences.

  4. D

    By ensuring two different heads in the Multi-Head Attention setup attend to the specific sentences.

Show answer

Correct answer

  • B

    By adding learnable segment embeddings to the token and positional embeddings of the respective sentences.

Question 5

+3 marksNumerical answer

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:

Show answer

Correct answer: 3

Question 6

+3 marksWritten answer

Consider a tokenizer processing the word "lion".
The vocabulary contains the following tokens along with the assigned log-probabilities.

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. Answers Case Sensitive : No

Show answer

Correct answer: l,i,on

Question 7

+3 marksNumerical answer
Show answer

Correct answer: 12432

Question 8

+2 marksNumerical answer

Consider an LLM operating on a vocabulary consisting of 5 tokens. For a given context, the model produces the following logits:

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?

Show answer

Correct answer: 3

Question 9

+2 marksNumerical answer

Consider an LLM operating on a vocabulary consisting of 5 tokens. For a given context, the model produces the following logits:

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)

Show answer

Correct answer: 0.56 (accepted within ±0.02)

Question 10

+3 marksOne correct option

How did the GPT-2 model initially demonstrate "zero-shot domain transfer" capabilities on complex tasks like summarization and translation?

  1. A

    By utilizing specialized adapter layers trained explicitly for translation and summarization datasets.

  2. B

    By formatting the raw input text with natural language prompts to induce task-specific outputs without updating model weights.

  3. C

    By executing a secondary pre-training phase exclusively on Wikipedia and BookCorpus.

  4. D

    By modifying the decoder architecture into a bidirectional encoder for specific tasks.

Show answer

Correct answer

  • B

    By formatting the raw input text with natural language prompts to induce task-specific outputs without updating model weights.

Question 11

+3 marksOne correct option

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

  1. A

    I-A, II-B, III-C

  2. B

    I-B, II-C, III-A

  3. C

    I-C, II-A, III-B

  4. D

    I-C, II-B, III-A

  5. E

    I-B, II-A, III-C

Show answer

Correct answer

  • D

    I-C, II-B, III-A

Question 12

+3 marksOne correct option

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?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 13

+3 marksOne correct option

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?

  1. A

    1

  2. B

    2

  3. C

    4

  4. D

    8

Show answer

Correct answer

  • B

    2

Question 14

+3 marksOne correct option

What is the primary trade-off made by utilizing KV Cache during autoregressive decoding?

  1. A

    It reduces inference latency but utilizes smaller batch size

  2. B

    It increases generation speed but reduces model accuracy

  3. C

    It reduces computational overhead but increases memory usage

  4. D

    It reduces training time by storing intermediate token representations

Show answer

Correct answer

  • C

    It reduces computational overhead but increases memory usage

Question 15

+4 marksNumerical answer

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

Show answer

Correct answer: 512

Question 16

+3 marksOne or more correct options

Which of the following statements about length generalization in Large Language Models (LLMs) are correct?

Select all that apply.

  1. A

    Length generalization is the ability of an LLM to maintain effective performance on sequences longer than the sequence lengths predominantly used during training.

  2. B

    Length generalization refers specifically to improving computational efficiency when processing longer sequences.

  3. C

    Length generalization can depend on the model architecture, positional encoding scheme, training procedure, and the nature of the task.

  4. D

    Exposure to a wider range of sequence lengths during training can improve an LLM's ability to generalize to longer sequences.

Show answer

Correct answers

  • A

    Length generalization is the ability of an LLM to maintain effective performance on sequences longer than the sequence lengths predominantly used during training.

  • C

    Length generalization can depend on the model architecture, positional encoding scheme, training procedure, and the nature of the task.

  • D

    Exposure to a wider range of sequence lengths during training can improve an LLM's ability to generalize to longer sequences.

Question 17

+2 marksNumerical answer

The query and key projection matrices are

and

RoPE Frequency For RoPE, use the frequency formula

Using the property

the attention score can be expressed using the relative position:

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.99 (accepted within ±0.01)

Question 18

+3 marksNumerical answer

The query and key projection matrices are

and

RoPE Frequency For RoPE, use the frequency formula

Using the property

the attention score can be expressed using the relative position:

Based on the above data, answer the given subquestions.

Show answer

Correct answer: -20.5 (accepted within ±1.5)