Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Large Language Models
All 2025 papers
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
- Q1MCQ2 Marks·Choose one option

- ATo increase the numerical precision of the attention scores.
- BTo reduce the overall computational cost of the attention mechanism.
- CTo ensure that the sum of the attention scores for each query equals 1.
- DTo avoid numerical issues and loss of gradients during training.
- Q2MCQ2 Marks·Choose one option
Which of the following is true regarding sinusoidal encoding?
- AThe encoding vector of words present at even positions in the given text sequence uses sine, and the encoding vector of words present at odd positions uses cosine.
- BThe encoding vector of words present at odd positions in the given text sequence uses sine, and the encoding vector of words present at even positions uses cosine.
- CThe encoding vector for each word position contains values computed using both sine (for even dimensions) and cosine (for odd dimensions).
- Q3MCQ2 Marks·Choose one option

- A‘content’
- B‘je’
- C‘suis’
- D‘heureux’
- Q4MCQ2 Marks·Choose one option

- A

- B

- C

- D

- E

- A
- Q5MCQ2 Marks·Choose one option
In the context of language model training, teacher forcing is a technique where:
- AThe correct target tokens from the training data are used as input for the next time step, regardless of the model’s prediction.
- BThe model’s predictions are used as the input for the next time step, even if they are incorrect.
- CThe model is forced to learn without any pre-trained weights.
- DThe model is forced to correct the input data.
- Q6MCQ2 Marks·Choose one option

- A

- B

- C

- D

- A
- Q7MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q8MCQ3 Marks·Choose one option

- A

- B

- C

- D

- E

- A
- Q9MCQ3 Marks·Choose one option
For a vocabulary size of 10, how many beams will there be in greedy search, beam search with beam size 3, and exhaustive search at step 1 and step 3, respectively?
- AStep 1: Greedy: 1, Beam: 1, Exhaustive: 1 Step 3: Greedy: 1, Beam: 1, Exhaustive: 1
- BStep 1: Greedy: 1, Beam: 3, Exhaustive: 10 Step 3: Greedy: 1, Beam: 3, Exhaustive: 10
- CStep 1: Greedy: 1, Beam: 3, Exhaustive: 1 Step 3: Greedy: 1, Beam: 3, Exhaustive: 100
- DStep 1: Greedy: 1, Beam: 3, Exhaustive: 10 Step 3: Greedy: 1, Beam: 3, Exhaustive: 1000
- Q10MSQ2 Marks·Choose all correct options
Which of the following decoding strategies is/are inherently non-deterministic?
- ABeam
- BGreedy
- CNucleus
- DExhaustive
- Q11MSQ2 Marks·Choose all correct options
Which of the following statements about multiple attention heads in a Transformer are true?
- AThey allow learning diverse local/global relations.
- BThey reduce memory usage compared to one head.
- CIncreasing the number of heads while keeping d_(model) fixed, decreases the dimensionality handled by each head.
- DAll heads necessarily learn completely independent information about the input.
- Q12MSQ4 Marks·Choose all correct options
Which of the following statements about the Transformer architecture are true?
- AMasking (look-ahead mask) is applied in every decoder self-attention layer, not just the first one.
- BToken embeddings are used in the encoder but not in the decoder.
- CPositional encoding is required only in the encoder, not in the decoder.
- DToken embeddings are used in both the encoder and the decoder.
- EPositional encodings are added to the input embeddings in both the encoder and the decoder.
- Q13MSQ4 Marks·Choose all correct options

- ABeam search with beam size 2 will keep either A or B as per probability whereas Top-2 sampling will keep both A and B.
- BBeam search with beam size 2 will keep both A and B whereas Top-2 sampling will keep either A or B.
- CBeam search with beam size 2 will randomly choose any two tokens, whereas Top-2 sampling will always pick the two least probable tokens.
- DBeam search with beam size 2 will always keep the top-2 most probable tokens, whereas Top-2 sampling will restrict choices to top-2 tokens and then sample one probabilistically.
- Q14NAT3 Marks·Write the number
Your answer: - Q15NAT3 Marks·Write the number
Your answer: - Q16NAT2 Marks·Write the number
Your answer: Read the passage below, then answer Q17–Q20
Q17NAT3 Marks·Write the numberHow many next-token prediction targets are generated during training a full batch?
Your answer:- Q18NAT2 Marks·Write the number
For one sequence, how many non-zero attention scores remain in the masked attention score matrix (per head)?
Your answer: - Q19NAT2 Marks·Write the number
Your answer: - Q20MSQ2 Marks·Choose all correct options
During autoregressive inference with GPT:
- AThe model can generate all tokens in parallel.
- BEach new token is generated conditioned on previously generated tokens.
- CTeacher forcing is used to stabilize outputs.
- DBeam search or other decoding strategies are commonly used to decide the next token.
End Term · 31 Aug 2025 (FN)End Term
- Q21MCQ2 Marks·Choose one option

