uiz Space

January 2025 term · Introduction to Natural Language Processing · BSDA5005

Introduction to Natural Language Processing Quiz 2: 16 March 2025 (January 2025 term)

The IIT Madras BS Introduction to Natural Language Processing (Intro to NLP) Quiz 2 paper sat on 16 Mar 2025, in the January 2025 term: 18 questions for 50 marks in 120 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
120 min
MCQ
9
MSQ
6
Numerical
3

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 16 Mar 2025 · No negative marking.

Question 1

+2 marksOne correct option

Consider the given Assertion and Reason. Choose the correct option.
Assertion (A): FastText produces word embeddings of variable size, depending on the number of subword n-grams a word contains.
Reason (R): FastText computes the final embedding for a word by summing or averaging the embeddings of its subword n-grams.

  1. A

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

  2. B

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

  3. C

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

  4. D

    Assertion (A) is false, and Reason (R) is false.

Show answer

Correct answer

  • C

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

Question 2

+2 marksOne correct option

Suppose TF-IDF is applied to a corpus of medical research papers. In a document discussing COVID-19 vaccines, which of the following terms is likely to have the highest TF-IDF score?

  1. A

    "COVID-19"

  2. B

    "Spike protein"

  3. C

    "vaccine"

  4. D

    "treatment"

Show answer

Correct answer

  • B

    "Spike protein"

Question 3

+2 marksOne correct option

Which of the following statements is/are INCORRECT?

  1. A

    Recurrent neural networks can handle a sequence of arbitrary length, while feedforward neural networks can not.

  2. B

    Training recurrent neural networks is hard because of vanishing and exploding gradient problems.

  3. C

    Gradient clipping is an effective way of solving vanishing gradient problem.

  4. D

    Gated recurrent units (GRUs) have fewer parameters than LSTMs

Show answer

Correct answer

  • C

    Gradient clipping is an effective way of solving vanishing gradient problem.

Question 4

+2 marksOne correct option

In an LSTM network, each gate has a specific function. Which of the following statements about the functions of LSTM gates is INCORRECT?

  1. A

    The forget gate decides which information from the cell state should be discarded.

  2. B

    The input gate determines what new information to add to the cell state.

  3. C

    The output gate decides which part of the input sequence is passed to the cell state.

  4. D

    The forget gate helps prevent the accumulation of irrelevant information in the cell state.

Show answer

Correct answer

  • C

    The output gate decides which part of the input sequence is passed to the cell state.

Question 5

+2 marksOne correct option

Given the following corpus with word frequencies:

If we apply BPE, What will be the merged token after the second merge operation?

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

Correct answer

  • D

Question 6

+2 marksOne correct option

Which of the following statements best explains why RLHF improves over instruction fine-tuning alone?

  1. A

    RLHF removes the need for any supervised training.

  2. B

    RLHF creates labeled data directly from human feedback, hence does not require supplying any labeled data.

  3. C

    RLHF ensures the model generates factually correct answers every time.

  4. D

    RLHF allows models to optimize responses beyond the training dataset through human involvement.

Show answer

Correct answer

  • D

    RLHF allows models to optimize responses beyond the training dataset through human involvement.

Question 7

+4 marksOne correct option

Match the application to the correct RNN type:

Which of the following mappings is correct?

  1. A

    A-i, B-ii, C-iii

  2. B

    A-ii, B-iii, C-i

  3. C

    A-iii, B-i, C-ii

  4. D

    A-i, B-iii, C-ii

Show answer

Correct answer

  • A

    A-i, B-ii, C-iii

Question 8

+3 marksOne correct option

In an attention-based RNN, what does the context vector represent?

  1. A

    The concatenation of all input embeddings

  2. B

    A weighted sum of the encoder’s hidden states

  3. C

    The output of the decoder at each time step

  4. D

    The hidden state of the encoder

Show answer

Correct answer

  • B

    A weighted sum of the encoder’s hidden states

Question 9

+3 marksOne correct option

You are using QLoRA to fine-tune a neural network. The weight matrix W has dimensions 1024 x 2048, and LoRA uses rank 8 matrices. Quantization is applied, reducing precision to 4bits. What is the memory required for storing the parameters introduced by QLoRA?

  1. A

    12,000 bytes

  2. B

    13,000 bytes

  3. C

    12,288 bytes

  4. D

    24,576 bytes

Show answer

Correct answer

  • C

    12,288 bytes

Question 10

+3 marksOne or more correct options

Which of the following use cases can benefit from using TF-IDF?

Select all that apply.

  1. A

    Document similarity detection for plagiarism.

  2. B

    Extracting the most important keywords from a document.

  3. C

    Translating text from one language to another.

  4. D

    Clustering similar articles in a news corpus.

Show answer

Correct answers

  • A

    Document similarity detection for plagiarism.

  • B

    Extracting the most important keywords from a document.

  • D

    Clustering similar articles in a news corpus.

Question 11

+3 marksOne or more correct options

You are comparing rule-based machine translation (RBMT), statistical machine translation(SMT), and example-based machine translation (EBMT) for translating a set of sentences between English and Spanish. Based on the characteristics of these techniques, which of the following statements are correct?

Select all that apply.

  1. A

    RBMT heavily relies on linguistic resources such as bilingual dictionaries and grammar rules, making it less effective for low-resource language pairs.

  2. B

    EBMT does not rely on explicit linguistic rules but instead retrieves and reuses translation examples, making it highly dependent on the quality of the example database.

  3. C

    RBMT has a strong ability to generalize to unseen inputs due to its reliance on manually crafted linguistic rules.

  4. D

    SMT can handle unseen words better than RBMT by leveraging subword-level probabilities for translation.

  5. E

    EBMT achieves higher translation accuracy than SMT in domain-specific scenarios if the example database contains relevant matches.

Show answer

Correct answers

  • A

    RBMT heavily relies on linguistic resources such as bilingual dictionaries and grammar rules, making it less effective for low-resource language pairs.

  • B

    EBMT does not rely on explicit linguistic rules but instead retrieves and reuses translation examples, making it highly dependent on the quality of the example database.

  • E

    EBMT achieves higher translation accuracy than SMT in domain-specific scenarios if the example database contains relevant matches.

Question 12

+3 marksOne or more correct options

Which of the following are key components of the BERT architecture?

Select all that apply.

  1. A

    Transformer decoder layers

  2. B

    Masked Language Modeling (MLM) objective

  3. C

    Sequence-to-sequence training architecture

  4. D

    Bidirectional context representation

Show answer

Correct answers

  • B

    Masked Language Modeling (MLM) objective

  • D

    Bidirectional context representation

Question 13

+3 marksOne or more correct options

In positional encoding for a transformer model, why are sine and cosine functions used for encoding positions?

Select all that apply.

  1. A

    To ensure that the position of each token is represented uniquely with periodic functions.

  2. B

    To represent positional embeddings in a way that scales linearly with sequence length.

  3. C

    To allow the model to generalize to unseen sequence lengths using the periodic nature of sine and cosine.

  4. D

    To reduce the number of parameters required for positional representations compared to learnable embeddings.

Show answer

Correct answers

  • A

    To ensure that the position of each token is represented uniquely with periodic functions.

  • C

    To allow the model to generalize to unseen sequence lengths using the periodic nature of sine and cosine.

Question 14

+3 marksOne or more correct options

What happens if you increase the number of attention heads in a transformer model while keeping the embedding size constant?

Select all that apply.

  1. A

    Each head's dimensionality decreases.

  2. B

    The computational complexity of the attention mechanism decreases.

  3. C

    The model learns more diverse relationships in the input sequence.

  4. D

    The model processes longer sequences without truncation.

Show answer

Correct answers

  • A

    Each head's dimensionality decreases.

  • C

    The model learns more diverse relationships in the input sequence.

Question 15

+3 marksOne or more correct options

Which of the following is/are INCORRECT?:

Select all that apply.

  1. A

    One-shot learning allows a model to correctly make predictions after seeing only a single example of the task.

  2. B

    Zero-shot learning adapts a model without any task-specific training, relying on its ability to generalize from pre-trained knowledge.

  3. C

    One-shot learning requires training the model with a single example from a new task to make predictions for similar cases.

  4. D

    Zero-shot learning requires the model to have seen examples from the task it is asked to perform.

Show answer

Correct answers

  • C

    One-shot learning requires training the model with a single example from a new task to make predictions for similar cases.

  • D

    Zero-shot learning requires the model to have seen examples from the task it is asked to perform.

Question 16

+4 marksNumerical answer

You are analyzing a collection of movie reviews using the Bag of Words (BoW) model. Here are three sample reviews:

The reviews were preprocessed using techniques such as lowercasing and lemmatization, resulting in 19 unique tokens in the vocabulary. Using the BoW model, you generate BoW vectors of length 19 for each review. Each BoW vector represents word frequencies without considering word order or context. Each BoW vector represents word frequencies without considering word order or context. Calculate the total number of non-zero entries across all three review vectors.Assume that each unique word from the vocabulary appears in at least one review. A word that appears in a review contributes one non-zero entry to that review's BoW vector.

Show answer

Correct answer: 26

Question 17

+3 marksNumerical answer

A simple RNN has 10 hidden units, and the input feature size is 5. If the output size is 8, what is the total number of trainable parameters in the RNN (excluding biases)?

Show answer

Correct answer: 230

Question 18

+3 marksNumerical answer

A model has 1,000,000 parameters. LoRA is applied to a 100 x 100 parameter matrix in the model and results in 400 new LoRA parameters. What will be the rank (r) of the LoRA matrices?

Show answer

Correct answer: 2