Concepts / The Original Transformer Architecture

The Original Transformer Architecture

The architectural choice follows the task. Because GPT writes forward one word at a time, it keeps the half of the original design that is built for that forward direction and drops the half that GPT does not need.

  • Programming

Asking What GPT Kept

Imagine you are handed a diagram of the original transformer and told that GPT was built from it. The first question a careful learner asks is simple: what did the GPT designers keep, and what did they throw away? This article answers that question. Rather than memorizing a list of differences, we will follow the path a piece of text takes through each design and let the differences appear along the way.

What do you think happens?

The original transformer is built from an encoder block and a decoder block. Before reading on, which of these two halves do you think GPT keeps?

  • Only the encoder

  • Only the decoder

  • Both the encoder and the decoder

Reveal answer
Answer:

Only the decoder

GPT employs only the decoder portion of the original transformer and drops the encoder. The reason the source gives is tied to the job GPT is built for: unidirectional, left-to-right processing suited to text generation.

Following a Piece of Text Through Two Designs

The original transformer is built from two kinds of blocks: an encoder block and a decoder block. In the original design, these blocks were repeated six times. Depth in this sense is simply how many times the same kind of processing stack is applied one after another to the data.

GPT keeps only the decoder half. Its stack is also much deeper. The diagram below places both designs in the same frame, so you can see which parts exist in each. Read it as a comparison: the original transformer column has both blocks, while the GPT column keeps the decoder and has no encoder.

Encoder blockrepeated six timesEncoder blockdroppedDecoder blockrepeated six timesDecoder blockkept
Which parts of the original encoder-decoder transformer remain in GPT, and which are removed?

Why the Decoder Fits the Job of Generation

The source ties the choice to keep the decoder and discard the encoder to what GPT is designed to do. GPT is designed for unidirectional, left-to-right processing. This makes it well suited to text generation and next-word prediction. Generation is a task where the model writes forward, so a stack organized around handling text in one direction fits the job naturally.

Key point

The architectural choice follows the task. Because GPT writes forward one word at a time, it keeps the half of the original design that is built for that forward direction and drops the half that GPT does not need.

Comparing Depth Across Two Designs

The source gives concrete numbers for depth. The original transformer repeated its encoder and decoder blocks six times. GPT-3, which the source uses as its main example of the GPT family, has 96 transformer layers and 175 billion parameters in total. The source makes the point that architectures like GPT-3 are significantly larger than the original transformer.

DesignBlocks keptDepth as given in the sourceSize as given in the source
Original transformerEncoder and decoderEach block repeated six timesNot given in the source
GPT-3Decoder only96 transformer layers175 billion parameters

Depth and size figures as stated in the source material

Generating Text One Word per Round

Read the GPT design as a loop, not a single pass. Text enters and is preprocessed, then the decoder processes it and the output layers produce a result. That result is not the end of the story. It is fed back in as the input for the next round, so each round depends on what the previous round produced, and the process repeats.

Input sequencetext so farPreprocessingtext entersDecoderprocesses the textOutput layersproduce one resultAppend next wordadded to the sequenceentersprocessed byproducesresultfed back as next input
What happens at each step as GPT appends a word and feeds the growing sequence back in to produce the next word?

The loop explains how GPT produces longer text. The model does not write a whole paragraph in one step. It generates text iteratively, producing one word per round, and each new word is appended to what came before before the next round begins. This is what the source means when it says the model works one word at a time.

Worked example

Tracing a Sequence Through the Loop

Suppose the current input sequence is the phrase "The cat". Trace how GPT would extend it, one word per round, using the loop from the diagram.

  1. 1
    Round 1 input

    The input sequence is "The cat". It is preprocessed and passed through the decoder.

  2. 2
    Round 1 output

    The output layers produce one next word, for example "sat". That word is appended, so the sequence becomes "The cat sat".

  3. 3
    Round 2 input

    The growing sequence "The cat sat" is fed back in as the new input. Round 2 depends on everything produced so far.

  4. 4
    Round 2 output

    The next word is produced and appended, and the sequence grows again. The cycle repeats for as many rounds as needed.

Result

The sequence grows one word at a time, and each round's output becomes part of the next round's input.

Why the Base Design Matters for LLMs

The course establishes one fact early: Large Language Models are derived from a specific design called the transformer architecture. The direction of this relationship matters. The transformer architecture is the starting point, and LLMs are what get derived from it. The architecture is therefore the more general design, and LLMs are built on top of it. Understanding the architecture is one of the routes to understanding LLMs.

