RNN Long Text Limitations

Deep Learning interview question · Medium difficulty

Why did RNNs struggle with long text?medium

Status
✓
Type
conceptual
Topic
rnn-long-text-limitations
Frequency
common
Tags
RNN, vanishing-gradient, long-range-dependency, sequential-processing
Answer

RNNs process tokens one at a time and try to carry everything seen so far in a single hidden state, so as the sequence gets longer, earlier information becomes weak, overwritten, or lost. This shows up as vanishing gradients, slow sequential training, a fixed-size memory bottleneck, and difficulty connecting distant words.

Explanation

Every word in an RNN depends on the previous hidden state, which looks natural for sequences but creates a real bottleneck: the model has to compress everything it has seen into one small state vector. The problem gets serious when the important word is far from the current word — in "The report that Amit prepared after multiple meetings with the AI team was excellent," the model needs to connect "was excellent" back to "report," but after many intermediate words the original signal can fade. The four concrete issues: vanishing gradient (early tokens get very weak learning signal during backpropagation through time), sequential processing (token 10 can't be processed before token 9, so training is inherently slow and hard to parallelize), a fixed memory bottleneck (the hidden state has limited capacity no matter how long the sequence gets), and long-range dependency failure (connecting distant words becomes difficult as the gap grows). RNNs worked reasonably well for short sequences, but all four of these compound as sequence length increases.

Follow-upWhy does compressing everything into one hidden state get worse as the sequence gets longer?
Follow-upWhy is sequential processing a training-speed problem, not just a quality problem?
Follow-upHow do LSTM and GRU address these issues, and what do they still not fully solve?