Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Text is sequential because the order of words and tokens helps determine meaning.
Question 2 of 60 · Sequential text data · Easy
What is a token in a text sequence?
Not quite. Try another option.
Answer: A unit such as a word
A token is a basic text unit, such as a word, subword, or character.
Question 3 of 60 · Recurrent neural networks · Easy
What allows a recurrent neural network to use information from earlier time steps?
Not quite. Try another option.
Answer: Its hidden state
The hidden state carries information from previous time steps through the sequence.
Question 4 of 60 · Recurrent neural networks · Easy
Which type of input is an RNN especially designed to process?
Not quite. Try another option.
Answer: Ordered sequence data
RNNs are designed for ordered data in which earlier elements may influence later elements.
Question 5 of 60 · Long short-term memory networks · Easy
What is the main purpose of an LSTM network?
Not quite. Try another option.
Answer: Learning long-term dependencies
LSTMs are designed to preserve useful information over longer sequences.
Question 6 of 60 · Long short-term memory networks · Easy
Which LSTM component decides what information should be removed from the cell state?
Not quite. Try another option.
Answer: Forget gate
The forget gate controls which information is discarded from the cell state.
Question 7 of 60 · Gated recurrent units · Easy
Which two gates are commonly used in a GRU?
Not quite. Try another option.
Answer: Update and reset gates
A GRU mainly uses update and reset gates to manage information flow.
Question 8 of 60 · Gated recurrent units · Easy
How does a GRU generally compare with an LSTM?
Not quite. Try another option.
Answer: It has a simpler structure
A GRU generally has fewer gates and a simpler architecture than an LSTM.
Question 9 of 60 · Bidirectional RNNs · Easy
How does a bidirectional RNN process a sequence?
Not quite. Try another option.
Answer: In forward and backward directions
A bidirectional RNN reads the sequence in both directions to capture past and future context.
Question 10 of 60 · Bidirectional RNNs · Easy
What is a key benefit of a bidirectional RNN for text processing?
Not quite. Try another option.
Answer: It uses context from both sides
Bidirectional RNNs can use information appearing before and after a token.
Question 11 of 60 · Sequence modeling applications · Easy
Which task is a common application of sequence modeling?
Not quite. Try another option.
Answer: Machine translation
Machine translation maps a sequence in one language to a sequence in another language.
Question 12 of 60 · Sequence modeling applications · Easy
In next-word prediction, what does a sequence model predict?
Not quite. Try another option.
Answer: The following word
Next-word prediction estimates the word most likely to follow the preceding sequence.
Question 13 of 60 · Sentiment classification · Easy
What does sentiment classification usually identify in a text?
Not quite. Try another option.
Answer: The expressed opinion
Sentiment classification identifies attitudes such as positive, negative, or neutral.
Question 14 of 60 · Sentiment classification · Easy
Which label would a basic sentiment classifier most likely assign to the review "I loved this movie"?
Not quite. Try another option.
Answer: Positive
The word "loved" clearly expresses a positive opinion about the movie.
Question 15 of 60 · Text classification · Easy
What is the goal of text classification?
Not quite. Try another option.
Answer: Assigning labels to text
Text classification assigns one or more predefined categories to a text.
Question 16 of 60 · Text classification · Easy
Which task is an example of text classification?
Not quite. Try another option.
Answer: Detecting spam emails
Spam detection classifies an email into categories such as spam or not spam.
Question 17 of 60 · Sequence training techniques · Easy
What is padding used for when training sequence models in batches?
Not quite. Try another option.
Answer: Making sequence lengths equal
Padding adds placeholder tokens so sequences of different lengths can form a batch.
Question 18 of 60 · Teacher forcing · Easy
What is supplied as the next decoder input during teacher forcing?
Not quite. Try another option.
Answer: The correct previous token
Teacher forcing uses the ground-truth token from the previous step as the next input.
Question 19 of 60 · Truncated backpropagation through time · Easy
What does truncated backpropagation through time limit during training?
Not quite. Try another option.
Answer: The number of unrolled steps
Truncated backpropagation limits how far gradients are propagated through the sequence.
Question 20 of 60 · Evaluation metrics for sequence tasks · Easy
Which metric measures the proportion of predicted positive cases that are actually positive?
Not quite. Try another option.
Answer: Precision
Precision is the fraction of predicted positive cases that are truly positive.
Question 21 of 60 · Sequential text data · Medium
Why is word order important when representing a sentence for a sequence model?
Not quite. Try another option.
Answer: It determines how meanings are composed across positions.
Word order affects syntax and meaning, so sequence models use positional context when processing text.
Question 22 of 60 · Recurrent neural networks · Medium
At time step , which information is typically used by a vanilla RNN to compute its hidden state?
Not quite. Try another option.
Answer: The previous hidden state and current input
A vanilla RNN updates its state using the current input and the hidden state from the previous time step.
Question 23 of 60 · Recurrent neural networks · Medium
An RNN performs well on short sequences but loses information from the beginning of very long sequences. Which problem most directly explains this behavior?
Not quite. Try another option.
Answer: Vanishing gradients during training
Repeated multiplication through many time steps can make gradients extremely small, limiting learning of long-range dependencies.
Question 24 of 60 · Long short-term memory networks · Medium
What is the main purpose of the forget gate in an LSTM?
Not quite. Try another option.
Answer: To select which cell-state information to discard
The forget gate controls how much of the previous cell state should be retained or removed.
Question 25 of 60 · Long short-term memory networks · Medium
For a sentiment classifier, why might an LSTM outperform a vanilla RNN when a sentiment cue appears far earlier than the final classification decision?
Not quite. Try another option.
Answer: It can preserve relevant information through gated memory.
LSTM gates regulate information flow and help maintain useful signals across long sequences.
Question 26 of 60 · Gated recurrent units · Medium
Which statement best describes a key difference between a GRU and an LSTM?
Not quite. Try another option.
Answer: A GRU uses gates but does not maintain a separate cell state.
GRUs combine memory and hidden-state information into one state, while LSTMs maintain separate cell and hidden states.
Question 27 of 60 · Gated recurrent units · Medium
A GRU's update gate tends to remain highly open for a time step. What behavior does this usually encourage?
Not quite. Try another option.
Answer: Retaining more of the previous state
The update gate controls how much existing state information is carried forward instead of being replaced.
Question 28 of 60 · Bidirectional RNNs · Medium
Why is a bidirectional RNN useful for named-entity recognition in a completed sentence?
Not quite. Try another option.
Answer: It can use context from both earlier and later words.
A bidirectional RNN combines forward and backward representations, allowing each token to use both left and right context.
Question 29 of 60 · Bidirectional RNNs · Medium
Which limitation should be considered when using a bidirectional RNN for real-time speech transcription?
Not quite. Try another option.
Answer: It generally needs future context before finalizing predictions.
The backward network reads later inputs, so online prediction may require waiting for future context.
Question 30 of 60 · Sequence modeling applications · Medium
Which task is most naturally modeled as sequence-to-sequence learning?
Not quite. Try another option.
Answer: Machine translation
Machine translation maps an input word sequence to an output word sequence, often with a different length.
Question 31 of 60 · Sequence modeling applications · Medium
In sequence labeling, how does the model output usually differ from document classification?
Not quite. Try another option.
Answer: It produces a label for each relevant time step.
Tasks such as part-of-speech tagging and named-entity recognition require predictions aligned with individual tokens.
Question 32 of 60 · Sentiment classification · Medium
A review says, "The camera is small, but the battery life is excellent." What is the main challenge in assigning an overall sentiment label?
Not quite. Try another option.
Answer: The text contains aspect-specific sentiments.
Different aspects receive different opinions, so the model must combine or distinguish sentiment across parts of the text.
Question 33 of 60 · Text classification · Medium
Why can a recurrent model be preferable to a bag-of-words classifier for detecting whether a message is a question?
Not quite. Try another option.
Answer: It can represent word order and local context.
Question structure can depend on ordering and interactions among words, which bag-of-words features discard.
Question 34 of 60 · Text classification · Medium
A dataset has 95% negative examples and 5% positive examples. Which evaluation choice gives the clearest view of positive-class performance?
Not quite. Try another option.
Answer: Precision, recall, and the F1-score for the positive class
With severe class imbalance, accuracy can hide poor positive detection; precision, recall, and F1 provide more informative measures.
Question 35 of 60 · Sequence training techniques · Medium
Why are padding masks used when training on a batch of variable-length sequences?
Not quite. Try another option.
Answer: To prevent padding positions from affecting loss or attention.
Padding is added for batching convenience, but it does not represent real content and should usually be ignored.
Question 36 of 60 · Sequence training techniques · Medium
A sequence model overfits its training set while achieving much worse validation performance. Which technique is a reasonable response?
Not quite. Try another option.
Answer: Apply dropout or recurrent regularization.
Regularization can reduce overfitting by discouraging the model from relying too heavily on particular activations or patterns.
Question 37 of 60 · Teacher forcing · Medium
During teacher forcing for next-token prediction, what is fed to the decoder at time ?
Not quite. Try another option.
Answer: The ground-truth token from time
Teacher forcing supplies the correct previous target token as input while training the next prediction.
Question 38 of 60 · Teacher forcing · Medium
What is a common drawback of using teacher forcing during training but relying only on model predictions during inference?
Not quite. Try another option.
Answer: Exposure bias from different training and inference inputs
During training the model sees correct previous tokens, but at inference it must use its own predictions, so errors can accumulate.
Question 39 of 60 · Truncated backpropagation through time · Medium
What is the primary purpose of truncated backpropagation through time?
Not quite. Try another option.
Answer: To limit memory use and computational cost over long sequences.
TBPTT backpropagates through only a fixed window of time steps, making long-sequence training more manageable.
Question 40 of 60 · Truncated backpropagation through time · Medium
If the truncation window is too short, which behavior is most likely?
Not quite. Try another option.
Answer: The model may fail to learn dependencies longer than the window.
Gradients cannot connect events separated by more than the truncation length, which limits learning of long-range relationships.
Question 41 of 60 · Sequential text data · Hard
A batch contains right-padded sequences with true lengths . A unidirectional RNN processes all seven time steps without packing or masking, and its hidden state is updated normally for padding tokens. Which representation should be used to classify the second sequence while preserving its intended semantics?
Not quite. Try another option.
Answer: The hidden state at time step for the second sequence
Time step is the last valid token. Later states incorporate padding-token transitions and therefore need not represent the original sequence.
Question 42 of 60 · Recurrent neural networks · Hard
For a linearized RNN, , suppose is normal and has spectral radius . Ignoring loss-specific factors, what is the asymptotic behavior of the gradient contribution propagated across recurrent steps?
Not quite. Try another option.
Answer: It typically decays on the order of
Backpropagation repeatedly multiplies by . For a normal matrix, the dominant scaling is governed by , producing vanishing gradients.
Question 43 of 60 · Long short-term memory networks · Hard
An LSTM uses . Along one cell dimension, assume indirect dependencies through the gates are ignored and for 200 steps. Approximately what fraction of a gradient on reaches through the direct cell-state path?
Not quite. Try another option.
Answer:
The direct derivative is the product of forget gates: .
Question 44 of 60 · Gated recurrent units · Hard
A GRU has input size and hidden size . Each of its reset, update, and candidate computations has an input matrix, a recurrent matrix, and one bias vector. Excluding embeddings and output layers, how many trainable scalar parameters does it have?
Not quite. Try another option.
Answer:
Each of the three GRU computations contributes input weights, recurrent weights, and biases.
Question 45 of 60 · Bidirectional RNNs · Hard
A bidirectional RNN is trained for token-level prediction using the entire sentence. The system must later emit each prediction immediately as a token arrives in a live stream. What is the central deployment incompatibility?
Not quite. Try another option.
Answer: The backward state depends on future tokens unavailable at emission time
A standard backward RNN requires the sequence suffix. Immediate causal prediction cannot reproduce that representation without lookahead or delayed output.
Question 46 of 60 · Sequence modeling applications · Hard
A named-entity recognizer independently predicts BIO tags and frequently outputs illegal transitions such as O I-PER. Which modification most directly models dependencies between adjacent output labels while retaining neural token representations?
Not quite. Try another option.
Answer: Add a linear-chain CRF over the token-level emission scores
A linear-chain CRF learns transition scores and performs sequence-level decoding, allowing legal label patterns to be favored globally.
Question 47 of 60 · Sentiment classification · Hard
A document-level sentiment model uses only the final hidden state of a unidirectional RNN. Reviews are truncated to their last 200 tokens, but sentiment-changing premises often occur near the beginning. Which change most directly preserves those premises without increasing the 200-token limit?
Not quite. Try another option.
Answer: Use a hierarchical model that encodes chunks and then their sequence
Hierarchical encoding can summarize multiple chunks before document-level classification, retaining information beyond a single 200-token window.
Question 48 of 60 · Text classification · Hard
In a multilabel text classifier, each label is trained with binary cross-entropy. Label A is common and Label B is rare, and their score distributions differ substantially. Which validation procedure is most appropriate when the target metric is macro-?
Not quite. Try another option.
Answer: Tune a separate decision threshold for each label on validation data
Multilabel probabilities need not sum to one, and macro- gives each label equal weight. Per-label thresholds can accommodate differing prevalence and calibration.
Question 49 of 60 · Sequence training techniques · Hard
During sequence-model training, scheduled sampling increasingly replaces gold previous tokens with model-generated tokens. Which theoretical issue can remain even if this improves robustness at inference time?
Not quite. Try another option.
Answer: The training objective may become inconsistent with maximum-likelihood estimation
Scheduled sampling trains on a changing mixture of gold and model-generated histories, so its objective is generally not the standard sequence likelihood.
Question 50 of 60 · Teacher forcing · Hard
A decoder trained with full teacher forcing has low validation loss when conditioned on gold prefixes but produces poor long free-running sequences. Which explanation best identifies the mismatch?
Not quite. Try another option.
Answer: Inference conditions on model errors that were absent from training prefixes
Teacher forcing exposes the decoder to correct histories. At inference, an early error becomes part of the next input and can cause compounding distribution shift.
Question 51 of 60 · Truncated backpropagation through time · Hard
A stateful RNN processes a long stream in consecutive chunks of 50 steps. The final hidden value of each chunk initializes the next chunk, but it is detached from the computation graph at every boundary. Which statement is correct?
Not quite. Try another option.
Answer: Forward information crosses boundaries, but gradients do not cross them
Detaching preserves the numerical hidden state for the next chunk while severing its autograd history, limiting backward credit assignment to the current truncation window.
Question 52 of 60 · Evaluation metrics for sequence tasks · Hard
A language model has average negative log-likelihood nats per token on a corpus. What is its token-level perplexity?
Not quite. Try another option.
Answer:
When cross-entropy is measured with natural logarithms, perplexity is , giving .
Question 53 of 60 · Evaluation metrics for sequence tasks · Hard
Two translation systems are evaluated with BLEU. System X produces fluent paraphrases with few exact reference -grams, while System Y copies many reference phrases but occasionally changes critical meanings. Which limitation of BLEU is most directly illustrated?
Not quite. Try another option.
Answer: Reference overlap may not reliably reflect semantic adequacy
BLEU emphasizes surface -gram overlap. Valid paraphrases can score poorly, while outputs with misleading but overlapping phrases can score relatively well.
Question 54 of 60 · Long short-term memory networks · Hard
For an LSTM, . Suppose a cell stores useful information with , but is nearly zero. What follows at time ?
Not quite. Try another option.
Answer: The information remains in but is mostly hidden from
The output gate controls exposure of the cell state through ; it does not directly erase the stored cell value.
Question 55 of 60 · Gated recurrent units · Hard
Consider the GRU convention . If is approximately zero in every dimension, what behavior results?
Not quite. Try another option.
Answer: The previous hidden state is copied with little modification
Under the stated convention, gives . Some sources reverse the naming convention, so the explicit equation is decisive.
Question 56 of 60 · Sequential text data · Hard
A model mean-pools token representations for text classification. A minibatch is right-padded, and padding vectors are zeros before entering a recurrent encoder. Why must the pooling operation still use a length mask?
Not quite. Try another option.
Answer: Recurrent outputs at padded positions can be nonzero and alter the mean
A zero input does not imply a zero recurrent output because the prior hidden state and biases still affect the transition. Unmasked padding can therefore distort the pooled representation.
Question 57 of 60 · Bidirectional RNNs · Hard
A bidirectional LSTM has hidden size in each direction and concatenates its forward and backward states at every token. A linear token classifier predicts classes. Ignoring bias, what is the classifier weight matrix shape under the convention ?
Not quite. Try another option.
Answer:
Concatenation produces . Mapping it to logits requires .
Question 58 of 60 · Text classification · Hard
A binary text classifier is evaluated on 10,000 examples, of which only 100 are positive. It predicts every example as negative. Which metric can appear deceptively strong despite total failure on the positive class?
Not quite. Try another option.
Answer: Accuracy, which equals
The model correctly labels 9,900 negatives, yielding accuracy, but positive recall is zero and positive-class is zero.
Question 59 of 60 · Sequence training techniques · Hard
An RNN occasionally produces extremely large gradient norms because products of recurrent Jacobians amplify particular directions. Which intervention directly bounds the magnitude of each parameter update while largely preserving the gradient direction?
Not quite. Try another option.
Answer: Clip the global gradient norm before the optimizer step
Global-norm clipping rescales the full gradient vector when its norm exceeds a threshold, limiting update magnitude while preserving its direction.
Question 60 of 60 · Evaluation metrics for sequence tasks · Hard
A BIO-tagged NER prediction identifies the correct entity type but extends the entity by one token beyond the gold boundary. Under strict entity-level micro-, how is this single predicted span counted?
Not quite. Try another option.
Answer: As one false positive and one false negative
Strict span evaluation requires both type and boundaries to match. The incorrect predicted span is a false positive, and the unmatched gold span is a false negative.
That's unit 3
Answer a few questions and your score shows up here.
Nearly through. Did unit 3 of CSE472 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 3 of CSE472 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.