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. Remove words from the output
B. Represent the input sequence
C. Generate the final output sequence
D. Calculate the evaluation score

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

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

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

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

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 translation of the input
B. A list of input embeddings
C. A category for each word
D. A shorter version of the input

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

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

6 Why is attention useful for processing long input sequences?

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

7 How does soft attention usually combine encoder hidden states?

Soft attention Easy
A. As a binary label
B. As a random sample
C. As a weighted sum
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 relevance of an input state
C. The length of the training dataset
D. The number of decoder layers

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

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

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

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

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

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

13 Luong attention is commonly associated with which scoring approach?

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

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

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

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 weighted combination of encoder states
C. A count of decoder parameters
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 removed after the first input
B. It remains random for every output
C. It is shared only across training epochs
D. It is recomputed at each output step

17 What is a reference text in sequence generation evaluation?

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

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

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

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

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

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 cannot generate variable-length outputs
B. It always copies the input unchanged
C. It compresses the input into one fixed vector
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. Select the vocabulary used by the decoder
B. Calculate the BLEU score for the translation
C. Generate the target-language sentence directly
D. Convert the source sequence into a useful representation

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

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

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 removes punctuation before producing the summary
B. It copies complete sentences without modification
C. It generates new wording that expresses the source meaning
D. It selects only the longest sentences in the document

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 evaluates several promising partial sequences
B. It guarantees the grammatically perfect translation
C. It eliminates the need for a trained decoder
D. It selects tokens without using probability estimates

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 requirement that source and target lengths match
D. The inability to represent any target vocabulary

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

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

27 Why can soft attention be trained using standard backpropagation?

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

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

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

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

Alignment mechanisms Medium
A. The corresponding source position is more relevant
B. The encoder state has a smaller numerical magnitude
C. The target sequence has reached its final token
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. Additive scoring using a learned feed-forward network
C. Uniform averaging of all encoder hidden states
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 next decoder state
B. The previous decoder state
C. The average target embedding for the sentence
D. The final encoder state only

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 inserts a learned transformation matrix
B. General attention calculates scores only from token counts
C. General attention uses hard sampling instead of softmax
D. General attention removes all encoder representations

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

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

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. Automatic metrics may miss fluency, factuality, or semantic adequacy
B. Human evaluation eliminates the need for a test dataset
C. Human evaluation is required to calculate every token probability
D. Automatic metrics always produce identical scores for all systems

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 attention entropy
D. The vocabulary coverage ratio

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

BLEU scores Medium
A. To reward every repeated phrase regardless of the reference
B. To ensure that all candidate words appear in the same order
C. To measure source-sentence length without using references
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-L
D. ROUGE-1

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

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

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 without learned parameters
B. Set with
C. Set with
D. Set and truncate during decoding

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 conditions on gold prefixes, whereas inference conditions on model-generated prefixes
B. Training uses a bidirectional encoder, whereas inference uses a unidirectional decoder
C. Training uses padded batches, whereas inference processes one sequence at a time
D. Training minimizes token loss, whereas inference always maximizes sequence-level recall

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 its normalized score is
B. Hypothesis , because longer sequences always receive larger scores
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 by selecting the expected source index
C. , obtained by selecting the modal encoder state
D. , obtained from the weighted source positions

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. Replace padded scores by and then apply softmax
B. Apply softmax first and then delete the padded probabilities
C. Multiply padded scores by after applying the softmax
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 identity score with no projections
C. The dot score with no projections
D. The cosine 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 before updating ; Luong commonly attends using after updating it
B. Bahdanau commonly computes context from after output projection; Luong commonly attends using before recurrence
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 makes the next recurrent state depend on the previous attention-informed prediction state
C. It guarantees monotonic source-to-target alignments during decoding
D. It removes the need to normalize alignment scores with softmax

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. Only the output vocabulary bias parameters
B. The alignment network and encoder through the context path
C. The target embedding matrix and output projection
D. Only the decoder's recurrent transition parameters

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. matches and precision
B. match 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. The trigram BLEU score multiplied only by the brevity penalty
B. The arithmetic mean of the three positive modified precisions
C. A positive score because lower-order matches override the missing 4-grams
D. Zero, because one precision contributes to the geometric mean

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. Increase the maximum generated length before recomputing ROUGE-L
B. Report token-level cross-entropy on the training summaries
C. Compute corpus BLEU with a larger maximum n-gram order
D. Measure source-grounded factual consistency with human or entailment-based evaluation

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 parallelizes every decoder step, but prevents access to distant source states
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 provides direct access to encoder states, but recurrent state updates remain sequential

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. Add a coverage signal derived from cumulative past attention
B. Apply a stronger brevity penalty during beam search
C. Replace the source embeddings with larger target embeddings
D. Remove attention normalization from the alignment scores