1/25
Looks like no tags are added yet.
What is a sequence?
ordered list of observations where order matters
Why is a standard feedforward network (FFNN) limited for sequence data?
doesnt carry mem from one time step to next, works well when input is fixed sized and indep, order must be encoded
Name the three common sequence modeling task types and an example of each.
many to one: classification, one to many: image captions, many to many: translation
What makes an RNN different from a feedforward network?
RNNs process one element at a time while carrying info forward
Write the RNN state update in general form and explain it.
h_t = f(x_t, h_t-1) cur input + prev mem = updated mem
Write the simple RNN equations for the hidden state and output.
h_t = sig(W_hh h_t-1 + W_xh x_t + b_h) y_t = W_hy * h_t
What does unrolling an RNN over time reveal, and why does parameter sharing matter?
shows same cell applied repeatedly and lets model handle variable length seq
What is Backpropagation Through Time (BPTT)?
bp applied to network thats unfolded over time
How does Backpropagation Through Time work?
unroll RNN across time steps, compute losses at one or more outputs, bp gradients thru repeated cells
What are the four design criteria for a good sequence model?
variable length, long term dep, order info, shared param
How is language converted to numbers for a neural network? (3 steps)
build list of known tokens, assign each token an int ID, map each ID to dense vector
Why does order matter?
model has to represent both token identity and token order
What causes vanishing gradients in RNNs, and what are common responses?
products of factors less than 1 become small so earlier time steps get little learning signal. LSTM/GRU, careful initialization, residual paths, or attention
What causes exploding gradients in RNNs, and what is the common fix?
products of factors bigger than 1 become large and training is unstable. gradient clipping where large gradients are rescaled
What is the long-term dependency problem?
RNNs favor recent info, error signal becomes weaker going back in time. attention addresses this
What do the three LSTM gates do?
forget gate decides which past info to remove from cell state, input gate decides which new info to write into mem, output gate decides how much of cell state is exposed as hidden state
What two states does an LSTM keep, and why does the cell state help training?
hidden and separate cell state, which provides more direct path for gradient flow during BPTT
What is a GRU and how does it differ from a standard RNN?
gated recurrent unit uses two learned gates and has hidden state but no separate cell state
What does the GRU update gate z_t do? Give its equation.
controls balance between retraining prev hidden state and adding candidate state. z_t = sig(W_z * x_t + U_z * h_t-1 + b_z)
What does the GRU reset gate r_t do? Give its equation.
controls how much of prev hidden state contributes to candidate state. r_t = sig(W_r x_t + U_r * h_t-1 + b_r)
Compare GRU and LSTM.
gru has update and reset gates, hidden state, less param, faster training. lstm has forget, input, output gates, hidden and cell state
What are the limitations of RNNs that motivate attention and Transformers?
encoding bottleneck, slow training, weak long range mem, performance drops for long seq
What is the core idea of attention compared with an RNN hidden state?
attention lets model look back by assigning weights to input elements based on relevance
Explain Query, Key, and Value using the search analogy.
query is what token is looking for, key is how each token shows what it has, value is the info passed forward if chosen
Describe scaled dot-product attention.
attention(q,k,v) = softmax(qk^t . sqrt(d_k) * V
In scaled dot-product attention, is the score multiplied or divided by √dₖ? What is dₖ?
divided, d_k is key/query dimension