Unit 4: Sequence-to-Sequence Models and Attention Mechanisms - Practice Quiz

CSE472 — Deep Learning For Natural Language Processing 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main role of the encoder in an encoder-decoder architecture?

Encoder-decoder architectures for NLP Easy
A. Calculate the evaluation score
B. Generate the final output sequence
C. Represent the input sequence
D. Remove words from the output

2 What does the decoder typically produce at each time step?

Encoder-decoder architectures for NLP Easy
A. An output token
B. An input embedding
C. A training epoch
D. An evaluation dataset

3 In machine translation, what does a sequence-to-sequence model map?

Sequence-to-sequence models for machine translation and summarization Easy
A. A sentence to another sentence
B. A label to a feature vector
C. An image to another image
D. A number to a category

4 What is the expected output of a sequence-to-sequence text summarization model?

Sequence-to-sequence models for machine translation and summarization Easy
A. A list of input embeddings
B. A translation of the input
C. A shorter version of the input
D. A category for each word

5 What does an attention mechanism allow a decoder to do?

Attention in deep NLP Easy
A. Ignore all encoder representations
B. Use only the first input token
C. Focus on relevant input positions
D. Replace every output with a label

6 Why is attention useful for processing long input sequences?

Attention in deep NLP Easy
A. It removes the decoder entirely
B. It sorts input tokens alphabetically
C. It accesses multiple encoder states
D. It fixes the output sequence length

7 How does soft attention usually combine encoder hidden states?

Soft attention Easy
A. As a random sample
B. As a weighted sum
C. As a binary label
D. As an unweighted maximum

8 Which function is commonly used to normalize soft attention scores into weights?

Soft attention Easy
A. Softmax
B. Pooling
C. Dropout
D. ReLU

9 What does an alignment score measure in an attention-based model?

Alignment mechanisms Easy
A. The size of the vocabulary
B. The number of decoder layers
C. The relevance of an input state
D. The length of the training dataset

10 In machine translation, alignment often connects which two elements?

Alignment mechanisms Easy
A. Training and test losses
B. Source and target tokens
C. Epochs and batch sizes
D. Input and output datasets

11 Bahdanau attention is also commonly known as which type of attention?

Bahdanau attention Easy
A. Multiplicative attention
B. Masked self-attention
C. Additive attention
D. Sparse attention

12 Which information does Bahdanau attention use to compute an alignment score?

Bahdanau attention Easy
A. A batch size and a learning rate
B. A decoder state and an encoder state
C. A BLEU score and a ROUGE score
D. A source length and a target length

13 Luong attention is commonly associated with which scoring approach?

Luong attention Easy
A. Binary scoring
B. Multiplicative scoring
C. Random scoring
D. Additive scoring

14 In global Luong attention, which encoder hidden states may be considered?

Luong attention Easy
A. Only the first hidden state
B. No encoder hidden states
C. All encoder hidden states
D. Only the final hidden state

15 What is the context vector in an attention-based encoder-decoder model?

Integrating attention into encoder-decoder networks Easy
A. A score for the full dataset
B. A count of decoder parameters
C. A weighted combination of encoder states
D. A fixed list of target words

16 How does the attention context vector usually change during decoding?

Integrating attention into encoder-decoder networks Easy
A. It is recomputed at each output step
B. It is removed after the first input
C. It is shared only across training epochs
D. It remains random for every output

17 What is a reference text in sequence generation evaluation?

Evaluation techniques Easy
A. A human-provided expected output
B. A record of training batches
C. A randomly initialized hidden state
D. A list of model parameters

18 BLEU primarily evaluates generated text using which type of comparison?

BLEU scores Easy
A. Vocabulary size
B. N-gram precision
C. Sentence sentiment
D. Character edit distance

19 ROUGE is most commonly used to evaluate which NLP task?

ROUGE scores Easy
A. Text summarization
B. Part-of-speech tagging
C. Word embedding training
D. Speech recognition

20 What is a major limitation of a classical sequence-to-sequence model without attention?

