AI History Episode XV Transformers Part VI · The Deep Learning Decade

Transformers & the GPT Architecture

How eight researchers and one equation remade the architecture of artificial intelligence.

Published

Transformers & GPT Architecture

How Eight Researchers and One Equation Remade the Architecture of Artificial Intelligence

Introduction: The Paper That Redrew the Map

Some scientific papers announce themselves loudly --- they arrive with press conferences, institutional endorsements, and a prepared audience primed to recognize their significance. Others slip into the literature quietly, are initially noted by a small specialist community, and only gradually reveal the scale of their impact as the years accumulate. “Attention Is All You Need,” submitted to arXiv on June 12, 2017, by eight researchers at Google Brain and Google Research, belonged to neither category. Its title was punchy and memorable enough to travel beyond the specialist community. Its contribution --- a new architecture for sequence modeling that dispensed entirely with the recurrent structures that had dominated natural language processing for a decade --- was immediately recognized as significant by those who read it carefully. But the full magnitude of what it had set in motion would not be apparent for years, as the architecture it introduced was taken up, scaled, and transformed into systems that genuinely changed what people believed machines could do.

This episode traces the Transformer architecture from its origins in the specific engineering problems of neural machine translation, through the technical innovations that made it both powerful and tractable, to the successive generations of GPT models that demonstrated what happened when the architecture was combined with very large amounts of text and very large amounts of compute. It is a story about the relationship between architecture and scale: about how an architectural innovation that made training more efficient also made training much larger models feasible, which produced qualitative jumps in capability that smaller models could not have achieved regardless of how efficiently they were trained. And it is a story about surprise --- about the consistent experience, repeated at every stage of the GPT development, of systems doing things that their designers had not anticipated, in ways that continue to generate both excitement and unease.

“Attention Is All You Need’ may be the most consequential six words in the history of AI. The paper behind them remade an entire field in less than a decade.”

The context for the Transformer’s development, as Episodes 8 and 9 of this series have traced, was a decade of rapid progress in deep learning that had transformed computer vision and speech recognition while leaving natural language processing in a more complicated state. Recurrent neural networks, and their more sophisticated variants the Long Short-Term Memory and the Gated Recurrent Unit, had produced genuine improvements in language modeling, machine translation, and sentiment analysis. But they suffered from fundamental limitations: they processed sequences one token at a time, making parallelization difficult; their gradients still suffered from instability over very long sequences despite LSTM’s gating mechanisms; and the fixed-size hidden state that summarized all previous context was a fundamental information bottleneck for tasks requiring integration of information across long documents. The attention mechanism that Bahdanau and colleagues had introduced in 2014 for machine translation had addressed the last of these problems by allowing the decoder to selectively attend to different positions in the encoder’s output. What Vaswani et al.’s 2017 paper proposed was far more radical: eliminate the recurrence entirely, and build the whole architecture out of attention.

Section 1: Attention Is All You Need --- The 2017 Breakthrough

The engineering context from which the Transformer emerged was the problem of neural machine translation: training a neural network to translate text from one natural language to another. This had been one of the most intensively studied problems in NLP since the early 2010s, and by 2016 the dominant approach was the encoder-decoder architecture with attention: an encoder RNN processed the source sentence into a sequence of hidden states, a decoder RNN generated the target sentence one word at a time, and an attention mechanism computed a weighted combination of the encoder’s hidden states to inform each decoding step. The approach worked well, but its sequential nature meant that training was slow and difficult to parallelize, and that its performance on very long sentences degraded as the encoder’s hidden states struggled to retain relevant information from distant positions.

The Core Proposal: Attention Without Recurrence

The central proposal of “Attention Is All You Need” was deceptively simple to state: replace the recurrent layers in both encoder and decoder with stacked layers of multi-head self-attention and position-wise feedforward networks. Self-attention --- in contrast to the cross-attention that earlier architectures had used between encoder and decoder --- allowed each position in a sequence to attend to all other positions in the same sequence, computing a representation of each position that incorporated information from every other relevant position, regardless of how far apart they were. There was no hidden state propagating information step by step through the sequence; each position could reach every other position in a single layer.

The mechanism through which self-attention accomplished this was the query-key-value computation that became one of the defining technical concepts of the subsequent decade. For each position in the sequence, the model computed three vectors: a query (representing what this position is looking for), a key (representing what this position has to offer), and a value (the actual information this position contributes when attended to). The attention weight for each pair of positions was computed as the dot product of one position’s query with the other position’s key, scaled by the square root of the key dimension to prevent the dot products from growing too large, and passed through a softmax to produce a probability distribution over all positions. The output for each position was then a weighted combination of the value vectors of all other positions, weighted by these attention probabilities.

Multi-head attention extended this mechanism by running multiple independent attention operations in parallel, each learning to attend to different aspects of the relationships between positions. A single attention head might learn to track syntactic agreement between subjects and verbs; another might learn to track coreference relationships between pronouns and their antecedents; another might learn to track semantic relationships between words from the same domain. By combining the outputs of multiple attention heads, the model could simultaneously represent multiple types of relationship between positions --- a flexibility that single-head attention could not provide.

