While vanilla RNNs laid the groundwork, LSTMs (Long Short-Term Memory) and GRUs (Gated Recurrent Units) were pivotal, solving the vanishing gradient problem and enabling RNNs to capture longer-term dependencies more effectively, with LSTMs introduced by Hochreiter and Schmidhuber in 1997.