Limitations of classical sequence-to-sequence models Easy
A. It compresses the input into one fixed vector
B. It cannot generate variable-length outputs
C. It always copies the input unchanged
D. It requires every input to have one token

21 In an encoder-decoder architecture for machine translation, what is the primary role of the encoder?

Encoder-decoder architectures for NLP Medium
A. Generate the target-language sentence directly
B. Calculate the BLEU score for the translation
C. Convert the source sequence into a useful representation
D. Select the vocabulary used by the decoder

22 Why is teacher forcing commonly used when training an encoder-decoder model?

Encoder-decoder architectures for NLP Medium
A. It forces every attention weight to have the same value
B. It supplies the correct previous target token during training
C. It replaces the encoder with a feed-forward network
D. It removes the need for target-side vocabulary embeddings

23 A sequence-to-sequence model is used for abstractive summarization. Which behavior best distinguishes abstractive summarization from extractive summarization?

Sequence-to-sequence models for machine translation and summarization Medium
A. It selects only the longest sentences in the document
B. It generates new wording that expresses the source meaning
C. It removes punctuation before producing the summary
D. It copies complete sentences without modification

24 During inference, why is beam search often preferred over greedy decoding in a translation model?

Sequence-to-sequence models for machine translation and summarization Medium
A. It guarantees the grammatically perfect translation
B. It selects tokens without using probability estimates
C. It evaluates several promising partial sequences
D. It eliminates the need for a trained decoder

25 What problem does attention primarily address in a basic encoder-decoder model?

Attention in deep NLP Medium
A. The dependence on a single fixed-length source vector
B. The absence of a loss function during optimization
C. The inability to represent any target vocabulary
D. The requirement that source and target lengths match

26 In soft attention, the context vector is typically computed as:

Soft attention Medium
A. The final decoder state copied to every position
B. A random source representation selected at each step
C. A weighted sum of encoder states
D. The maximum encoder state over all source positions

27 Why can soft attention be trained using standard backpropagation?

Soft attention Medium
A. It avoids computing decoder hidden states entirely
B. It makes a hard, non-differentiable selection
C. It assigns one fixed weight to every input token
D. It uses continuous attention weights over source states

28 In an attention-based translation model, alignment scores are used to estimate:

Alignment mechanisms Medium
A. The similarity between a decoder state and source states
B. The number of layers required by the encoder
C. The frequency of punctuation in the target sentence
D. The total memory consumed during model training

29 After applying softmax to alignment scores for one decoding step, what does a larger attention weight indicate?

Alignment mechanisms Medium
A. The target sequence has reached its final token
B. The encoder state has a smaller numerical magnitude
C. The corresponding source position is more relevant
D. The corresponding source token must be copied exactly

30 Which description best matches Bahdanau attention?

Bahdanau attention Medium
A. Dot-product scoring without any trainable parameters
B. Uniform averaging of all encoder hidden states
C. Additive scoring using a learned feed-forward network
D. Selecting the source state with the largest token frequency

31 In the original Bahdanau formulation, which decoder state is commonly used to calculate attention scores for target step ?

Bahdanau attention Medium
A. The previous decoder state
B. The final encoder state only
C. The next decoder state
D. The average target embedding for the sentence

32 Which scoring function is most directly associated with Luong dot-product attention?

Luong attention Medium
A.
B.
C.
D.

33 What is a key distinction between general Luong attention and dot-product Luong attention?

Luong attention Medium
A. General attention calculates scores only from token counts
B. General attention removes all encoder representations
C. General attention inserts a learned transformation matrix
D. General attention uses hard sampling instead of softmax

34 How is the context vector commonly used by an attention-based decoder?

Integrating attention into encoder-decoder networks Medium
A. It prevents the decoder from updating its hidden state
B. It replaces the target vocabulary with source tokens
C. It is used only after the complete sequence is generated
D. It is combined with the decoder state to predict the next token

35 Suppose an input has 12 source tokens and the decoder generates 8 target tokens. What is the typical size of the attention matrix for one example?

Integrating attention into encoder-decoder networks Medium
A.
B.
C.
D.

