Unit 5: Modeling Sequential Data Using Recurrent Neural Networks - Practice Quiz

INT422 — Deep Learning 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 Which feature distinguishes sequential data from ordinary independent data?

Modeling sequential data Easy
A. Every observation has one feature
B. The order of observations matters
C. The dataset has no labels
D. All observations are identical

2 Which of the following is an example of sequential data?

Modeling sequential data Easy
A. A collection of unrelated photographs
B. A set of shuffled color values
C. A table of independent customer IDs
D. A sentence containing ordered words

3 What information does the hidden state of an RNN mainly represent?

Understanding the structure and flow of an RNN Easy
A. A summary of previous inputs
B. A copy of the final label
C. A list of model errors
D. A fixed learning rate

4 What is typically passed from one time step to the next in a basic RNN?

Understanding the structure and flow of an RNN Easy
A. The hidden state
B. The loss function
C. The test dataset
D. The batch size

5 Which two values are normally used to compute the current hidden activation in a basic RNN?

Computing activation in an RNN Easy
A. Current label and future hidden state
B. Current input and previous hidden state
C. Batch size and learning rate
D. Previous output and test accuracy

6 Which activation function is traditionally used for the hidden state of a simple RNN?

Computing activation in an RNN Easy
A. Tanh
B. One-hot encoding
C. Argmax
D. Softmax

7 Which problem can make a basic RNN forget information from much earlier time steps?

Challenges of learning long-range interactions Easy
A. One-hot encoding
B. Vanishing gradients
C. Data shuffling
D. Label smoothing

8 What is meant by a long-range dependency in a sequence?

Challenges of learning long-range interactions Easy
A. A difference between training batches
B. A connection between two model layers
C. A connection between widely separated time steps
D. A comparison between two datasets

9 Which TensorFlow API is commonly used to build neural network layers?

Implementing a multilayer RNN for sequence modeling in TensorFlow Easy
A. TensorBoard Profiler
B. TensorFlow Serving
C. TensorFlow Keras
D. TensorFlow Lite

10 What makes an RNN a multilayer RNN?

Implementing a multilayer RNN for sequence modeling in TensorFlow Easy
A. Multiple recurrent layers are stacked
B. Multiple datasets are combined
C. Multiple optimizers are alternated
D. Multiple labels are removed

11 What is the usual output of a text classification RNN?

Text classification with an RNN Easy
A. A sequence length
B. A class label
C. A vocabulary list
D. A generated paragraph

12 What is the main purpose of an embedding layer in an RNN text classifier?

Text classification with an RNN Easy
A. Sort sentences by length
B. Convert tokens into dense vectors
C. Remove every repeated word
D. Calculate the final accuracy

13 During basic RNN text generation, what is commonly fed back into the model to continue the sequence?

Text generation with an RNN Easy
A. The previously generated token
B. The optimizer's name
C. The complete training dataset
D. The model's batch size

14 What does the softmax output represent in a character-level text generation model?

Text generation with an RNN Easy
A. Probabilities of possible next characters
B. Lengths of all training sentences
C. Counts of completed training epochs
D. Weights of the recurrent connections

15 What is the goal of time series forecasting?

Time series forecasting Easy
A. Group images by visual similarity
B. Translate labels into feature vectors
C. Predict future values from past observations
D. Remove the order from observations

16 Which dataset is most suitable for time series forecasting?

Time series forecasting Easy
A. Randomly generated identification codes
B. Independent images of household objects
C. Unordered names in a contact list
D. Daily temperatures recorded over a year

17 What does LSTM stand for?

LSTM units Easy
A. Local Signal Testing Machine
B. Linear Sequence Training Model
C. Long Short-Term Memory
D. Layered State Transfer Method

18 Which component of an LSTM controls what information is removed from the cell state?

LSTM units Easy
A. Forget gate
B. Embedding table
C. Output layer
D. Softmax class

19 Why is an LSTM suitable for sequence classification?

Sequence classification with LSTM Easy
A. It always removes the sequence order
B. It requires no numerical input values
C. It guarantees perfect class predictions
D. It can retain information across time steps

20 What is a stacked LSTM model?

Stacked LSTM for sequence classification Easy
A. A model with multiple LSTM layers
B. A model with multiple test datasets
C. A model with multiple input labels
D. A model with multiple loss values

21 A model predicts the next value in a sensor stream using the previous 20 readings. Why should the readings within each input window not be randomly shuffled?