Positional Encoding: Solving the Order Problem

The elimination of recurrence created an immediate problem: unlike a recurrent network, which processed tokens in order and thereby implicitly encoded their positions, a self-attention layer treated all positions symmetrically. A sentence in which the subject precedes the verb would produce exactly the same self-attention outputs as the same words in any other order, because the attention computation was invariant to permutation. Language is emphatically not order-invariant --- “the dog bit the man” and “the man bit the dog” contain the same words but different meanings --- and a model that could not distinguish word order could not model language.

The solution Vaswani et al. adopted was positional encoding: a set of vectors, one for each position in the sequence, that encoded positional information in the same representational space as the word embeddings, and were added to those embeddings before being processed by the attention layers. The specific encoding scheme used in the original Transformer paper was a deterministic function of position and embedding dimension based on sine and cosine functions of different frequencies, chosen so that the encoding of each position was unique and the encoding of position differences was represented consistently across different absolute positions. This allowed the model to learn to attend to relative positional relationships by learning to attend to the patterns in the positional encodings.

Why It Worked: The Technical Advantages

The Transformer’s technical advantages over recurrent architectures were multiple and mutually reinforcing. The most immediately practical was parallelization: because each position’s representation was computed independently of the others (given the attention weights, which were all computed simultaneously), the entire sequence could be processed in parallel across all positions. Training a Transformer on the same data as a comparable LSTM was dramatically faster when modern GPU hardware was used, because the GPU’s parallel architecture was now being exploited by the model architecture rather than wasted on the inherently sequential recurrent computation.

The most important for long-range language understanding was the constant path length between any two positions in the sequence. In a recurrent architecture, information from the beginning of a long sentence had to travel through every intermediate hidden state to influence the representation of the end of the sentence; the path length was linear in the sequence length, and each step was an opportunity for the gradient to vanish or explode. In the Transformer, the path length between any two positions was constant regardless of their distance in the sequence: any position could attend directly to any other position in a single layer, with a path length of one. This made it far easier for the model to learn to use information from distant positions, and correspondingly far easier for the gradient to flow backward through the network during training.

The original paper validated the Transformer’s advantages concretely on the established benchmarks of the field. On the WMT 2014 English-to-German translation task, the Transformer achieved a BLEU score of 28.4 --- more than two points higher than the previous best result, which had been achieved by an ensemble of recurrent models, and achieved with training time of 3.5 days on eight P100 GPUs rather than the weeks that comparable recurrent models had required. On English-to-French translation, the results were equally decisive. The paper had not merely proposed a new architecture; it had demonstrated, on the field’s standard benchmarks, that the new architecture was better and faster than everything that had come before.

Reflection: The Transformer’s success on machine translation benchmarks was significant, but the deeper significance of the architecture was only apparent in retrospect. The combination of full-sequence attention, parallelizability, and constant path length between any two positions created an architecture that could, in principle, be trained on much larger datasets and scaled to much larger sizes than any recurrent architecture could practically achieve. The translation benchmarks were the proof of concept; the GPT models were the proof of potential.

Section 2: The Architecture in Depth

Understanding what made the Transformer so consequential requires going beyond the headline summary --- “attention replaces recurrence” --- to the specific architectural choices that, in combination, produced a system that could be scaled to sizes that had been entirely impractical for previous architectures. The original Transformer was a particular instance of a more general design space, and the choices made in that instance --- about normalization, about the feedforward layers, about how the encoder and decoder were structured --- proved not just effective for the original machine translation task but generative: they provided the scaffolding on which GPT, BERT, and every subsequent large language model was built.

The Full Architecture: Encoder, Decoder, and Their Variants

The original Transformer had two components: an encoder that processed the source sequence and a decoder that generated the target sequence. The encoder consisted of a stack of identical layers, each containing a multi-head self-attention sublayer and a position-wise feedforward sublayer, connected by residual connections and layer normalization. The residual connections --- shortcut connections that added the input of each sublayer directly to its output before normalization --- addressed the vanishing gradient problem in the same way that ResNets had addressed it in computer vision: by providing gradient highways that bypassed the attention and feedforward operations, allowing gradients to flow more easily through very deep stacks. Layer normalization, applied after each sublayer, stabilized the distributions of activations and made training more robust to the choice of learning rate and initialization.

The decoder was similar to the encoder but with an additional cross-attention sublayer that allowed each decoder position to attend to the encoder’s output, and with a masking modification to the decoder’s self-attention that prevented each position from attending to future positions (which would constitute cheating in a generation task, since the future tokens had not yet been generated). The encoder-decoder structure was appropriate for translation and other sequence-to-sequence tasks; subsequent work would show that for language modeling --- predicting the next token in a sequence --- a decoder-only architecture was sufficient, and for tasks requiring bidirectional understanding of a sequence, an encoder-only architecture was more appropriate.

The Feedforward Layers: More Than Attention