Transformerarchitecturebase designLarge Language Modelsderived from the baseGPTdecoder-only designMeta Llama modelssame underlying concepts asGPTLLMs are derived fromincludesincludes
How does the original transformer branch into GPT and other LLMs, and which systems descend from the same base design?

Think of the architecture as a template that several products are built from. The template is not any one product. Each product starts from the same template and then takes its own shape. The tree shows this direction: the base design sits at the top of the derivation, and the derived systems branch below it. The diagram names only the things the source establishes. It does not list internal parts of the architecture, because the available material does not describe them.

Why GPT Still Matters Today

GPT-3 was introduced in 2020. By the standards of deep learning and large language model development, that is a long time ago. Yet the source argues that understanding GPT remains as relevant as ever. More recent architectures, such as Meta's Llama models, are still based on the same underlying concepts as GPT, with only minor modifications. Studying GPT therefore helps you read newer models, because the core ideas carried forward.

Mistakes Learners Make About Base Architectures

  • Common mistake

    Assuming GPT keeps both the encoder and the decoder

    What it looks like

    Reading the original diagram and concluding that GPT has the same two halves, just deeper.

    Why it fails

    The source states that GPT employs only the decoder portion and drops the encoder.

    Do this instead

    Keep the decoder and remember that the encoder is the part GPT removes.

  • Common mistake

    Treating the architecture as the same thing as a trained model

    Why it fails

    The source describes the architecture as a design, and LLMs are built on top of it. A design is not one trained model.

    Do this instead

    Say that LLMs are derived from the transformer architecture, not that they are the architecture itself.

  • Common mistake

    Reversing the direction of the relationship

    What it looks like

    Saying the transformer architecture is derived from LLMs.

    Why it fails

    The source says the direction runs from the base architecture to the derived LLMs.

    Do this instead

    The transformer architecture is the base, and LLMs are derived from it.

  • Common mistake

    Confusing layers with parameters

    What it looks like

    Thinking that 96 layers and 175 billion parameters measure the same quantity.

    Why it fails

    Layers count the stages data passes through, while parameters are adjustable numbers learned in training.

    Do this instead

    Report depth as layers and size as parameters, keeping the two measures separate.

  • Common mistake

    Assuming every LLM is built in exactly the same way, when the source only establishes the derivation relationship

What the Source Does and Does Not Establish

A base architecture and the systems derived from it are easy to over-describe. The material supports a specific set of claims: GPT uses only the decoder, GPT-3 has 96 transformer layers and 175 billion parameters, GPT generates one word per round in a loop, and LLMs are derived from the transformer architecture. The material does not describe the internal parts of the architecture, and it does not claim that every LLM is built identically.

Trace the Relationship Yourself

EASY

Without looking back, write three sentences. First, name the half of the original transformer that GPT keeps and the half it drops. Second, state the depth of the original transformer and of GPT-3, using only the numbers given in the source. Third, explain in one sentence why the base architecture sits above the LLMs in the derivation.

Hints
  • The source ties the choice of decoder to unidirectional, left-to-right processing.
  • Keep layers and parameters separate: depth is counted in layers, and size is counted in parameters.
  • The direction of the relationship runs from the base architecture to the derived LLMs.
MEDIUM

Explain why GPT generates text one word at a time, and describe what happens to the output of one round before the next round begins.

Hints
  • Think about the loop: the output layers produce a result that is fed back in.
  • Each new word is appended to what came before.

Summary of the Architecture Relationships

  1. 1
    GPT employs only the decoder portion of the original transformer and drops the encoder, because GPT is designed for unidirectional, left-to-right text generation.
  2. 2
    The original transformer repeated its encoder and decoder blocks six times, while GPT-3 has 96 transformer layers and 175 billion parameters. Layers and parameters measure different things.
  3. 3
    GPT generates text iteratively, one word per round, with each round's output appended and fed back in as the next input.
  4. 4
    LLMs are derived from the transformer architecture, which is the base design. The architecture is a design, not a single trained model, and the source establishes only this derivation relationship.

At a glance

  • GPT keeps only the decoder half of the original transformer and drops the encoder, matching its unidirectional, left-to-right design for text generation.
  • The original transformer repeated its blocks six times, while GPT-3 has 96 transformer layers and 175 billion parameters.
  • GPT generates text one word at a time in a loop, feeding each round's output back in as the next input.
  • LLMs are derived from the transformer architecture, which is the base design; the source establishes only this derivation relationship.

Related concepts

More concepts starting with T