36 Why should automatic metrics for generated summaries or translations be interpreted alongside human evaluation?

Evaluation techniques Medium
A. Human evaluation is required to calculate every token probability
B. Human evaluation eliminates the need for a test dataset
C. Automatic metrics always produce identical scores for all systems
D. Automatic metrics may miss fluency, factuality, or semantic adequacy

37 A translation receives a high modified n-gram precision but is much shorter than the reference. Which BLEU component helps penalize this output?

BLEU scores Medium
A. The encoder dropout rate
B. The brevity penalty
C. The vocabulary coverage ratio
D. The attention entropy

38 Why does BLEU use clipped n-gram counts instead of unrestricted candidate n-gram counts?

BLEU scores Medium
A. To ensure that all candidate words appear in the same order
B. To measure source-sentence length without using references
C. To reward every repeated phrase regardless of the reference
D. To prevent repeated candidate phrases from inflating precision

39 Which ROUGE variant primarily measures recall of overlapping unigrams between a generated summary and a reference summary?

ROUGE scores Medium
A. ROUGE-SU
B. ROUGE-2
C. ROUGE-1
D. ROUGE-L

40 ROUGE-L is based primarily on which type of overlap?

ROUGE scores Medium
A. Longest common subsequence
B. The number of unique words in the source
C. Exact sentence-length equality
D. Character-level edit distance only

41 A bidirectional encoder produces states , while a decoder GRU expects an initial state in . Which initialization preserves information from both encoder directions while satisfying the decoder's dimensional constraint?

Encoder-decoder architectures for NLP Hard
A. Set and truncate during decoding
B. Set without learned parameters
C. Set with
D. Set with

42 A summarization decoder is trained with teacher forcing and achieves low token-level cross-entropy, but at inference time an early incorrect token causes increasingly incoherent output. Which train-test discrepancy most directly explains this behavior?

Sequence-to-sequence models for machine translation and summarization Hard
A. Training uses padded batches, whereas inference processes one sequence at a time
B. Training conditions on gold prefixes, whereas inference conditions on model-generated prefixes
C. Training minimizes token loss, whereas inference always maximizes sequence-level recall
D. Training uses a bidirectional encoder, whereas inference uses a unidirectional decoder

43 Beam search compares hypothesis of length with log-probability and hypothesis of length with log-probability . If the score is average log-probability , which hypothesis is selected?

Sequence-to-sequence models for machine translation and summarization Hard
A. Hypothesis , because longer sequences always receive larger scores
B. Hypothesis , because its normalized score is
C. Hypothesis , because its normalized score is
D. Hypothesis , because before normalization

44 For cross-attention with target length , source length , and hidden dimension , all projected query-key dot products are computed explicitly. Ignoring projection costs, what are the time and attention-matrix space complexities?

Attention in deep NLP Hard
A. Time and space
B. Time and space
C. Time and space
D. Time and space

45 Let attention weights be and scalar encoder states be . What context value is supplied to a standard soft-attention decoder?

Soft attention Hard
A. , obtained from the weighted state sum
B. , obtained from the weighted source positions
C. , obtained by selecting the expected source index
D. , obtained by selecting the modal encoder state

46 A batch contains padded source sequences. Before the alignment softmax, the scores for one example are , where the last two positions are padding. Which operation gives a valid alignment over only real tokens?

Alignment mechanisms Hard
A. Multiply padded scores by after applying the softmax
B. Replace padded scores by and then apply softmax
C. Apply softmax first and then delete the padded probabilities
D. Replace padded scores by and apply softmax over all positions

47 Which expression correctly represents the additive alignment score used by Bahdanau attention for decoder state and encoder state ?

Bahdanau attention Hard
A.
B.
C.
D.

48 In Luong's multiplicative attention, which scoring function can compare encoder and decoder states of different original dimensions without requiring them to be equal?

Luong attention Hard
A. The general score with a learned matrix
B. The dot score with no projections
C. The cosine score with no projections
D. The identity score with no projections

