Skip to main content

Inside the Transformer: The Architecture Behind Every Modern LLM

Inside the Transformer: The Architecture Behind Every Modern LLMPhoto: N43 and Hermes
N43 ANALYSIS
TECHNOLOGY · 7574
N43 ANALYSIS · ARTIFICIAL INTELLIGENCE

Attention, parallelism, and next-token prediction: the machinery under the hood of GPT-style models, and the limits that come with it.

Source video: Transformers, the tech behind LLMs | Deep Learning Chapter 5 · 3Blue1Brown · approximately 11,070,000 views observed via yt-dlp on 2026-09-07. Independently researched by N43 and Hermes.

01From recurrence to attention

Every large language model you have used since roughly 2018 is built on the same skeleton: the transformer, an architecture introduced in the 2017 paper “Attention Is All You Need.” Before that, the dominant tools for language were recurrent neural networks (RNNs) and LSTMs, which read a sentence one token at a time and carried a running “memory” forward. That design had a built-in flaw: information from early words faded as the sequence grew longer, and the strict left-to-right order meant step 100 could not begin until step 99 was finished.

The transformer replaced that running memory with attention, a mechanism that lets every position in a sequence look directly at every other position and decide, with learned weights, which ones matter. Long-range dependencies no longer degrade with distance; they are one direct connection away. This single change is why the transformer displaced RNNs almost completely within a few years, first in machine translation and then everywhere else.

02Tokens and embeddings: text as numbers

A transformer does not see words; it sees tokens, sub-word fragments produced by a fixed vocabulary and a compression scheme such as byte-pair encoding. Common words may be a single token, while rarer words split into pieces. Each token ID is mapped, through a learned lookup table, to an embedding: a vector of a few thousand numbers that positions the token in a high-dimensional space where similar meanings sit near each other.

Because attention itself has no built-in sense of order, the model adds a positional signal to each embedding so that “dog bites man” and “man bites dog” do not collapse into the same input. The exact scheme has evolved, from the original sinusoidal positions to learned and rotary encodings, but the job is the same: inject sequence order into a fundamentally order-blind computation.

03Inside the block: self-attention and the MLP

The core of the architecture is a stack of identical blocks. Each block contains two sub-layers. The first is multi-head self-attention: every token emits three vectors, a query, a key, and a value. Each query is compared against all keys, the similarities are normalized with a softmax into attention weights, and each token receives a weighted mixture of values. Multiple heads run this process in parallel, letting different heads specialize, one tracking syntax, another coreference, another long-range topic structure.

The second sub-layer is a position-wise feed-forward network (MLP), applied to each token independently, which is where a large share of the parameters and much of the model’s factual storage is believed to live. Residual connections and normalization wrap both sub-layers so gradients can flow through dozens or hundreds of stacked blocks without vanishing. GPT-style decoder-only models use one direction of attention (each token sees only its past), while encoder models such as BERT let tokens see in both directions.

04Parallelism: why transformers scaled

The decisive practical advantage is not architectural elegance but hardware fit. An RNN’s recurrence is inherently sequential, so adding compute does not shorten training. Self-attention over a whole sequence, by contrast, is a set of large matrix multiplications that can be executed for every position at once. That parallelism maps directly onto thousands of GPU cores, which is what made training on trillions of tokens economically feasible.

The same property changed the scaling playbook. Once training time stopped depending on sequence order, the reliable path to better models became bigger: more parameters, more data, more compute. As the charts below show, that recipe produced a roughly ten-thousand-fold rise in landmark model sizes between 2017 and 2024, and an even steeper climb in training compute.

05What GPT-style pretraining actually does

A model like GPT is trained on one deceptively simple objective: given the tokens so far, predict the next one. There are no labels in the human-annotation sense; the supervision is the text itself, which is why pretraining scales to internet-sized corpora. Gradient descent nudges billions of parameters so that the probability assigned to each actually-occurring next token goes up. Repeated over trillions of tokens, this forces the model to internalize grammar, facts, style, and many reasoning-like patterns just to keep its predictions competitive.

The result of pretraining is a base model: a next-token distribution, not an assistant. The chatbot behavior users see comes afterward, from fine-tuning on curated instruction data and from reinforcement learning on human or automated preference feedback. Those later stages shape how the model responds; they add relatively little new knowledge compared with pretraining.

06Scaling: parameters and compute

Empirical scaling laws formalized the bigger-is-better trend: loss falls predictably as a power law in parameters, data, and compute. Later work, notably the Chinchilla analysis, showed that many earlier models were under-trained, that parameter count and training tokens should grow together, and that simply inflating parameters without enough data wastes compute.

Parameter counts of landmark transformer modelsLog-scaled horizontal bars comparing approximate parameter counts of eight landmark transformer models from 65 million to 671 billion parameters.Parameter counts of landmark transformer models (log scale)Transformer base~65MTransformer big~213MBERT-Large (2018)~340MGPT-2 (2019)~1.50BGPT-3 (2020)~175.00BPaLM (2022)~540.00BLlama 3.1 405B~405.00BDeepSeek-V3~671.00B
Chart 1. Approximate published parameter counts of landmark transformer models, 2017–2024; bar lengths log-scaled, values rounded. Sources: original model papers (arXiv:1706.03762 and subsequent model reports); DeepSeek-V3 total is for its mixture-of-experts design.
Training compute of notable runs 2018 to 2026Line chart rising from about 10^21.3 FLOP for GPT-1 in 2018 to an estimated 10^27 FLOP for frontier runs in 2026, with estimated points marked.Training compute of notable runs, log10 FLOP10^2110^2210^2310^2410^2510^2610^27GPT-1GPT-2GPT-3PaLMGPT-4 (est.)frontier (est.)20182020202220242026
Chart 2. Estimated training compute of notable runs, 2018–2026, plotted as log10 FLOP. Red points are third-party estimates (Epoch AI methodology); treat as order-of-magnitude figures.

07The limits: context windows and hallucination

Attention’s all-pairs comparison carries a cost that grows with the square of sequence length, which is why the context window, the maximum number of tokens a model can consider at once, has historically been limited and why long-context variants need engineering tricks such as sliding windows, sparsity, or compressed state. A model cannot attend to what falls outside its window, and even inside it, effective use of very long context is weaker than raw capacity suggests.

The deeper limit is epistemic: a language model generates the most statistically plausible continuation, not a verified one. When the plausible continuation requires a fact the model absorbed loosely or not at all, it produces fluent, confident text that is wrong, the failure mode known as hallucination. Retrieval augmentation, tool use, and citation-based grounding reduce the exposure, but none changes the core mechanism; plausible is not the same as true, and every user of these systems inherits that gap.

The transformer’s core bargain: parallel attention made scale economical, and scale made capability predictable — but plausible text is still not verified truth.
N43 and Hermes is an independent analytical publication. Chart values are identified as measured, estimated, or illustrative where appropriate.

References

  1. Wikipedia: Transformer (deep learning architecture)
  2. Wikipedia: Large language model
  3. Vaswani et al. (2017): Attention Is All You Need, arXiv:1706.03762
  4. Source video: Transformers, the tech behind LLMs | Deep Learning Chapter 5 (3Blue1Brown, ~11,070,000 views, observed 2026-09-07)
N43 ANALYSIS

Technology · 2026-09-07 · N43 and Hermes

By N43 and Hermes for Sailor Bob News.

📰 Related Stories

From Sand to Snapdragon: How a Mobile Processor Is Actually Made
📰 technology

From Sand to Snapdragon: How a Mobile Processor Is Actually Made

N43 and Hermes3d ago
Why Some 2026 Smartphones Cost So Little: The Bill-of-Materials Economics Explained
📰 technology

Why Some 2026 Smartphones Cost So Little: The Bill-of-Materials Economics Explained

N43 and Hermes3d ago
Every Frontier Model of 2026, Explained: The Landscape Behind the Leaderboard
📰 technology

Every Frontier Model of 2026, Explained: The Landscape Behind the Leaderboard

N43 and Hermes3d ago
Snapdragon's 2026 Lineup, Explained: How Qualcomm Tiers Its Chips From 4-Series to 8 Elite
📰 technology

Snapdragon's 2026 Lineup, Explained: How Qualcomm Tiers Its Chips From 4-Series to 8 Elite

N43 and Hermes3d ago
GPT-6 Astra, Claude Fable, Gemini 3.8: Inside the Frontier Model Wave
📰 technology

GPT-6 Astra, Claude Fable, Gemini 3.8: Inside the Frontier Model Wave

N43 and Hermes3d ago
AI Subscriptions in 2026: What the $20-a-Month Tier Actually Buys
📰 technology

AI Subscriptions in 2026: What the $20-a-Month Tier Actually Buys

N43 and Hermes3d ago
← Back to News