A common oversimplification of the Transformer presents it as entirely an attention architecture, with the attention mechanism doing essentially all of the work. The position-wise feedforward layers --- two-layer networks applied identically and independently to each position --- are in practice at least as important for the model’s representational power as the attention layers. Research in the years following the Transformer’s publication revealed that the feedforward layers function, in effect, as a form of learned memory: the parameters of the feedforward layer can store factual associations (the capital of France is Paris; the author of Hamlet is Shakespeare) in a way that the attention mechanism alone cannot. The attention mechanism routes information to the right places; the feedforward layers provide the information to be routed.

This division of labor --- attention for context integration, feedforward layers for knowledge storage --- has proved to be one of the most productive conceptual frameworks for understanding what large language models are doing when they appear to “know” facts or “reason” about problems. It is also a framework that has implications for how these models fail: a model can have excellent attention --- excellent context integration --- but fail at a factual question if the relevant fact is not stored in its feedforward layers, either because it was rare in the training data or because the model has not allocated sufficient parameter capacity to storing it.

Scaling Laws: The Architecture Meets Its Destiny

The Transformer’s architectural properties made it possible to scale models to sizes that had been entirely impractical for recurrent architectures: larger models with more layers, more attention heads, and wider feedforward layers could be trained more efficiently because training was parallelizable, and they performed better on essentially all language tasks as size increased. The systematic relationship between model size, training data volume, computational budget, and downstream performance was quantified in a landmark 2020 paper from OpenAI, “Scaling Laws for Neural Language Models” by Kaplan and colleagues.

The Kaplan et al. scaling laws revealed that for large language models trained on the Transformer architecture, test loss on language modeling decreased as a remarkably clean power law with respect to model parameters, dataset size, and compute budget, with each factor contributing roughly independently. The implication was striking: for a fixed computational budget, the optimal strategy was not to train the largest possible model to convergence on a fixed dataset, but to train a somewhat smaller model on a somewhat larger dataset --- because both model size and data quantity contributed approximately equally to performance per unit of compute. These scaling laws provided, for the first time, a principled quantitative framework for deciding how to allocate a training budget across model size, data quantity, and training duration.

The scaling laws also contained an implicit promise that proved extraordinarily consequential: performance improvements were predictable and reliable as a function of scale. This was different from previous machine learning progress, which had required researchers to discover new architectural innovations or algorithmic techniques to achieve significant improvements. With Transformers, and with sufficient data and compute, improvement was a matter of scaling up --- and the results were quantitatively predictable. This predictability of improvement was one of the key factors that justified the massive investments in compute that produced GPT-3, GPT-4, and the subsequent generation of large language models.

Reflection: The Transformer architecture’s greatest contribution may not have been any specific technical innovation but the opening of an entirely new dimension of progress: scale. Previous architectures had benefited from scale to some degree, but the Transformer’s parallelizability and its clean scaling behavior made scale a reliable and predictable source of improvement in a way that had not previously been true. This transformed AI development from a research process --- in which progress came from clever ideas --- into something that also resembled an engineering process, in which progress could be purchased with compute.

Section 3: GPT --- The Generative Pre-Trained Transformer

The Transformer architecture, as Vaswani et al. had developed it, was designed for a specific task: supervised machine translation, where training required parallel corpora of source and target sentences. The GPT line of models, developed at OpenAI beginning in 2018, took a different approach that proved far more consequential: use the decoder-only Transformer architecture for unsupervised language modeling --- training the model to predict the next token in a sequence --- on very large amounts of unlabeled text, and then apply the resulting model to downstream tasks either through fine-tuning on task-specific data or, at sufficient scale, through prompting alone. This pretraining-then-fine-tuning paradigm, and the discovery that prompting alone was sufficient at large enough scales, produced the systems that would eventually reshape public understanding of what AI could do.

GPT-1: The Pretraining Paradigm Established

The first GPT model, described in a June 2018 paper titled “Improving Language Understanding by Generative Pre-Training” by Radford and colleagues at OpenAI, was a decoder-only Transformer with 117 million parameters, trained on the BooksCorpus dataset of approximately 7,000 unpublished books totaling around 800 million words. The architecture was a straightforward application of the Transformer’s decoder --- twelve layers, 768-dimensional embeddings, twelve attention heads --- trained with the standard language modeling objective: predict the next token given all previous tokens in the sequence.

What made GPT-1 significant was not its performance on any single task but the demonstration that the language modeling pretraining objective produced representations that transferred remarkably well to a wide range of downstream NLP tasks through fine-tuning. When the pretrained model was fine-tuned on labeled data for specific tasks --- natural language inference, question answering, semantic similarity, text classification --- it achieved state-of-the-art results on nine of the twelve tasks evaluated, despite having been trained on a generic language modeling objective with no task-specific design. The pretrained model had, through predicting words on a large text corpus, learned representations of language that encoded syntactic and semantic regularities useful for understanding almost any language task. The pretraining had made the fine-tuning more effective, and the fine-tuning required far less labeled data than training from scratch.