Modeling sequential data Medium
A. Shuffling forces every sensor reading to have the same value
B. Shuffling always increases the number of training parameters
C. Shuffling prevents the use of nonlinear activation functions
D. Shuffling changes the temporal relationships the model must learn

22 An RNN processes an input sequence with 12 time steps and produces one hidden state at each step. If the hidden size is 32, what is the output shape for a batch of 64 sequences when all hidden states are returned?

Understanding the structure and flow of an RNN Medium
A.
B.
C.
D.

23 For a scalar RNN, let . If , , , , and , what is approximately?

Computing activation in an RNN Medium
A.
B.
C.
D.

24 During backpropagation through time, why are gradient contributions from different time steps added when updating the recurrent weight matrix?

Understanding the structure and flow of an RNN Medium
A. Each time step creates an independent recurrent weight matrix
B. The same recurrent weights are reused at every time step
C. The recurrent weights are updated only from the final input because earlier hidden states are treated as constants throughout training
D. Gradient addition converts the sequence into unordered tabular data

25 An RNN repeatedly multiplies gradients by recurrent derivatives whose magnitudes are mostly below 1. What problem is most likely for long sequences?

Challenges of learning long-range interactions Medium
A. Gradients for early time steps become extremely large
B. Hidden states become independent trainable parameters
C. Sequence lengths automatically decrease during training
D. Gradients for early time steps become very small

26 Training an RNN becomes unstable because the gradient norm occasionally grows from 8 to several thousand. Which technique most directly addresses this behavior?

Challenges of learning long-range interactions Medium
A. Replace every hidden state with the original input at each time step
B. Sort sequences by their target labels
C. Remove all recurrent connections
D. Clip gradients to a maximum norm

27 In TensorFlow/Keras, two recurrent layers are stacked. What setting is normally required on the first recurrent layer so that the second layer receives a sequence?

Implementing a multilayer RNN for sequence modeling in TensorFlow Medium
A. Set unroll=False
B. Set stateful=False
C. Set return_state=True
D. Set return_sequences=True

28 A batch contains variable-length sequences padded with zeros. What is the main purpose of adding a Keras Masking layer before the RNN?

Implementing a multilayer RNN for sequence modeling in TensorFlow Medium
A. To make all sequences contain the same meaningful observations
B. To guarantee that all hidden-state gradients have magnitude exactly one throughout training
C. To prevent padded time steps from affecting sequence processing
D. To convert every zero value into a randomly initialized embedding

29 A sentiment classifier receives a review and predicts one label for the entire review. Which RNN input-output pattern best describes this task?

Text classification with an RNN Medium
A. One-to-many
B. Many-to-many with aligned labels
C. Many-to-one
D. One-to-one

30 A review may contain important sentiment words near both its beginning and end. Which architecture can directly use left and right context when encoding each token?

Text classification with an RNN Medium
A. A linear regression model
B. An RNN that discards all token order and averages only the integer token identifiers
C. A unidirectional RNN
D. A bidirectional RNN

31 During autoregressive text generation, what is typically supplied as the next input after the model predicts a probability distribution over tokens?

Text generation with an RNN Medium
A. The complete training corpus
B. The true next token from the test sequence regardless of what the model predicted
C. The token selected from that distribution
D. The hidden state from the first time step

32 A text generator produces overly predictable output. What is the likely effect of moderately increasing the sampling temperature from to ?

Text generation with an RNN Medium
A. The vocabulary is permanently reduced to the most frequent token
B. The token distribution becomes more peaked and output becomes more deterministic
C. The token distribution becomes less peaked and output becomes more varied
D. The model retrains its recurrent weights during every generation step to ensure that rare tokens always receive the highest probability

33 A time series has hourly values. Each training sample uses the previous 24 values to predict the next value. If the series contains 1,000 values and windows move by one step, how many samples can be formed?

Time series forecasting Medium
A.
B.
C.
D.

34 A one-step RNN forecaster is used recursively to predict the next 10 days. Why may forecast errors increase for later days?

Time series forecasting Medium
A. Earlier predictions are reused as inputs, so their errors can accumulate
B. Every future prediction uses an independently trained RNN with parameters selected after observing the actual future values
C. Recursive forecasting removes all uncertainty after the first prediction
D. The model receives more true observations at every future step

35 For an LSTM cell, the forget gate is close to and the input gate is close to at a particular time step. What is the most likely effect on the cell state?

LSTM units Medium
A. Both old memory and new candidate information are fully blocked
B. Old memory is preserved and new candidate information is blocked
C. Old memory is mostly removed and new candidate information is added
D. The output gate directly replaces the cell state with the current input

36 Why can an LSTM often preserve information over longer intervals than a basic tanh RNN?

LSTM units Medium
A. It assigns a separate loss function to every training example
B. Its gated cell-state path supports controlled information flow
C. It removes the need to share parameters across time steps
D. Its hidden state is always copied unchanged through the complete sequence without being influenced by inputs

37 An LSTM classifies fixed-length activity sequences into five classes using only its final output. Which output layer is most appropriate?

Sequence classification with LSTM Medium
A. A dense layer with 1 unit and ReLU activation
B. A recurrent layer that returns one unrelated class label at every input feature
C. A dense layer with 5 units and no classification loss
D. A dense layer with 5 units and softmax activation

38 Variable-length sequences are padded before being passed to an LSTM classifier. If padding is not masked, what failure may occur?

Sequence classification with LSTM Medium
A. The output probabilities always become uniform regardless of the learned weights, input values, or sequence lengths
B. The LSTM automatically shortens every sequence to one time step
C. The classifier becomes mathematically equivalent to a convolutional network
D. The LSTM may treat padding values as meaningful sequence content

39 Consider LSTM(64, return_sequences=True) followed by LSTM(32) for classification. If the input shape is , what shape does the second LSTM receive?

Stacked LSTM for sequence classification Medium
A.
B.
C.
D.

40 A stacked LSTM achieves very high training accuracy but poor validation accuracy on a small sequence-classification dataset. Which change is most appropriate?

Stacked LSTM for sequence classification Medium
A. Add dropout or reduce the model size
B. Train until both training and validation losses become exactly zero
C. Remove validation data and select the model using only its performance on the training sequences
D. Increase the number of LSTM layers substantially

41 A medical event sequence contains observations at irregular timestamps. Two patients may have the same ordered measurements but very different time gaps. Which representation best enables an RNN to distinguish these cases without resampling?

Modeling sequential data Hard
A. Use zero padding to make all patient sequences have identical lengths and treat every padded position as an ordinary event
B. Sort each patient's measurements by magnitude before applying the RNN
C. Append the elapsed time since the previous event to each input vector
D. Duplicate every observation according to its absolute timestamp

42 For the recurrence , which statement correctly describes parameter sharing after the network is unrolled for steps?

Understanding the structure and flow of an RNN Hard
A. Each time step receives a distinct copy of all trainable parameters
B. Every time step uses the same , , and
C. Only is shared, while and vary with time
D. The parameters are shared during inference but independently optimized at each time step during training

43 Consider , where
, , , and . What is approximately?

Computing activation in an RNN Hard
A.
B.
C.
D.

44 Ignoring loss contributions at intermediate times, which expression most directly governs how a gradient from time reaches the hidden state at time in a vanilla RNN?

Challenges of learning long-range interactions Hard
A.
B.
C.
D.

45 A TensorFlow model receives input with shape (B, T, D) and contains LSTM(64, return_sequences=True) followed by LSTM(32, return_sequences=False). What are the outputs of the first and second LSTM layers?

Implementing a multilayer RNN for sequence modeling in TensorFlow Hard
A. First: (B, T, 64); second: (B, 32)
B. First: (B, T, 64); second: (B, T, 32)
C. First: (B, 64); second: (B, 32)
D. First: (T, B, 64); second: (T, B, 32) because recurrent layers always preserve the temporal dimension

46 A batch of token sequences is right-padded with token ID 0. A classifier uses the final output of an LSTM, but the embedding does not generate a mask. What is the most likely consequence?

Text classification with an RNN Hard
A. Padding tokens can alter the final hidden state and therefore the prediction
B. Padding changes only the embedding gradients, not the recurrent state
C. The final hidden state always corresponds to the last nonzero token because TensorFlow removes padded positions before recurrence
D. The LSTM automatically infers sequence lengths from repeated zeros

47 During text generation, the next-token distribution is computed as . Assuming , which statement is correct?

Text generation with an RNN Hard
A. Increasing sharpens the distribution and approaches greedy decoding
B. Decreasing flattens the distribution and increases its entropy
C. Decreasing sharpens the distribution without changing the largest-logit token
D. Changing modifies the ordering of logits, so a different token necessarily becomes the most probable one

48 A model must forecast the next 12 values. Which claim correctly distinguishes direct multi-horizon forecasting from recursive one-step forecasting?

Time series forecasting Hard
A. Recursive forecasting cannot accumulate error because the same one-step model is reused at every future horizon
B. Recursive forecasting predicts all 12 horizons in one pass using separate output neurons
C. Direct forecasting trains 12 independent models and cannot share representations across horizons
D. Direct forecasting emits all 12 predictions together and avoids feeding earlier predictions back as inputs