- A

- B

- C

- D

- A
- Q22MCQ2 Marks·Choose one option

- A

- B

- C

- D

- A
- Q23MSQ3 Marks·Choose all correct options
Which of the following statements about subword tokenizers (e.g., Byte Pair Encoding, SentencePiece) is true?
- AThey always split words into individual characters.
- BThey help handle rare words by breaking them into smaller units.
- CThey require the vocabulary to contain every possible word in the language.
- DThey can reduce the overall vocabulary size compared to word-level tokenizers.
- Q24MSQ3 Marks·Choose all correct options
A GPT-based model is fine-tuned for story generation. During evaluation, you test different decoding strategies on the same prompt: 1. Method A: Every run produces the exact same story, even when executed multiple times. 2. Method B: The story changes slightly in each run, but overall structure and key events remain similar. 3. Method C: The story is wildly different each time, sometimes even changing the genre. Based on the observations, select the most likely decoding strategies for each method:
- AMethod A: Greedy decoding
- BMethod A: Top-K sampling with K = 50
- CMethod B: Top-P sampling with p = 0.9
- DMethod C: Top-P sampling with p = 0.5 and high temperature T = 1.5
- EMethod C: Beam search with K = 5
- Q25MSQ3 Marks·Choose all correct options
Which of the following are valid design choices when building a transformer-based language model?
- ANumber of transformer layers
- BLearning rate schedule
- CFont style of the source code
- DVocabulary size
- EType of normalization (e.g., LayerNorm)
- Q26MSQ3 Marks·Choose all correct options
Which of the following statements about Top-k and Nucleus (Top-p) sampling are correct?
- ATop-k keeps only the k most probable tokens before sampling.
- BTop-p dynamically chooses the smallest set of tokens whose cumulative probability exceeds p.
- CTop-k is always a subset of Top-p.
- DTop-p always has a fixed number of candidate tokens.
- Q27MSQ3 Marks·Choose all correct options
Which of the following preprocessing steps are commonly required when preparing data for transformer models like BERT?
- ALowercasing text (for uncased models)
- BSplitting into subword units using BPE or WordPiece
- CRemoving all punctuation marks
- DAdding position indices for each token
- Q28NAT3 Marks·Write the number
Your answer: Read the passage below, then answer Q29–Q30
Q29NAT3 Marks·Write the numberFor the input “you enjoy tea often”, compute the final representation of the word “tea” after the attention layer (i.e., after applying W_Q, W_K, W_V , attention weights, and W_O). Enter the sum of the elements in the resulting vector.
Your answer:- Q30NAT2 Marks·Write the number
Suppose the input sentence is “tea you enjoy often”. Using the same matrices and processing method, what is the attention score (i.e., softmax entry from A) for the query word “tea” attending to key word “often”?
Your answer: Read the passage below, then answer Q31–Q33
Q31MCQ2 Marks·Choose one option
- A

- B

- C

- D

- A
- Q32NAT1 Mark·Write the number
Your answer: - Q33NAT2 Marks·Write the number
What percentage of entries in the attention matrix are zero (i.e., the sparsity)?
Your answer: Read the passage below, then answer Q34–Q37

Based on the above data, answer the given subquestions.
Q34MCQ1 Mark·Choose one option
- A(0, 1, 2, 3, 4)
- B(-1, 0, 1, 2, 3)
- C(-2, -1, 0, 1, 2)
- D(-3, -2, -1, 0, 1)
- Q35MCQ1 Mark·Choose one option

- A

- B

- C

- D

- A
- Q36NAT3 Marks·Write the number
Your answer: - Q37NAT3 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (AN)End Term
- Q38MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q39MCQ2 Marks·Choose one option
A GPT model is trained using causal language modeling. During training, for a sequence of T = 4 tokens, which of the following correctly represents the attention mask matrix applied to the attention logits?
- A

