Mostly true, but with some nuances.
Before Transformers:
The State of the Art (SOTA) before transformers were indeed Recurrent Neural Networks (RNNs) like Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs). These models were widely used for Natural Language Processing (NLP) tasks, such as language modeling, machine translation, and text classification.
The Innovations of Transformers:
The Transformer model, introduced in the paper "Attention is All You Need" by Vaswani et al. in 2017, brought two major innovations:
- Parallelization at the token level: Transformers allowed for parallelization of computations across tokens, which was not possible with RNNs. In RNNs, the computation for each token depends on the previous token's hidden state, making it sequential. Transformers, on the other hand, use self-attention mechanisms that enable parallelization of computations across tokens, making them much faster and more efficient for long sequences.
- Solving the vanishing gradient problem: Transformers, like RNNs, still use backpropagation to train. However, the self-attention mechanism in Transformers helps to alleviate the vanishing gradient problem. The gradients in Transformers are not dependent on the sequential structure of the input, which reduces the vanishing gradient problem. This allows the model to capture long-range dependencies more effectively.
However, it's worth noting that:
- The vanishing gradient problem was not entirely solved by Transformers. It's still a challenge in deep learning, and techniques like gradient clipping, batch normalization, and layer normalization are often used in conjunction with Transformers.
- The Transformer architecture also introduced other innovations, such as:
- Self-attention mechanisms, which allow the model to attend to different parts of the input sequence simultaneously.
- Encoder-decoder architecture, which is particularly useful for sequence-to-sequence tasks like machine translation.
Overall, your statement is mostly accurate, but with some minor caveats. The Transformer model did bring significant innovations in parallelization and alleviating the vanishing gradient problem, which contributed to its success and the subsequent widespread adoption in NLP tasks.