CMU Introduction To Deep Learning 11-785, Fall 2026: Lecture 14
Overview
The lecture explains why ordinary recurrent neural networks can represent long-range dependencies but often fail to retain useful information or train across long sequences: recurrent weights and activation Jacobians can make signals and gradients vanish or explode. It motivates Long Short-Term Memory (LSTM) networks, whose gated cell state supports input-dependent memory updates, then outlines LSTM gates, code-based backpropagation, and the related Gated Recurrent Unit (GRU).
Key takeaways
- A recurrent architecture can exploit task structure: bitwise addition can reuse a compact carry state instead of requiring an MLP to learn behavior across 2^(2n) possible pairs of n-bit inputs.
- In the lecture’s linear RNN analysis, a single past input contributes through powers of the recurrent matrix, so recurrent dynamics can amplify or decay memory over time.
- Backpropagation through deep networks repeatedly multiplies activation Jacobians and weight matrices; derivatives that are at most 1 and weight directions with singular values below 1 make vanishing gradients common.
- An LSTM’s cell state provides a direct path through time, while forget and input gates control retention and updates using the current input and context.
- LSTM gates do not guarantee that every gradient problem disappears: gate values affect backward propagation, and exploding gradients may still require techniques such as gradient clipping.
- A GRU offers a related gated design that combines aspects of LSTM forgetting and input updates with a more compact state structure.
Chapters
- The class begins with informal setup and attendance before the lecture topic is introduced.
- The instructor asks students to email personal feedback about what they have learned and what remains unclear during the first half of the semester.
- The lecture continues from the previous class on recurrent neural networks and previews stability, ways to address it, and training considerations.
- A code-parsing example introduces dependencies that may span an unpredictable number of time steps.
- An MLP for adding two n-bit numbers may face 2^(2n) possible input pairs, while an RNN can reuse a small per-bit computation and carry state.
- For parity, an RNN can update a compact state as each bit arrives, requiring only the small set of local input patterns rather than examples of every n-bit string.
- The central advantage is architectural reuse: recurrence can make a structured task much smaller and easier to train than a general MLP.
- RNNs are useful beyond time-series prediction when a task itself has recurring structure, such as bitwise addition or nested code.
- A finite-window convolutional network has bounded output for bounded input when its operations and activations remain bounded.
- The lecture asks whether an RNN can preserve useful information without its hidden state saturating, vanishing, or growing without bound.
- For analysis, the hidden activation is temporarily set to the identity, giving h_t = W_h h_(t-1) + Cx_t.
- Repeated substitution expresses the current hidden state as a sum of past inputs, each transformed by a power of the recurrent weight matrix.
- This expansion isolates how the recurrence itself changes the contribution of older inputs.
- For a scalar recurrence and a single input at time zero, the later response is proportional to w^t.
- When |w| exceeds 1, the response grows; when |w| is below 1, it decays; at |w| = 1, it does not decay in magnitude.
- The lecture uses bounded input magnitude to explain why repeated recurrent multiplication, rather than input size, determines this long-term behavior.
- For vector hidden states, repeated recurrence applies powers of the square hidden-to-hidden matrix W_h.
- The lecture analyzes W_h through its eigenvalues: a largest magnitude above 1 can produce growth, while magnitudes below 1 lead to decay.
- Complex eigenvalues can produce oscillatory responses, while the overall envelope still grows or shrinks according to magnitude.
- In the scalar examples, sigmoid saturates quickly and can erase distinctions among earlier inputs; tanh retains distinctions somewhat longer.
- ReLU recurrence can grow or die depending on the recurrent weights and activation region.
- Across the examples, the late hidden state is shaped mainly by learned parameters and biases rather than reliably preserving the original input.
- The lecture concludes that ordinary RNNs can theoretically depend on the infinite past but often forget useful input information in practice.
- The same repeated computation creates a training problem: gradients must pass through many layers of a deep computation graph.
- The curly-brace parsing example requires both memory to persist forward and learning signals to travel backward across long spans.
- Backpropagation repeatedly multiplies derivatives by weight matrices and activation Jacobians as it moves toward earlier layers.
- For elementwise recurrent activations, the Jacobian is diagonal, with entries given by activation derivatives.
- ReLU derivatives are 0 or 1, tanh derivatives are at most 1, and sigmoid derivatives are at most 0.25, so activation Jacobians commonly shrink gradients.
- A weight matrix can be decomposed using singular value decomposition as UΣVᵀ, where the orthonormal factors rotate vectors and Σ scales them.
- Directions associated with singular values above 1 expand, while directions associated with values below 1 shrink.
- Repeated rotations and scaling by both weights and activation Jacobians can concentrate gradients in a few directions while shrinking most others.
- The lecture shows a 19-layer MNIST network with 1,024 units per layer and plots derivatives as they propagate backward.
- With ReLU, ELU, sigmoid, and tanh examples, gradients become faint after only a few layers, with the exact pattern varying by activation.
- Some derivatives remain large while many approach zero, concentrating learning signals in a small subset of units.
- Ordinary RNNs risk both forward memory decay or explosion and backward gradient decay or explosion.
- For nested code, the network must remember an opening brace until its matching close, even when the intervening sequence is extremely long.
- The proposed design goal is memory controlled by the input and context, rather than memory duration determined mainly by fixed recurrent parameters.
- An LSTM separates a cell state, commonly written C, from the hidden state used as the network output.
- The cell state passes through time with gated updates, avoiding the ordinary RNN’s repeated application of a single recurrent weight matrix and activation.
- A gate can preserve a memory while relevant context is absent, then update or clear it when an input pattern indicates that the information is no longer needed.
- The forget gate uses a sigmoid to control how much previous cell state is retained.
- The input gate and a tanh candidate control how much newly detected information is added to the cell state.
- The output gate controls how much of the transformed cell state becomes the hidden state; the lecture also mentions optional peephole connections to the cell state.
- The gates use the current input and previous hidden state to decide whether to retain, add, or expose information.
- A code parser could preserve an open-brace count until a relevant closing brace appears, while ignoring brace-like characters in a comment context.
- The direct cell-state path avoids a guaranteed repeated activation shrinkage, though gradients through gates still depend on their input-conditioned values.
- The forward pass computes affine terms and sigmoid or tanh activations for the forget, input, candidate, and output components.
- The updated cell state and hidden state are the LSTM cell’s two outputs, which are passed into subsequent time steps and layers.
- Rather than deriving every path through the gate graph by hand, the lecture recommends reversing the sequence of code operations to compute derivatives, with a course handout and homework covering the method.
- A Gated Recurrent Unit (GRU) combines aspects of forgetting and input gating and uses a more compact state design than the LSTM described in class.
- LSTM memory paths reduce the risk of vanishing signals along the cell state, but gradients can still explode; gradient clipping is named as a way to control large gradients.
- The lecture closes by contrasting ordinary RNNs’ parameter-driven memory behavior with gated architectures that make memory updates input-dependent.
Transcript excerpt
0:10 How much data you think is enough for emotion lately? >> You want to turn this on? >> Yes, I certainly do. >> All right. >> Thank you. >> You're welcome, man. I tell you what, highlight of my day. >> Come on. Yeah. >> Mhm. >> Back. >> Come here. You're going >> to distill. Doesn't like my CMU. >> No, it doesn't. But that's all right. It has no choice. Okay. All right. >> Maybe I should try wearing an MIT or a Harvard. >> And if it falls off, call me. >> All right. >> All right. >> We're good. >> We're good. >> Thank you. >> Valentine.
0:56 >> Yes. Yes, we are. like the flow of emotion is that so what we need I need to start off that this one Okay. >> I can be my own.
2:06 I'll say Somebody can get started. And you always want to get down to 100. >> We need a few thousand. I can actually swing with both hands now. >> I was just the whole
3:18 Be careful. Don't fall. Oh, they add >> Yeah, that's what I'm saying. What's the worst?
4:18 Crazy how it is. >> I can really like coding. right now. So my double my money Everyone's going
5:53 that were more time with our project. neighbor. >> Yes, he's my neighbor. >> It's just in the corner of White. >> You have to come to the next block. >> I love it. They actually close down the block. They put barricades up.
6:40 >> They do that in Chicago. >> They do that. They do that in sponsor. I'm from Los Angeles for always make my day. That's why. >> Okay guys, everybody turn on your attendance poll. And uh the uh first half of the semester
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Carnegie Mellon University Deep Learning.