- B

- C

- D

- A
- Q40MCQ2 Marks·Choose one option

- A(a) : Random Local Attention, (b) : Strided Local Attention, (c) : Sparse Block Attention, (d) : Local + Global Attention
- B(a) : Strided Local Attention, (b) : Local + Global Attention, (c) : Random Local Attention, (d) : Sparse Block Attention
- C(a) : Strided Local Attention, (b) : Random Local Attention, (c) : Local + Global Attention, (d) : Sparse Block Attention
- D(a) : Sparse Block Attention, (b) : Local + Global Attention, (c) : Strided Local Attention, (d) : Random Local Attention
- Q41MSQ3 Marks·Choose all correct options
Which of the following preprocessing steps are commonly used when preparing data for transformer models like BERT?
- AAdding special tokens such as [CLS] and [SEP] to the sequence
- BSplitting tokens into subword units using a model-specific tokenizer
- CRemoving all punctuation marks to ensure cleaner embeddings
- DAdding positional information to each token embedding
- Q42MSQ3 Marks·Choose all correct options
Which modifications are used in transformers to handle longer sequences efficiently?
- AUsing sparse attention patterns to reduce computational complexity
- BApplying low-rank matrix factorization to approximate attention
- CIncreasing only the feed-forward network width without modifying attention
- DReplacing the softmax function in attention with other activation function for faster training
- Q43MSQ3 Marks·Choose all correct options
In Transformer models that use relative position embeddings (such as in Transformer-XL or T5), clipping is often applied to the relative position indices. Which of the following statements about clipping in relative position embeddings are correct?
- AClipping ensures that very large relative distances are mapped to a fixed maximum distance.
- BWithout clipping, the model would require embeddings for every possible relative distance, which is infeasible for long sequences.
- CClipping increases the precision of embeddings for large relative distances.
- DClipping introduces an upper bound k such that all distances greater than k are mapped to the same index.
- Q44NAT2 Marks·Write the number
Your answer: Read the passage below, then answer Q45–Q46
Q45NAT3 Marks·Write the numberFor the input “you enjoy tea often”, compute the final representation of the word “enjoy” after the attention layer (i.e., after applying W_Q, W_K, W_V , attention weights, and W_O). Enter the sum of the elements in the resulting vector.
Your answer:- Q46NAT2 Marks·Write the number
Suppose the input sentence is “tea you enjoy often”. Using the same matrices and processing method, what is the attention score (i.e., softmax entry from A) for the query word “tea” attending to key word “often”?
Your answer: Read the passage below, then answer Q47–Q49

Based on the above data, answer the given subquestions.
Q47MCQ2 Marks·Choose one optionChoose the correct representation of π for the given mask image.
- Aπ = (2, 1, 3, 4, 0)
- Bπ = (0, 4, 3, 1, 2)
- Cπ = (0, 3, 4, 2, 1)
- DAll of these
- Q48NAT1 Mark·Write the number
How many permutations of π are possible for n = 5?
Your answer: - Q49NAT2 Marks·Write the number
What percentage of entries in the attention matrix are zero (i.e., the sparsity)?
Your answer: Read the passage below, then answer Q50–Q54

Based on the above data, answer the given subquestions.
Q50MCQ2 Marks·Choose one option
- A(0, 1, 2, 3, 4, 5)
- B(-1, 0, 1, 2, 3, 4)
- C(-3, -2, -1, 0, 1, 2)
- D(-2, -1, 0, 1, 2, 3)
- Q51MCQ2 Marks·Choose one option