49 For an LSTM cell state , what is the local derivative when indirect dependencies of the gates on earlier states are held fixed?

LSTM units Hard
A.
B.
C.
D.

50 An offline document classifier assigns one label after reading the entire document. When is a bidirectional LSTM preferable to a unidirectional LSTM?

Sequence classification with LSTM Hard
A. When the model must preserve strict causality during real-time deployment
B. When predictions must be emitted before future tokens become available
C. When future tokens are unavailable during inference but are available during training, allowing the backward LSTM to be discarded after optimization
D. When each token representation may use both preceding and following context

51 A stacked LSTM classifier contains three LSTM layers followed by a dense classification layer. Which return_sequences configuration is generally required when only one label is produced per sequence?

Stacked LSTM for sequence classification Hard
A. All three layers must use True, and the dense layer automatically selects the final valid time step without pooling or slicing
B. All three layers must use False to produce one sequence label
C. The first two layers use True, and the third may use False
D. Only the first layer uses False, while the remaining layers use True

52 An LSTM layer has input dimension and hidden dimension . Using one input kernel, one recurrent kernel, and one bias vector for each of four gates, how many trainable parameters does it have?

LSTM units Hard
A.
B.
C.
D.

53 In truncated backpropagation through time, hidden states are carried from one segment to the next but detached from the previous computation graph. What is the key implication?

Challenges of learning long-range interactions Hard
A. Forward information can cross segments, but gradients cannot cross the detach boundary
B. Neither activations nor gradients can carry information across segment boundaries
C. The procedure is mathematically identical to full backpropagation through time as long as the hidden-state values are preserved
D. Gradients cross every boundary, but hidden states are reinitialized at each segment

54 A character-level RNN is trained using the true previous character at every time step, but during generation it receives its own sampled output. Which problem does this discrepancy create?

Text generation with an RNN Hard
A. Gradient explosion, because sampled tokens always have larger embedding norms
B. Class imbalance, because teacher forcing makes every character occur with equal probability during optimization
C. Exposure bias, because inference may visit prefixes not encountered under teacher forcing
D. Label leakage, because future characters are directly included in the hidden state

55 A standardization transform is applied before walk-forward validation. Which procedure avoids future-data leakage?

Time series forecasting Hard
A. Fit the scaler on each validation window and apply it backward to training data
B. Fit the scaler only on the training portion of each validation fold
C. Fit the scaler once on the complete series before constructing folds
D. Fit separate scalers to every input window using all input and target values so that each example has zero mean

56 For a causal many-to-many RNN that predicts a label at every time , which dependency is valid?

Understanding the structure and flow of an RNN Hard
A. may depend on future inputs during training because the recurrent connection removes that dependency during inference
B. must depend on the complete sequence
C. may depend on but not on
D. may depend only on because recurrent states are not outputs

57 Let and . If one component of has magnitude much greater than , what happens to gradient flow through that component?

Computing activation in an RNN Hard
A. The derivative grows proportionally to and amplifies gradients
B. The derivative approaches one because becomes nearly linear
C. The derivative changes sign whenever the pre-activation is negative, causing alternating exploding and vanishing gradients
D. The derivative approaches zero because approaches zero

58 A TensorFlow model uses a stateful RNN to process a long time series split into consecutive batches. What training setup is necessary for the carried states to remain associated with the correct streams?

Implementing a multilayer RNN for sequence modeling in TensorFlow Hard
A. Disable batch shuffling and reset states at true sequence boundaries
B. Use a different batch size at every step so hidden states follow temporal order
C. Reset states after every batch while also setting stateful=True, because statefulness affects only gradient sharing and not activation values
D. Shuffle batches after every epoch and preserve states across unrelated sequences

59 A two-layer stacked LSTM uses hidden size in both layers and input size in the first layer. Ignoring the classifier, how many trainable recurrent-layer parameters are present?

Stacked LSTM for sequence classification Hard
A.
B.
C.
D.

60 Training a vanilla RNN shows exploding gradients, so global-norm gradient clipping is introduced. Which limitation remains?

Challenges of learning long-range interactions Hard
A. Clipping removes the need for gated units because it preserves all long-term dependencies
B. Clipping modifies the forward hidden states so saturated activations become linear throughout the entire sequence
C. Clipping controls excessive gradient magnitude but does not restore vanished long-range gradients
D. Clipping guarantees that every recurrent Jacobian has singular values exactly equal to one