Zero Labs
Industry News / AI

Why Modern LLMs Don’t Look Like the Original Transformer

Source · Towards AI By Saurabh Singh

From the publisher’s feed, collected in the ZeroLabs newsroom.

The familiar diagram had two halves. Follow what changed when the job grew beyond translation.If you’ve ever tried to understand an LLM, you’ve probably come across this picture. It is Figure 1 from Attention Is All You Need, the 2017 paper that introduced the Transformer.There is a lot going on: colored boxes, looping arrows, and two tall stacks that seem to do slightly different versions of the same thing. It is easier to follow once you give the machine a sentence to work on.Suppose we want to translate “The cat is sleeping” into German. The left stack reads the English sentence. The right stack writes “Die Katze schläft.”Now look inside a model such as Llama 3.1. That separate text encoder on the left is gone. One of the attention blocks on the right has gone with it.If you learned both halves because you wanted to understand chatbots, this can be confusing. The familiar drawing is still a good place to start. We just have to follow what happened after it was published.The left side was there for a reasonLook at the arrow that leaves the top of the left stack and crosses into the middle attention block on the right. That connection explains why a translator needs two stacks.The encoder has read the English sentence and built a representation of each token. The decoder can consult those representations while deciding which German token to produce next.When it has written “Die Katze,” it still has access to the English words “is sleeping.” It can use that source information alongside the German text it has already produced. This is the role of cross-attention, the attention between the two stacks.The bottom attention block on the right has another job. It looks at the output written so far. Its mask prevents a position from seeing later output tokens, which would give away the answer during training.So the decoder was already a machine for writing one token after another. The encoder gave it a separate piece of text to consult.That translation story is also where I start in The Translator That Forgot,my visual walkthrough of the paper. Following a sentence through the model makes the arrows much easier to understand than starting with the names of every box.https://medium.com/media/52ff0f612ed6d90a21676b5a11de9e71/hrefIt also makes the next change easier to see.What changed when the model learned to keep writingA translator learns from pairs of texts. Here is the English sentence; here is its German translation.But there is much more ordinary text available than neatly paired examples. Books, webpages and code all contain a different kind of training example: a passage followed by whatever comes next.A model can read a prefix, predict the next token, and learn from whether it was right. Do that across a large corpus, and the same task exposes it to grammar, facts, writing styles and patterns in code. The first GPT paper used a Transformer decoder for this kind of generative pretraining in 2018.Now there is no separate source sentence to encode. The earlier text is already in the same sequence as the text being predicted. A causal attention stack can process that prefix directly.This is the important difference between a decoder-only model and simply covering up the left side of the old picture. The cross-attention block that used to read the encoder’s output goes away too.A chat application can then arrange a conversation as one sequence, using markers to identify the user, assistant and other parts of the exchange. The model continues that sequence with the assistant’s response. Instruction tuning and other post-training help turn a text continuation model into something that follows requests.During training, the text is already available, so the model can process many positions together while masking future tokens. When it generates a new answer, the ordinary autoregressive loop still depends on the tokens it has produced so far.The old encoder has not become useless. A translation model can still use one, and a multimodal model may have a separate image encoder. Its removal from a text-only language model follows from the job that model is being trained to do.Then the conversation got expensiveOnce a model can continue a conversation, people naturally want it to continue a longer one. They paste a document, ask follow-up questions and expect the earlier details to remain available.For the system serving the model, those earlier tokens have a cost.Attention uses quantities called keys and values to read information from previous tokens. During generation, the system can keep these quantities in a KV cache, saving it from having to recompute them every time it writes another token.Each attention layer keeps its own cache. As the sequence grows, more cached numbers accumulate.Consider an illustrative model with 32 layers, 32 query heads and 128 numbers per head. Suppose it has 8,192 tokens in context and stores each cached number in two bytes.If every query head has its own key and value head, the cache payload is 4 GiB for that one sequence. The model’s weights and other runtime memory are extra.That is a substantial bill for remembering what has already been said.Grouped-query attention, or GQA, changes how that work is shared. Several query heads use the same key and value head. The queries still differ, but the model learns to work with shared keys and values.With eight KV heads instead of 32, the same calculation gives 1 GiB.The arithmetic for the eight-head case is:2 × 32 layers × 8,192 tokens × 8 KV heads × 128 numbers × 2 bytes = 1,073,741,824 bytes, or 1 GiB.The first 2 counts keys and values. Keep all the other assumptions fixed and multiply the KV heads by four, and you get the 4 GiB case.This saving applies to the cache payload. It does not make the whole model four times smaller or guarantee a fourfold speed-up. And the cache still grows with the sequence: at 32,768 tokens, our eight-head example reaches 4 GiB again.You can see the same pressure behind other designs. DeepSeek-V3’s multi-head latent attention stores a compressed representation of keys and values, along with separate positional information. It takes a different route from GQA, but it is trying to make long histories less expensive to keep.The small boxes changed as wellEven after you account for the missing encoder and the smaller cache, a modern block will not match the old diagram box for box.Take position. The order of “dog bites man” matters, even though it contains the same words as “man bites dog.” A model needs a useful way to represent where tokens sit in the sequence.The original Transformer added positional signals to token embeddings. Rotary positional embeddings, usually called RoPE, instead rotate query and key coordinates according to position. The difference between those rotations lets their dot product reflect relative position.That change is useful when working with longer contexts, though extending a model’s context still takes appropriate training, scaling methods and evaluation.The feed-forward box changed too. It transforms each token’s representation after attention has gathered information from other positions. Modern models often use SwiGLU, where a learned gate modulates the values passing through that computation.Then there are the “Add & Norm” boxes. The original drawing puts normalization after each residual sum. Later designs often normalize before the attention or feed-forward computation. Many also use RMSNorm, a simpler rescaling operation that leaves out LayerNorm’s mean subtraction.These names can look like a wall of unrelated acronyms on a model card. Read the Qwen3 architecture description after looking at the old diagram, and they become easier to place. RoPE concerns position. GQA concerns attention heads and their cache. SwiGLU concerns the feed-forward calculation. Pre-RMSNorm concerns how values are normalized before each sublayer.The broad outline is recognizable. The implementation inside it has changed.Some changes were about the GPUThere is another reason a modern implementation can look different: the hardware may spend too much time moving intermediate results around.A straightforward attention implementation can write a large matrix of scores to GPU memory, then read it back for the next part of the calculation. The arithmetic might be fast, yet those trips to memory remain expensive.FlashAttention tackles that problem by processing tiles and keeping track of the normalization statistics it needs as it goes. It avoids materializing the full attention matrix in high-bandwidth memory.This is a change in how attention is executed. The operation is still exact dense attention in the mathematical sense, although floating-point execution order can affect numerical results.That distinction matters. GQA changes which heads share keys and values. FlashAttention changes how the GPU carries out the work. You can use both.It also helps explain why “faster attention” does not always mean a new architecture. Dense attention over every position still has quadratic pairwise computation during training or prompt processing. Reading and writing less memory can make that computation much more practical without changing its basic scaling.Others changed how much of the model runsAttention is only part of a Transformer. There are also the feed-forward layers, and these offer another way to increase a model’s capacity.Instead of one feed-forward network handling every token, a mixture-of-experts layer keeps several networks and uses a router to select a few for each token.Qwen3’s MoE variants have 128 experts, with eight activated per token. Its dense variants use a conventional dense feed-forward network. Both remain part of the same architectural family.This lets the model store more capacity without running every expert on every token. It also creates practical problems of its own: experts need to receive useful training, and activations may need to move between devices.The large parameter number on an MoE model therefore tells you how much is stored. The active parameter number tells you more about what participates in processing a token. Neither number, by itself, gives you the full serving cost.The attention mechanism can remain in place throughout this change. The part being reorganized is the feed-forward computation.The next branch looks different againOnce you start reading model descriptions this way, you can see where some designs depart further.The official Qwen3.5–35B-A3B model card describes a language backbone that repeats three Gated DeltaNet layers followed by one attention layer. Each layer is paired with MoE, and that four-layer pattern repeats ten times.The DeltaNet layers carry information forward in a recurrent state. The attention layers can access keys and values across the sequence. The designers are combining two ways of handling past information inside one model.Our earlier calculation assumed a full KV cache in every layer. It would not describe the complete state of this hybrid. You have to inspect what each kind of layer actually stores.This model also has a vision encoder. So even the idea that “the encoder disappeared” needs context: a text model can drop the original source-text stack while a multimodal system uses an encoder to process images.There is no single modern diagram that replaces the 2017 one for every LLM.And changes in architecture are only part of the story. Better data, more training and post-training can improve a model substantially while much of its structure stays the same. Meta emphasizes data and scale when explaining Llama 3’s gains.The original picture is still worth spending time with. Look at the arrow between its two stacks, then compare it with a causal language model. Look at the attention boxes, then ask what each layer keeps in memory. The newer designs become easier to understand when you can point to the part that changed.If you want to get comfortable with those attention boxes, the interactive breakdown of Attention Is All You Need works through a query, its scores and the values it gathers. That small calculation gives you something concrete to recognize when you return to a model report.The arrow between the two stacks made sense for a translator. The newer diagrams make sense when you know what their designers were trying to build.Why Modern LLMs Don’t Look Like the Original Transformer was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.