Sample questions
Question 1Easy
- Layered State Tensor Map
- Long Short-Term Memory
- Large Scale Text Machine
- Linear Sequence Transfer Model
Answer: B. Long Short-Term Memory
Explanation
LSTMs are gated RNNs that remember information over long sequences.
Step-by-step solution
- LSTM = Long Short-Term Memory.
- It keeps short-term memory over long spans.
- It is a gated recurrent network.
Why the other options are wrong
- A. No such term.
- C. No such term.
- D. No such term.
Question 2Easy
Which data type is a natural fit for an RNN?
- An unordered set of IDs
- A list of file names sorted alphabetically
- A single static number
- A sentence of words
Answer: D. A sentence of words
Explanation
RNNs exploit the order of elements in a sequence.
Step-by-step solution
- RNNs process ordered sequences step by step.
- A sentence is an ordered sequence of words.
- So it suits an RNN.
Why the other options are wrong
- A. An unordered set has no sequence order.
- B. Alphabetical sorting is not a meaningful sequence to model.
- C. A single number has no sequence.
Question 3Easy
LSTMs address vanishing gradients mainly through:
- Using convolutions
- Larger learning rates
- Removing the hidden state
- Gated cell state
Answer: D. Gated cell state
Explanation
Forget, input and output gates control a cell state that can carry information across many steps.
Step-by-step solution
- An LSTM keeps a separate cell state alongside the hidden state.
- Gates decide what to forget, add and output.
- The cell state updates mostly by addition, so gradients flow across many steps without vanishing.
Why the other options are wrong
- A. Convolutions are not the mechanism LSTMs use.
- B. Larger learning rates do not fix vanishing gradients.
- C. LSTMs keep and extend the hidden state.
Question 4Easy
Recurrent neural networks are designed for:
- Sequential data
- Sorting algorithms
- Only images
- Only tabular data with no order
Answer: A. Sequential data
Explanation
An RNN processes one step at a time, carrying a hidden state forward.
Step-by-step solution
- RNNs process inputs one step at a time.
- They carry a hidden state from step to step.
- This suits sequences such as text, speech and time series.
Why the other options are wrong
- B. Sorting does not need learning.
- C. Images are mainly handled by CNNs.
- D. Unordered tabular data has no sequence for recurrence to use.
Question 5Medium
In a sequence-to-sequence (encoder-decoder) model for translation, the encoder:
- Encodes the source sentence
- Only counts words
- Outputs the translated words directly
- Removes punctuation
Answer: A. Encodes the source sentence
Explanation
The decoder generates the target sentence conditioned on the encoder's output.
Step-by-step solution
- The encoder reads the source sentence.
- It converts it into internal representations (a context vector or a set of states).
- The decoder then generates the target sentence from them.
Why the other options are wrong
- B. The encoder learns meaning, not word counts.
- C. Producing translated words is the decoder's job.
- D. Punctuation removal is preprocessing.
Question 6Medium
Backpropagation through time (BPTT) means:
- Skipping gradient computation
- Training only on the last time step
- Running the sequence backwards at inference
- Backprop over the unrolled steps
Answer: D. Backprop over the unrolled steps
Explanation
The unrolled network shares weights across steps, and gradients are summed over time.
Step-by-step solution
- Unroll the RNN across all time steps, like a deep network with shared weights.
- Run ordinary backpropagation through this unrolled graph.
- Add up the gradients for the shared weights from every step.
Why the other options are wrong
- A. BPTT computes gradients; it does not skip them.
- B. Loss can come from every step, and gradients flow to all of them.
- C. BPTT is a training method, not a way of running inference.
Question 7Medium
Why do plain RNNs struggle with long-range dependencies?
- They cannot use activation functions
- Gradients vanish over many time steps
- They have no parameters
- They can only read one word
Answer: B. Gradients vanish over many time steps
Explanation
Repeated multiplication through time shrinks (or explodes) gradients, so early inputs barely influence learning.
Step-by-step solution
- Training an RNN backpropagates through every time step.
- The gradient is multiplied by similar factors at each step.
- Over many steps it shrinks towards zero, so early inputs barely affect learning.
Why the other options are wrong
- A. RNNs do use activation functions such as tanh.
- C. RNNs have weight matrices.
- D. RNNs read whole sequences, one token at a time.
Question 8Medium
Which gate in an LSTM decides what information to discard from the cell state?
- Reset gate
- Forget gate
- Output gate
- Attention gate
Answer: B. Forget gate
Explanation
The forget gate scales the old cell state between 0 (discard) and 1 (keep).
Step-by-step solution
- The forget gate outputs values between 0 and 1 for each cell-state entry.
- Values near 0 erase that information; near 1 keep it.
- So it decides what to discard.
Why the other options are wrong
- A. The reset gate belongs to the GRU.
- C. The output gate decides what part of the cell state becomes the hidden state.
- D. LSTMs have no 'attention gate'.
Question 9Hard
Why did Transformers largely replace RNNs for language modelling?
- RNNs have no parameters
- Attention parallelises well
- RNNs cannot process text
- Transformers need no data
Answer: B. Attention parallelises well
Explanation
RNNs process tokens sequentially; self-attention handles all positions at once and avoids long gradient paths.
Step-by-step solution
- RNNs must process tokens one after another.
- Self-attention compares all tokens at once, which runs in parallel on GPUs.
- Attention also links distant tokens directly, easing long-range dependencies.
Why the other options are wrong
- A. RNNs have parameters.
- C. RNNs can process text.
- D. Transformers need large amounts of data.
Question 10Hard
A simple RNN layer has input size 10 and hidden size 20 (one bias vector). How many parameters does it have?
- 620
- 400
- 600
- 220
Answer: A. 620
Explanation
- W_xh: 10 x 20 = 200
- W_hh: 20 x 20 = 400
- bias 20.
Total 620.
Step-by-step solution
- Input-to-hidden weights: 10 x 20 = 200.
- Hidden-to-hidden weights: 20 x 20 = 400.
- Bias: 20. Total = 200 + 400 + 20 = 620.
Why the other options are wrong
- B. 400 counts only the hidden-to-hidden weights.
- C. 600 forgets the bias.
- D. 220 forgets the recurrent weights.
Tip: Simple RNN params = h(i + h + 1) = 20 x 31.
Practise all 18 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →