From RNN Limitations to the Rise of the Transformer: The Evolution of Sequence Models

    This article traces the development of sequence models in natural language processing (NLP). It covers the early history of AI, the limits of recurrent neural networks (RNNs) such as vanishing gradients, serial computation, and information bottlenecks, and how the attention-based Transformer architecture addressed these problems and became the foundation for today's large language models.

    Modern large language models (LLMs) show remarkable abilities in understanding and generating language. Their training typically moves through three stages: pretraining, where the model learns general knowledge; supervised fine-tuning, where it learns to follow instructions; and reinforcement learning from human feedback (RLHF), where it learns to align with human values. All three stages depend on the underlying model architecture.

    However, AI did not begin by understanding a human sentence. Before the current architecture emerged, the field of natural language processing (NLP) was long constrained by the limits of traditional sequence models. This article reviews the history of AI, examines the difficulties of recurrent neural networks (RNNs), the foundational sequence model, and explains how a new architecture reshaped the NLP paradigm.

    I. Theoretical Origins and Early Exploration of AI

    AI did not develop overnight. It evolved over a long period, moving from symbolism to connectionism.

    1. Theoretical foundations and the birth of a discipline: In the mid-20th century, researchers proposed the idea of “machine intelligence” along with a test standard for it, laying the theoretical groundwork for AI. Later, at a landmark academic conference, the term “artificial intelligence” was formally adopted, establishing it as an independent discipline.
    2. The rise and fall of expert systems: In the 1980s, rule-based expert systems sparked an early wave of commercial AI interest and helped some companies save large amounts of cost. However, these systems relied heavily on knowledge entered by hand. They soon hit a knowledge acquisition bottleneck and struggled with complex, changing real-world scenarios.
    3. Algorithmic breakthroughs and validation in specific domains: In 1986, the backpropagation (BP) algorithm solved the training problem for multilayer neural networks, laying the groundwork for deep learning. Meanwhile, in games with clearly defined rules, such as board games, symbolic logic-based AI programs defeated human world champions, demonstrating computational advantages in specific domains.

    II. The Eve of Deep Learning and the Evolution of Foundational Architectures

    As computing power grew and data volumes increased, deep learning was on the verge of a breakout.

    1. Deep belief networks revive research: In 2006, deep belief networks were proposed to address the difficulty of training deep networks. This revived broad academic research on deep neural networks.
    2. Breakthroughs in computing power and vision: In a large-scale image recognition competition, deep convolutional neural networks cut the error rate from about 26.2% to 15.3%, marking the official start of the deep learning era. At the same time, GPUs (graphics processing units) were found to have parallel computing capabilities that made them a key computing foundation for deep learning.
    3. Vectorization as the basis of NLP: Around 2013, word embedding techniques emerged. These techniques convert words, which were previously discrete symbols, into continuous dense vectors. This makes it possible to compute semantic relationships between words in a multidimensional space, laying the foundation for modern NLP.
    4. Early forms of key models: Sequence-to-sequence (Seq2Seq) models and early attention mechanisms were then proposed for tasks such as machine translation, paving the way for later architectural innovations. In the same period, deep learning defeated professional human players in complex strategy games such as Go, further demonstrating the potential of neural networks.

    III. The Foundational Sequence Model RNN and Its Critical Pain Points

    Before the new architecture appeared, NLP mainly relied on recurrent neural networks (RNNs) and their variants, long short-term memory networks (LSTMs) and gated recurrent units (GRUs), to process sequential data. The core idea of these models is step-by-step propagation. They read the input one time step at a time, and the output at each step depends on the hidden state from the previous step. This is like a person reading an article word by word while remembering as they go.

    This step-by-step design created several critical pain points in practical engineering applications:

    1. Failure of long-range dependencies (gradient problem)
      During backpropagation, an RNN must pass errors backward through time steps. For long sequences, errors grow or shrink exponentially through repeated multiplication, causing “vanishing gradients” or “exploding gradients.” Although the gating mechanisms in LSTMs alleviate this problem to some extent, models still struggle to capture the connections between the beginning and end of long texts spanning hundreds or thousands of words.

    2. Low computational efficiency (no parallelization)
      The computation at step t depends on the hidden state output at step t-1. This strict sequential dependency prevents parallel computation. As GPU computing power advanced rapidly, this serial pattern severely slowed training and made it hard to scale models to very large parameter counts and datasets.

    3. Information bottleneck and context loss
      In the traditional Seq2Seq architecture, the encoder compresses the entire input sequence into a fixed-length context vector, and the decoder generates the output from that vector. This creates an information bottleneck. No matter how long the input is, the model retains only one vector of limited dimensions. Early or non-core information in long sequences is often lost, making it difficult for AI to truly understand long conversations or documents.

    IV. A Paradigm Shift: Global Attention Reshapes the Technical Foundation

    These difficulties were not fully resolved until 2017. That year, a landmark paper proposed a new architecture built entirely on attention mechanisms, which replaced traditional sequence models such as RNNs and LSTMs.

    This new architecture brought two major changes:

    1. A global view for long-range dependencies
      The architecture introduces self-attention and drops step-by-step propagation over time. When processing a sequence, the model computes weights between any two positions in the input directly. No matter how far apart two words are in a text, they are one computational step apart. This mechanism addresses the failure of long-range dependencies at its root and gives the model true global understanding.

    2. Matrix operations unlock parallel computing
      Because the architecture no longer depends on the hidden state of the previous time step, sequence processing becomes large-scale matrix multiplication. This allows the model to make full use of the parallel computing power of GPUs and greatly improves training efficiency. The breakthrough made it feasible to scale parameter counts from millions to billions, tens of billions, and even hundreds of billions, which made large-scale pretraining practical.

    In summary, the shift from the step-by-step processing of RNNs to architectures based on global attention has fundamentally changed the research paradigm of natural language processing. This architecture resolves the efficiency and memory bottlenecks of traditional sequence models and became the foundation for the development of today’s large language models. Understanding this evolution helps developers see the direction of AI technology and plan applications that will hold up as the field advances.