49 Consider the common recurrent formulations of Bahdanau and Luong attention. Which timing distinction is accurate?

Bahdanau attention Hard
A. Bahdanau commonly computes context from after output projection; Luong commonly attends using before recurrence
B. Bahdanau commonly computes context from before updating ; Luong commonly attends using after updating it
C. Both mechanisms must compute context from after emitting the output token
D. Both mechanisms must compute context from before the recurrent update

50 What is the primary modeling effect of input feeding in Luong attention, where the previous attentional vector is concatenated with the next decoder input?

Luong attention Hard
A. It forces every source position to receive equal total attention mass
B. It removes the need to normalize alignment scores with softmax
C. It guarantees monotonic source-to-target alignments during decoding
D. It makes the next recurrent state depend on the previous attention-informed prediction state

51 An encoder output matrix is , attention weights at step are , and the decoder state is . If and the output layer consumes , what must be the input width of that output layer?

Integrating attention into encoder-decoder networks Hard
A.
B.
C.
D.

52 A decoder applies soft attention, but the context vector is accidentally detached from the computation graph before the token loss is computed. Assuming no other loss uses attention, which parameters lose the token-loss gradient path?

Integrating attention into encoder-decoder networks Hard
A. The target embedding matrix and output projection
B. Only the decoder's recurrent transition parameters
C. Only the output vocabulary bias parameters
D. The alignment network and encoder through the context path

53 A candidate is the cat the cat and the single reference is the cat is here. Using clipped unigram precision, how many candidate unigram matches are counted and what is the resulting precision?

BLEU scores Hard
A. match and precision
B. matches and precision
C. matches and precision
D. matches and precision

54 A corpus-level BLEU calculation has candidate length , effective reference length , and geometric mean modified precision . Using when , what is BLEU?

BLEU scores Hard
A. Approximately
B. Approximately
C. Approximately
D. Approximately

55 A candidate sentence has positive modified unigram, bigram, and trigram precisions but no matching 4-grams. Under unsmoothed BLEU-4 with uniform weights, what score does the sentence receive?

BLEU scores Hard
A. A positive score because lower-order matches override the missing 4-grams
B. The arithmetic mean of the three positive modified precisions
C. Zero, because one precision contributes to the geometric mean
D. The trigram BLEU score multiplied only by the brevity penalty

56 A generated summary contains occurrences of a bigram, while the reference contains occurrences of that bigram. All other bigrams have zero overlap, and the reference has bigram tokens in total. What is the clipped ROUGE-2 recall?

ROUGE scores Hard
A.
B.
C.
D.

57 For candidate tokens A B C D and reference tokens B A C D, the longest common subsequence has length . What are ROUGE-L precision, recall, and for this pair?

ROUGE scores Hard
A. , ,
B. , ,
C. , ,
D. , ,

58 Two summarization systems obtain nearly identical ROUGE scores, but one frequently introduces unsupported names and dates. Which evaluation addition most directly distinguishes the systems on this failure mode?

Evaluation techniques Hard
A. Report token-level cross-entropy on the training summaries
B. Compute corpus BLEU with a larger maximum n-gram order
C. Measure source-grounded factual consistency with human or entailment-based evaluation
D. Increase the maximum generated length before recomputing ROUGE-L

59 Why does adding attention usually improve a recurrent encoder-decoder on long inputs without completely eliminating its long-sequence limitations?

Limitations of classical sequence-to-sequence models Hard
A. Attention provides direct access to encoder states, but recurrent state updates remain sequential
B. Attention guarantees perfect alignment, but increases the target vocabulary size
C. Attention compresses all encoder states into one vector, but removes recurrent computation
D. Attention parallelizes every decoder step, but prevents access to distant source states

60 In a translation model, repeated target phrases arise because the decoder repeatedly attends to the same source positions. Which modification most directly addresses this alignment pathology?

Alignment mechanisms Hard
A. Remove attention normalization from the alignment scores
B. Apply a stronger brevity penalty during beam search
C. Replace the source embeddings with larger target embeddings
D. Add a coverage signal derived from cumulative past attention