GPT-1 established the paradigm that would define the subsequent half-decade of NLP research: large-scale unsupervised pretraining followed by task-specific fine-tuning. The intuition was that language modeling --- predicting what word comes next --- was a form of self-supervised learning that captured an enormous amount of structure about language, simply because predicting words requires understanding their meanings, their grammatical roles, the topics they occur in, the entities they refer to, and the pragmatic contexts in which they are appropriate. A model trained to predict words well had, as a byproduct, learned to represent language well.

GPT-2: Scale, Surprise, and the Safety Debate

The second GPT model, described in a February 2019 paper titled “Language Models Are Unsupervised Multitask Learners,” represented a tenfold increase in scale: 1.5 billion parameters, trained on WebText, a dataset of approximately 40 gigabytes of text scraped from web pages linked by Reddit posts with at least three upvotes. The dataset curation strategy --- using Reddit upvotes as a proxy for text quality --- produced a corpus that was more diverse and more naturally occurring than the BooksCorpus, and the combination of more data with more parameters produced a model that exhibited behaviors its creators had not anticipated.

The most striking of these behaviors was coherent long-form text generation. When prompted with the beginning of a passage, GPT-2 could continue it for hundreds of words in a style and with a content that was, at a casual reading, indistinguishable from human writing. The model could generate plausible news articles, short stories, technical summaries, and poetry when given appropriate prompts. Its factual claims were often wrong, its coherence over very long passages was limited, and it had no genuine understanding of what it was writing --- but the surface fluency was, for the first time, good enough to be genuinely alarming to observers who imagined its potential for generating convincing misinformation at scale.

OpenAI’s decision to release GPT-2 in staged form --- releasing smaller versions while withholding the full 1.5-billion-parameter model, on the grounds that the full model posed “foreseeable risks” of misuse --- was itself a landmark event, the first time a major AI lab had made a public safety argument for withholding a research result. The decision was controversial within the research community: critics argued that the model’s capabilities were not unprecedented, that withholding it was primarily a publicity strategy, and that staged release was not a principled approach to the safety problems that genuinely capable language models posed. Defenders argued that the demonstration of the safety principle mattered more than its specific application in this case, and that establishing norms around careful release of powerful models was valuable regardless of whether GPT-2 specifically warranted such caution.

In the event, the full GPT-2 model was released six months later in November 2019, and the predicted misuse scenarios did not materialize at the scale that had been feared. The safety debate, however, had established a template for how AI labs and the public would discuss the risks of increasingly capable language models --- a template that would become enormously more consequential when GPT-3 arrived the following year.

GPT-3: The Emergence of Few-Shot Learning

GPT-3, described in May 2020 in “Language Models Are Few-Shot Learners” by Brown and colleagues, was an order of magnitude larger than GPT-2: 175 billion parameters, trained on a 570-gigabyte filtered dataset combining WebText with books and a substantial portion of the English-language web, using a compute budget of approximately 3,640 petaflop-days --- more computation than had been applied to any previous language model by several orders of magnitude. The resulting model was not just larger than its predecessors; it was qualitatively different in a specific and surprising way.

The surprise was few-shot learning: the ability of GPT-3 to perform well on tasks it had not been explicitly trained for, given only a small number of examples of the task format in the prompt. Provide GPT-3 with three examples of English-to-French translation followed by an English sentence and it translated the sentence into French, without any fine-tuning, by apparently inferring the task from the pattern in the prompt. Provide it with examples of arithmetic, or question answering, or code generation, and it generalized from those examples to new instances of the same pattern. This “in-context learning” --- learning to perform a task from examples in the prompt rather than from gradient updates to the model’s weights --- had not been an explicit design goal of GPT-3 and was not fully understood theoretically; it appeared to emerge from scale in a way that smaller models did not exhibit.

The capabilities of GPT-3 astonished even its creators. On many NLP benchmarks, it achieved competitive results with fine-tuned models despite receiving no gradient updates at test time --- relying only on the in-context examples in the prompt. On open-ended generation tasks, it produced text of a quality and diversity that previous language models had not approached. It could write code, compose essays, generate poetry, answer factual questions, explain concepts, summarize documents, translate languages, and perform arithmetic, often with remarkable fluency and apparent competence, when given appropriate prompts. Its failures were equally striking: it could produce fluent nonsense with complete apparent confidence, fail simple logical puzzles that any child could solve, and exhibit systematic biases and factual errors that reflected the characteristics of its training data.

“GPT-3 did not understand language. It had compressed the statistical structure of 570 gigabytes of human writing into 175 billion numbers --- and that compression turned out to be powerful enough to do remarkable things.”

The release of GPT-3, unlike GPT-2, was not accompanied by a staged withholding but by a commercial API that allowed developers to build applications using the model’s capabilities. This decision reflected a deliberate strategy: rather than attempting to prevent misuse through withholding, provide access in a controlled way that allowed monitoring, and generate the revenue needed to fund the safety research that responsible deployment required. The strategy was consequential: within months, thousands of developers were building applications using GPT-3’s API, and the model’s capabilities were demonstrated in a wide range of practical contexts that academic benchmarks had not anticipated.

