Concept
RNN Sequence Processing Complexity
In a recurrent neural network (RNN) processing a sequence of length , updating the -dimensional hidden state involves a multiplication with a weight matrix, leading to a computational cost of per step. Consequently, the total computational complexity for the entire recurrent layer is . Because the hidden state must be updated iteratively one token at a time, there are sequential operations that cannot be parallelized, and the maximum path length between any two tokens is similarly .
0
1
Updated 2026-05-14
Tags
D2L
Dive into Deep Learning @ D2L