- A[−0.4,−0.4,−0.4,−0.4]
- B[−0.1,−0.1,−0.1,−0.1]
- C[−0.8,−0.8,−0.8,−0.8]
- D[−0.2,−0.2,−0.2,−0.2]
- Q52NAT3 Marks·Write the number
Your answer: - Q53NAT2 Marks·Write the number
Your answer: - Q54NAT3 Marks·Write the number
Your answer:
Quiz 2 · 3 Aug 2025 (AN)Quiz 2
- Q55MCQ2 Marks·Choose one option
What is a primary motivation for using subword tokenization (like BPE or WordPiece) instead of word-level tokenization in transformers?
- AIt increases vocabulary size exponentially
- BIt completely eliminates the need for a tokenizer
- CIt helps handle out-of-vocabulary words more effectively
- DIt prevents the model from needing positional encoding
- Q56MCQ2 Marks·Choose one option
What is a key implication of scaling laws in large language models?
- ATraining longer always leads to better performance
- BLarger models require less training data
- CModel size and dataset size must scale together to maintain optimal performance
- DNone of these
- Q57MCQ2 Marks·Choose one option
Consider the Following Assertion and Reason pair : Assertion : In Byte Pair Encoding (BPE), each merge operation adds exactly one new token to the vocabulary. Reason : BPE helps reduce the size of the initial vocabulary by merging the most frequent tokens.
- ABoth Assertion and Reason are true, and Reason is the correct explanation of Assertion.
- BBoth Assertion and Reason are true, but Reason is not the correct explanation of Assertion.
- CAssertion is true, but Reason is false.
- DAssertion is false, but Reason is true.
- Q58MCQ2 Marks·Choose one option
What is the primary advantage of T5’s text-to-text approach for transfer learning in NLP?
- AIt reduces the computational cost of training models significantly.
- BIt allows a single model and architecture to be applied to a wide variety of NLP tasks without modification.
- CIt guarantees optimal performance on all tasks without fine-tuning.
- DIt eliminates the need for any pre-training data.
- Q59MCQ2 Marks·Choose one option
What is the format of output the T5 model is expected to generate during its span-corruption pretraining?
- A

- B

- C

- D

- A
- Q60MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q61MCQ3 Marks·Choose one option
Suppose you are given 4x more compute budget to scale a Transformer-based language model. According to scaling laws, what is the best way to utilize this increased compute for optimal model performance?
- AIncrease the model size (number of parameters) by 4x and keep the dataset size and training steps the same.
- BTrain the same model on 4x more data for 4x more steps without changing the model size.
- CIncrease the model size by approximately 2x and increase the amount of training data by approximately 2x.
- DDouble the model size and halve the training data size to compensate.
- Q62MSQ3 Marks·Choose all correct options
In a data preprocessing stage designed to prepare clean, diverse, and safe data, which of the following examples is likely to be filtered out?
- A“All people from that xyz area are thieves. They should be jailed immediately.”
- BKavya’s PAN number is BDZPK1234K and her registered address is 17/4, Green Park, Delhi.
- C[“Reinforcement learning allows agents to learn optimal strategies through interaction with an environment.”, “Reinforcement learning allows agents to learn optimal strategies through interaction with an environment.”]
- DThe Union Budget 2024 proposes increased spending on green energy infrastructure.
- EAccording to WHO, global life expectancy has increased by 6 years since 2000.
- FNone of these.
- Q63MSQ3 Marks·Choose all correct options
What are the key challenges encountered when building a vocabulary for NLP models?
- AA larger vocabulary leads to a bigger embedding matrix and increased softmax computation
- BDifficulty in handling out-of-vocabulary (OOV) words
- CThe size of each embedding vector increases with the number of out-of- vocabulary (OOV) words
- DMore vocabulary entries always guarantee better model generalization
- Q64MSQ3 Marks·Choose all correct options
Select all the correct input-output representations used for different pretraining objectives based on the base sentence: “The quick brown fox jumps over the lazy dog”
- A

- B

- C

- D

- A
- Q65NAT2 Marks·Write the number
Your answer: - Q66NAT3 Marks·Write the number
Your answer: Read the passage below, then answer Q67–Q71

Based on the above data, answer the given subquestions.
Q67NAT2 Marks·Write the numberUsing Byte Pair Encoding (BPE), how many distinct tokens are there in the initial vocabulary before any merges are performed?
Your answer:- Q68MCQ2 Marks·Choose one option
Which token pair has the lowest frequency before any merges in Byte Pair Encoding?
- A(‘b’, ‘r’)
- B(‘t’, ‘l’)
- C(‘p’, ‘e’)
- D(‘e’, ‘r’)
- ENone of these
- Q69NAT2 Marks·Write the number
What is the frequency of the most frequent byte-pair before the first merge in Byte Pair Encoding?
Your answer: - Q70NAT2 Marks·Write the number
Your answer: - Q71MCQ2 Marks·Choose one option

- A

- B

- C

- D

- A
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.