Reflection: The GPT progression from GPT-1 to GPT-3 demonstrated something that the scaling laws had predicted but that many researchers had not fully believed until they saw it: that scale alone, applied to the right architecture and the right training objective, could produce qualitative jumps in capability. The few-shot learning that emerged in GPT-3 was not designed; it was discovered. This pattern --- of capabilities emerging from scale in ways that are not fully anticipated or understood --- became one of the defining and most troubling characteristics of large language model development.

Section 4: The Transformer Family --- BERT, T5, and the Ecosystem

GPT was not the only or even the most immediately successful application of the Transformer architecture in NLP. The same architectural foundations that OpenAI had applied to autoregressive language modeling were applied by Google and others to different pretraining objectives and different architectural configurations, producing a family of models whose combined influence on NLP was more total and more rapid than any single line of development could have achieved. Understanding the Transformer’s impact requires understanding the diversity of the family it spawned, and the ways in which different architectural choices and pretraining strategies produced systems with different strengths and weaknesses.

BERT: Bidirectionality and the Fine-Tuning Era

BERT --- Bidirectional Encoder Representations from Transformers --- was introduced by Devlin and colleagues at Google in October 2018, just four months after GPT-1. Where GPT-1 used a decoder-only architecture trained with a left-to-right language modeling objective (predicting each token given only the tokens that preceded it), BERT used an encoder-only architecture trained with two novel pretraining objectives: masked language modeling, in which randomly selected tokens were replaced with a special mask token and the model was trained to predict the original tokens from their bidirectional context; and next sentence prediction, in which the model was trained to predict whether two sentences were adjacent in the original text.

The masked language modeling objective was technically straightforward but representationally powerful: by requiring the model to predict each token from both the preceding and following context, it forced the representations to incorporate information from both directions of the sequence simultaneously, rather than only from the left as in GPT. For tasks that required understanding of complete sentences --- question answering, natural language inference, named entity recognition, semantic similarity --- this bidirectional context proved significantly more useful than the unidirectional context of GPT-1.

BERT’s impact on NLP benchmarks was immediate and dramatic. On the GLUE benchmark --- a collection of nine NLP tasks designed to evaluate general language understanding --- BERT achieved a score of 80.4, more than seven points above the previous state of the art. On the Stanford Question Answering Dataset, BERT surpassed human performance for the first time. On eleven NLP tasks evaluated in the original paper, BERT set a new state of the art on all eleven. The research community’s response was equally dramatic: within a year of BERT’s publication, it had been cited more than ten thousand times and had spawned a proliferation of variants, extensions, and applications that made it the dominant paradigm for NLP research and application development through the early 2020s.

T5: Unifying NLP as Text-to-Text

Google’s T5 --- Text-to-Text Transfer Transformer --- introduced in October 2019 by Raffel and colleagues, took a different approach to unification: rather than using a specialized pretraining objective for each type of task, reframe every NLP problem as a text-to-text problem in which both the input and output are sequences of tokens. Translation is text-to-text: input is the source text, output is the translation. Summarization is text-to-text: input is the document, output is the summary. Question answering is text-to-text: input is the question and context, output is the answer. Classification is text-to-text: input is the text to be classified, output is the class label as a text token.

The T5 framework’s appeal was its generality: a single model architecture and a single pretraining objective could be applied to every NLP task without modification, allowing transfer learning to operate across task boundaries in ways that task-specific architectures could not. The T5 paper also introduced the C4 dataset --- a 745-gigabyte cleaned version of the Common Crawl web corpus --- and conducted an extensive systematic study of the effect of architectural choices, pretraining objectives, data composition, and scale on downstream task performance. This systematic comparison was methodologically valuable beyond the specific T5 model, providing a much clearer understanding of what drove performance improvements in large language models than the field had previously possessed.

The Broader Ecosystem and Hugging Face’s Role

The proliferation of Transformer-based models --- GPT, BERT, T5, RoBERTa, XLNet, ALBERT, DistilBERT, and dozens of others --- created a coordination problem for the NLP research and application development community: each model had its own implementation, its own tokenization scheme, its own fine-tuning interface, and its own pretrained weights distributed through different repositories. The practical cost of working with multiple models was high enough to slow adoption and impede reproducibility.

The solution that the community converged on was Hugging Face’s Transformers library, initially released in 2018 as a PyTorch implementation of BERT and expanded over the following years into a comprehensive ecosystem that provided standardized interfaces for hundreds of pretrained Transformer models across dozens of languages and dozens of tasks. By providing a common API through which researchers and developers could access any model in the ecosystem with essentially the same code, regardless of the underlying architecture or the organization that had produced it, Hugging Face dramatically lowered the barrier to working with pretrained Transformers and accelerated the pace at which new models and techniques were adopted.

The Hugging Face Model Hub, which allowed anyone to publish pretrained models alongside documentation and example code, became the de facto distribution mechanism for NLP models in the same way that GitHub had become the de facto distribution mechanism for software. By 2022, the Model Hub hosted more than 100,000 models, and the Transformers library had been downloaded more than a billion times. The democratization of access to large pretrained models that Hugging Face enabled was one of the most important factors in the rapid expansion of the community working on Transformer-based NLP, and in the diversity of languages and tasks to which these models were applied.

Reflection: The Transformer ecosystem that developed between 2017 and 2022 demonstrated how quickly an architectural innovation can become infrastructure. Within five years of the original paper, the Transformer had gone from a novel research contribution to the assumed baseline for essentially all NLP research and most NLP application development. The question was no longer whether to use Transformers but which Transformer, trained how, on what data, at what scale.

Section 5: Applications, Creative Uses, and Industry Adoption

The Transformer architecture’s influence extended far beyond academic NLP benchmarks and research publications. Through the late 2010s and early 2020s, Transformer-based models became the backbone of practical AI systems in search, translation, code generation, content creation, customer service, and a range of other applications that collectively touched hundreds of millions of users. The transition from research architecture to deployed product was rapid and, in many cases, not publicly announced: the model that made Google Search better in 2019, the model that improved Google Translate in 2020, the model that powered GitHub Copilot in 2021 were all Transformers or Transformer derivatives, but most of the people using these systems were unaware of the architectural shift that had produced the improvement.

Language Tasks: Translation, Summarization, Question Answering

Machine translation --- the task that had motivated the Transformer’s development --- was transformed by Transformer-based systems more completely than almost any other NLP application. Google Translate’s switch from phrase-based statistical machine translation to a neural machine translation system based on the Transformer architecture in 2020 produced what Google described as the largest single improvement in translation quality in the history of the product. For major language pairs with large training corpora, Transformer-based translation reached a level of quality that was, for most practical purposes, good enough to convey the meaning and register of the original without requiring post-editing. The limitations --- difficulty with rare languages, sensitivity to domain-specific vocabulary, occasional hallucinated content --- remained significant but were qualitatively less severe than those of the systems they replaced.

Automatic summarization, the problem of condensing a long document into a shorter version that preserves its most important content, benefited similarly from the Transformer’s ability to process long sequences and integrate information across large spans of text. The encoder-decoder architecture was well suited to summarization: the encoder built a rich representation of the full document, and the decoder generated a summary by attending selectively to the parts of the representation most relevant to each part of the summary. By the early 2020s, abstractive summarization systems --- systems that generated novel text rather than extracting verbatim sentences from the source --- were producing summaries of news articles, research papers, and legal documents that were rated by human evaluators as comparable in quality to human-written summaries on a substantial fraction of test cases.

Code Generation: GitHub Copilot and the Programmable Model

One of the most consequential and least anticipated applications of large Transformer-based language models was code generation: the use of models trained on large corpora of source code to assist programmers by predicting, completing, or generating code from natural language descriptions. GitHub Copilot, launched as a technical preview in June 2021 and built on a Transformer model called Codex that was derived from GPT-3 and fine-tuned on 159 gigabytes of public source code from GitHub, was the first code generation system to reach mainstream developer adoption.

Copilot’s capabilities were genuinely surprising to many developers who tried it. It could complete partial code with syntactically and semantically correct continuations, generate functions from docstring descriptions, suggest relevant imports, and adapt to the style and conventions of the surrounding codebase. Its suggestions were wrong often enough that they could not be accepted without review, but they were right often enough that the experience of programming with Copilot was meaningfully faster than programming without it for many common tasks. Within a year of its general availability, GitHub reported that Copilot-generated code accounted for roughly 40 percent of the code written in the repositories where it was enabled --- a statistic that, if accurate, represents one of the most rapid adoptions of any new programming tool in the history of software development.

The code generation application also illustrated, with particular clarity, one of the most important properties of large language models: their ability to operate across modalities that share a common token-based representation. Code is text; it can be tokenized and processed by the same Transformer architecture that processes natural language. A model trained simultaneously on natural language and source code can learn the relationship between the two --- can learn, in effect, that the natural language description “function that returns the sum of a list of numbers” corresponds to a particular pattern of code tokens. This cross-modal capability, which came for free from the token-based architecture, was one of the most practically valuable properties of large language models and one of the least theoretically anticipated.

Creative Uses: Writing, Poetry, and Storytelling

The generative capabilities of GPT-2 and GPT-3 attracted attention not just from technologists and researchers but from writers, artists, and others interested in exploring what AI-assisted creativity might look like. The models could generate poetry in specified forms, continue stories in specified styles, write dialogue for fictional characters, and produce essays on specified topics, all with a fluency that earlier text generation systems had not approached. The outputs were uneven --- competent and occasionally striking at the level of individual sentences, inconsistent and sometimes incoherent over longer passages --- but they were different enough from both previous AI text generation and from most human writing to be genuinely interesting as a new kind of creative artifact.

The “AI dungeon” text adventure game, launched in 2019 and built initially on GPT-2 and subsequently on GPT-3, demonstrated that generative language models could support interactive narrative experiences of a kind that rule-based text adventure engines had not been able to provide: experiences where the player could describe any action and receive a contextually appropriate continuation of the story, rather than being constrained to a set of predefined commands. The game attracted millions of users and demonstrated a practical creative application that the research community had not specifically designed the technology for.

Reflection: The breadth of applications to which Transformer-based language models were applied in the years following the original paper illustrated a property of the architecture that was not apparent in 2017: its generality. A system designed for machine translation turned out to be applicable to question answering, code generation, creative writing, dialogue, summarization, and a dozen other tasks. This generality --- the ability of a single architecture and a single pretraining objective to produce systems that transferred across many tasks --- was one of the most important properties of large language models, and one of the most important differences between them and the task-specific systems they replaced.

Section 6: Challenges, Debates, and the Limits of Scale

The rapid development and widespread deployment of Transformer-based language models generated, alongside their practical achievements, a set of serious and still unresolved challenges. Some of these were technical: the computational cost of training large models, the difficulty of ensuring their factual accuracy, the challenge of making them behave reliably across diverse inputs. Others were social and ethical: the biases embedded in models trained on human-generated text, the potential for misuse in generating misinformation or automating harmful content, and the implications for employment of systems that could perform knowledge work tasks at unprecedented scale and speed. Still others were philosophical: questions about whether systems that generated fluent and apparently coherent text were doing anything that deserved to be called understanding, and what the right framework was for thinking about their capabilities and limitations.

Bias, Fairness, and the Mirror Problem

Large language models trained on text produced by humans inherit the biases, stereotypes, and prejudices embedded in that text. This is not a design choice but a mathematical consequence: a model trained to predict the statistical structure of a text corpus will learn whatever statistical regularities exist in that corpus, including regularities that reflect historical discrimination, social stereotyping, and unequal representation of different groups and perspectives. The GPT models, trained on text from the English-language web, inherited the web’s significant overrepresentation of certain demographics, languages, and viewpoints, and its underrepresentation of others.

The practical manifestations of these biases were extensively documented. Language models trained on GPT-scale data systematically associated certain occupational terms with certain genders, certain nationalities with certain character traits, and certain racial groups with negative semantic contexts, in ways that reflected historical patterns in the training data rather than current social realities. Models asked to complete sentences about members of different groups produced systematically different outputs that reflected these biases. Models asked to generate text in the voice of members of different demographic groups produced stereotyped representations that could be both inaccurate and harmful.

Addressing these biases proved significantly harder than identifying them. Filtering the training data to remove text with explicitly biased content reduced the most egregious outputs but could not remove the implicit statistical regularities that reflected broader patterns in how language had been used historically. Fine-tuning the model on labeled data designed to produce more equitable outputs could reduce some biases while introducing others, or could reduce performance on tasks unrelated to bias while improving performance on measures of fairness. Reinforcement learning from human feedback --- the technique that OpenAI would use to produce InstructGPT and later ChatGPT --- proved effective at reducing harmful outputs but could not guarantee that all forms of bias had been addressed. The bias problem was not solved; it was managed, imperfectly and continuously.

Computational Cost and Environmental Impact

The training cost of large Transformer-based language models scaled roughly as the product of model parameters and training tokens, with additional costs for the infrastructure needed to run training at scale. Training GPT-3 was estimated to have cost between four and twelve million dollars in compute, depending on the hardware configuration and the efficiency of the training run. Subsequent models were substantially more expensive: estimates for training GPT-4 ranged from 50 to 100 million dollars. These costs placed the frontier of large language model development beyond the reach of academic research groups and most commercial organizations, concentrating the capability to train state-of-the-art models in a small number of well-resourced organizations.

The environmental cost of large-scale model training was also a matter of significant concern. A 2019 paper by Strubell and colleagues estimated that training a single large Transformer model from scratch emitted carbon dioxide equivalent to approximately the lifetime emissions of five average American cars. The estimate was contested, and subsequent analysis suggested that the specific figures depended heavily on the energy source of the data center used for training, but the broader point --- that the computational requirements of large language model training had a non-trivial environmental footprint that grew with each successive generation of models --- was not seriously disputed. The research community began discussing the “Green AI” agenda: the importance of reporting and minimizing the environmental costs of AI research, and of developing more computationally efficient architectures and training methods.

Hallucination and the Limits of Statistical Learning

Perhaps the most practically significant limitation of GPT-scale language models was their tendency to “hallucinate”: to generate factually incorrect statements with the same fluency and apparent confidence as factually correct ones. The hallucination problem arose from the fundamental nature of language model training: a model trained to predict the next token in a sequence learned to produce text that was statistically plausible given its training data, not text that was factually accurate. For most tokens in most contexts, statistical plausibility and factual accuracy were aligned --- the statistically most likely continuation of a sentence was also the most accurate one. But for specific factual claims, particularly about rare entities or events underrepresented in the training data, the model had no reliable mechanism to distinguish between what it had learned from the training data and what was actually true.

The practical consequences were significant for applications that required reliable factual accuracy. A language model used as a research assistant that confidently cited non-existent papers, a legal AI that invented case citations, or a medical information system that described non-existent treatments posed risks that the fluency of the output made harder rather than easier to detect. Addressing hallucination required either augmenting the model with access to reliable external knowledge sources --- retrieval-augmented generation, which allowed the model to look up information rather than rely entirely on what was stored in its parameters --- or developing training and inference techniques that made the model better calibrated about its own uncertainty.

“The most dangerous property of GPT-3 was not that it could generate harmful content. It was that it could generate confident, fluent, plausible-sounding nonsense that was extremely difficult to distinguish from accurate information.”

The Ethics of Deployment: Misinformation, Labor, and Consent

Beyond the technical challenges of bias and hallucination, the deployment of large language models raised ethical questions that did not have purely technical solutions. The capability of GPT-2 and GPT-3 to generate fluent, convincing text at scale made them potential tools for generating misinformation, propaganda, and synthetic media at a scale and speed that no human-authored campaign could match. The concern was not merely theoretical: within months of GPT-3’s API release, researchers were demonstrating that it could generate convincing fake news articles, social media posts in the style of specific individuals, and persuasive political content indistinguishable from authentic human-written material.

The question of training data consent was also raised with increasing urgency as the scale of training corpora grew. The web text that formed the bulk of GPT-3’s training data had been produced by millions of individuals who had made no agreement --- explicit or implicit --- to have their writing used to train a commercial AI system. The legal status of training on publicly available text was, and remains, contested; the ethical status was contested even among those who agreed on the legal analysis. The authors of books, articles, code, and other creative work whose output formed the training data for large language models had not consented to its use, received no compensation for it, and in many cases were unaware that their work had been incorporated.

Reflection: The challenges associated with large language models --- bias, hallucination, computational cost, data consent, misuse potential --- were not defects of a particular implementation but consequences of the approach itself: training very large models on very large quantities of human-generated text to predict statistical regularities, without any guaranteed alignment between those regularities and the values, accuracy standards, or social norms that responsible deployment would require. Addressing these challenges has become one of the central preoccupations of AI research and AI governance in the years since GPT-3, and the field’s progress on them has been real but incomplete.

Conclusion: Architecture as Destiny

The Transformer architecture, introduced in a single paper in June 2017, accomplished something that few individual research contributions in the history of science have accomplished: it changed the trajectory of an entire field, and did so in a way that was visible and measurable within years. By 2022 --- five years after the paper’s publication --- essentially all state-of-the-art NLP systems were Transformer-based. The architecture had been applied to images, audio, video, molecular biology, protein structure prediction, and reinforcement learning, demonstrating a generality that its original authors had not anticipated. And the successive generations of GPT models had demonstrated that scaling the Transformer architecture produced qualitative jumps in capability that were forcing fundamental revisions in what people believed AI systems could and could not do.

The Transformer’s deepest contribution was not any specific technical innovation but the opening of a new axis of progress: scale, made reliable and predictable by an architecture that benefited from it in a systematic way. The symbolic AI tradition had hoped to achieve intelligence by encoding knowledge; the statistical learning tradition had hoped to achieve it by learning from data; the deep learning revolution had demonstrated that learned representations could achieve things that hand-crafted representations could not. The Transformer and GPT demonstrated something else: that sufficient scale, applied to the right architecture and the right training objective, could produce systems that appeared to generalize, to reason, and to create in ways that the architecture’s designers had not designed them for and could not fully explain.

Whether these appearances reflected genuine understanding, and what “genuine understanding” would even mean for a system of 175 billion numerical parameters trained to predict tokens, were questions that the field was actively debating as the 2020s began --- and that it has not resolved. What was not debatable was the practical impact. The systems produced by the Transformer architecture, and the GPT line in particular, had demonstrated capabilities in language understanding and generation that were qualitatively different from anything that had preceded them, and that were beginning to change how people thought about the relationship between human and machine intelligence. The architecture had become, in a very real sense, destiny: the foundation on which the next generation of AI --- the ChatGPT era and beyond --- was being built.

“The Transformer did not give machines language. It gave language models a form that could scale --- and at sufficient scale, something extraordinary emerged.”

───

Next in the Series: Episode 16

The Rise of Generative AI --- From Text to Images, Music, and Multimodal Creativity

The Transformer architecture that reshaped natural language processing did not remain confined to text. In Episode 16, we trace the generative AI revolution that followed: how diffusion models and generative adversarial networks produced AI systems capable of generating photorealistic images from text descriptions; how models like DALL-E, Stable Diffusion, and Midjourney brought image generation to mass audiences and triggered fierce debates about creativity, authorship, and the economic future of visual art; how text-to-audio and text-to-music systems extended the generative paradigm to sound; and how multimodal models that processed and generated across text, images, audio, and video simultaneously began to dissolve the boundaries between different forms of AI capability. The generative AI era that emerged from the Transformer architecture is still unfolding --- and its implications for creativity, labor, identity, and truth are among the most urgent questions of our time.

--- End of Episode 15 ---