How the Transformer block changed: 12 milestones, 2017–2026 #History#Attention#MoE
Watch the Transformer block get rebuilt step by step since 2017: attention, KV cache and feed-forward changes by date, with use cases and what each means for transaction models.
Transformer foundationsEncoder architectureSequence attention
Since 2017 the Transformer block has kept its shape but almost every step has been rebuilt. Each change targets one of seven steps — 1 LayerNorm, 2 QKV projection, 3 Scores + softmax, 4 Weighted sum O = AV, 5 Output projection + residual, 6 LayerNorm, 7 Feed-forward network (FFN) — and most go after the cost that grows with sequence length.
The three phases
- Attention computation (steps 3, 4): Every token compares itself with every other token, so compute and memory grow with n squared; long histories become slow and expensive. From dense softmax to linear/recurrent attention, then learned sparse selection (blocks or top-k tokens), and hybrids that keep a few full-attention layers. For TFMs: Card and account histories can run to thousands of events; sub-quadratic attention lets a TFM read the full history inside a fraud-scoring latency budget.
- KV cache & projection (steps 2): At inference every past token's keys and values are cached; at long context this cache, not the weights, fills GPU memory and caps batch size. Shrink what is cached: shared or low-rank latent KV (MLA), then compressing many tokens into one entry (CSA/HCA), then sharing KV across layers (CSA2). For TFMs: A smaller per-customer cache means more live sessions per GPU and cheaper incremental scoring when a new transaction arrives for an existing card.
- FFN & overall structure (steps 7): The FFN holds most parameters and FLOPs (~16nd^2); scaling knowledge by widening it makes every token pay for every parameter. Conditional compute (Mixture-of-Experts), reusing weights across depth (looping), and splitting the stack so cheap layers handle input and costly ones generation. For TFMs: MoE can host many merchant/region/task specialists cheaply; structural splits favour encode-once, score-many patterns common in transaction pipelines.
Every change, by date (each links to its paper or release)
| When | Technique | Who | Changes | Used for |
|---|---|---|---|---|
| 2017-01 | Sparsely-gated Mixture-of-Experts | Google Brain | step 7 | DeepSeek, Mixtral, Qwen MoE LLMs; Multilingual / multi-domain models |
| 2018-07 | Universal Transformers (weight-shared loop) | Google Brain + DeepMind | step 1, step 2, step 3, step 4, step 5, step 6, step 7 | Algorithmic / reasoning tasks; Parameter-constrained models |
| 2025-10 | Ouro looped language models | ByteDance Seed (with academic collaborators) | step 1, step 2, step 3, step 4, step 5, step 6, step 7 | Small reasoning models; Edge deployment |
| 2020-06 | Linear attention | Idiap Research Institute / EPFL (with University of Washington) | step 3, step 4 | Streaming generation; Very long sequences |
| 2024-12 | Gated DeltaNet | NVIDIA (with MIT) | step 3, step 4 | Hybrid LLMs (e.g. Qwen3-Next, Kimi Linear); Long-context recall |
| 2025-02 | MoBA (Mixture of Block Attention) | Moonshot AI (with Tsinghua, Zhejiang University) | step 3, step 4 | Long-context chat (Kimi); Document QA |
| 2025-02 | NSA (Native Sparse Attention) | DeepSeek-AI (with Peking University, University of Washington) | step 3, step 4 | Long-context pretraining; Reasoning with long chains |
| 2025-09 | DSA (DeepSeek Sparse Attention) | DeepSeek-AI | step 3, step 4 | DeepSeek-V3.2 serving; Long-context API cost cuts |
| 2025-10 | KDA (Kimi Delta Attention) / Kimi Linear | Moonshot AI | step 3, step 4 | 1M-token decoding; RL with long rollouts |
| 2026-06 | MSA (MiniMax Sparse Attention) | MiniMax | step 3, step 4 | MiniMax-M3 1M context; Coding agents |
| 2024-05 | MLA (Multi-head Latent Attention) | DeepSeek-AI | step 2 | DeepSeek V2/V3, Kimi K2; High-batch serving |
| 2026-04 | CSA + HCA (Compressed Sparse / Heavily Compressed Attention) | DeepSeek-AI | step 2, step 3, step 4 | DeepSeek-V4 Pro/Flash; 1M-context agents |
| 2026-09 | CSA2 (cross-layer shared KV) | DeepSeek-AI | step 2, step 3, step 4 | DeepSeek-V4.1-Flash; Input-heavy agents |
| 2026-09 | CED (Causal Encoder-Decoder) | DeepSeek-AI | step 2, step 7 | Agent workloads with long inputs; RAG and long-document reading |
| 2024-05 | YOCO (You Only Cache Once) | Microsoft Research & Tsinghua University | step 2, step 7 | Long-context LMs; Prefill-heavy serving |
| 2022-05 | FlashAttention | Stanford University (with University at Buffalo) | step 3, step 4 | Default in PyTorch SDPA, vLLM; Training long-context models |
| 2020-04 | Sliding-window attention | Allen Institute for AI | step 3, step 4 | Longformer, Mistral 7B; Local layers in hybrid models |
| 2021-04 | RoPE (Rotary Position Embedding) | Zhuiyi Technology | step 2, step 3 | Llama, Qwen, DeepSeek; Long-context extension |
| 2020-02 | SwiGLU FFN | step 7 | Llama, PaLM, DeepSeek FFNs; MoE experts |
Where TFM-100M sits: sliding-window attention with RoPE (steps 2–4), RMSNorm (steps 1, 6) and a SwiGLU feed-forward (step 7).
Transcript
Payments borrowed ChatGPT's engine, but not its newest parts. Why? That engine is the Transformer. Each dot above is one upgrade to it, placed at the year its paper came out. Thirty-one upgrades came before ChatGPT. Thirty-one came after. Below, in gold: payment models built on the same engine, by card networks, banks and fintechs. Between the lanes runs one question: which ideas crossed from the top to the bottom, and when? By the end, you'll know how ChatGPT's Transformer changed since 2017: what each era added, how it works, and what payments took. The short history told this story in one sweep. Here it is again, era by era, with payments in each.
Before 2017, a machine read a sentence the way a relay team runs a race: one leg at a time. Translation, speech and text all ran on relays like this for years. Two problems held them back.
This is a recurrent network. It reads one word, updates a note, and hands that note to the next word.
Each word adds its own mark to the note, and the note is all the next word gets. The note is a short list of numbers, the same size whatever the sentence. Everything read so far must fit in it. Problem one: each step must wait for the one before. The work can't be spread across a chip at once, so training is slow.
Problem two: by the end of a long sentence, the first words have faded from the note. Translate a long sentence, and its opening has blurred by the time the last word arrives.
In 2014, Bahdanau, Cho and Bengio let a translator look back at every word while it wrote. It translated better. But the relay still ran underneath, and still made every step wait.
Card histories were read the same way: one payment at a time, the note carried along the card. In IBM's 2020 card-fraud tests, a relay network was still the baseline to beat. And a pattern from weeks ago could fade from the card's note, just as the first words faded from the sentence.
June 2017. Vaswani and colleagues at Google publish a translation paper: Attention Is All You Need. Their move was bold: drop the relay entirely, and keep only the looking back. They called the result the Transformer.
That looking back is attention: each word checks every other word at once, and takes in a mix of the ones that matter. Here, bank checks every word in its sentence, and looks hardest at river. So this bank is a riverbank, not a lender. Several of these checks run side by side, each free to look for something different: one for meaning, another for grammar.
No relay means no waiting. Every word is worked on at the same moment, so training runs in parallel, and far faster. The paper reported better scores than the best earlier models on two translation tests, at a fraction of the training cost. One rule kept the writing honest: a word being written may look only at words already written, never ahead. Attention, then a small network on each word, repeated layer after layer: that block is still the heart of ChatGPT.
Now a card. A new payment arrives beneath the payments that came before it.
Like a spotlight, it checks every earlier payment at once. Each glows by how well it matches.
The best matches send back what they know, and the new payment adds that to what it already was. And the never-look-ahead rule is exactly what live scoring needs: when a payment is scored, its future hasn't happened yet.
2018. Two teams each kept one half of the Transformer, and found a way to learn without labels.
OpenAI's GPT reads left to right and guesses the next word. Google's BERT hides words and guesses them from both sides. Both use the same trick, called pre-training: hide part of plain text, guess it, and learn from the miss. Nobody labels anything; the text is its own answer key. Then one trained model is tuned for each task. Learn once, reuse everywhere. That recipe is what makes a model a foundation model. GPT's next-word guessing is the line that leads to ChatGPT. BERT's blanks were helping Google Search about a year later.
Payments need this even more. Fraud labels are rare, and they often arrive long after the payment.
So hide the card's next payment, and let the model guess it: the merchant, the amount, the time.
Then the real payment is revealed, and the miss is measured.
Each miss nudges the model's numbers. Round after round, the misses shrink, with no label anywhere. IBM's 2020 model hid 15% of each payment's fields, the BERT way. Featurespace, in 2024, guessed the next event, the GPT way. Either way, every payment becomes a lesson, whether or not anyone ever labels it.
2019. OpenAI made a bet: the same block, much bigger. GPT-2 that year, GPT-3 the next. Deep stacks are hard to train, so a small fix spread: a level check before each step, keeping the signals in range. Most later open models copied that fix. It's still there, before each step of the block. Think of a sound engineer setting the level before each microphone, not after the speakers have already distorted.
Size is counted in parameters: the model's learnt numbers. GPT-2 had one and a half billion. GPT-3 had a hundred and seventy-five billion: over a hundred times more, the year after. Size bought something new. GPT-3 could take on a task it was never tuned for, from a few examples in the prompt. Bigger models also need more text. In 2022, DeepMind showed that size and data should grow together. Now the grain: a payments model, about one point three million parameters, over a hundred thousand times smaller than GPT-3. Small on purpose. Visa reports its model beat Llama 2 on merchant category prediction with 92% fewer parameters. And it answered in 0.27 milliseconds, against 84.9 for the language model. A card payment is scored while the customer waits at the till. Here, speed counts for more than size.
Late 2020. Google shows the Transformer can read a picture, cut into small square patches. The lesson: anything cut into pieces is a sequence. Each piece is a token: one unit the model reads. Words, patches of a photo, notes in a song. If it comes in pieces, a Transformer can read it.
So what are the pieces of a payment?
Its fields: the merchant, the amount, the time, the place, the device.
Each field becomes a token, chosen from that field's own small set of shapes. A merchant is one token, an amount band is another. A language model has one vocabulary; a payment has one per field.
IBM's 2020 TabFormer read cards in two levels: attention across a payment's fields, then across the card's payments. Fields within a payment, then payments along a card. Visa's 2023 FATA-Trans kept that two-level shape.
Attention checks every word at once. So how does it know their order? In 2017, each position got its own wave pattern, added in. In 2021, Su and colleagues made position a rotation: RoPE.
RoPE turns each word like a clock hand, by its place in the line. Each word has many hands, turning at different speeds, so both near and far neighbours can be told apart. Two words then compare by how far apart their hands point, not by where they sit. Order, without fixed slots. A rotation can also be squeezed. In 2023, that let a trained model read longer text than in training, with a little extra tuning.
But words come evenly spaced. Payments don't: two in a minute, then nothing for days. So Revolut's 2026 model, PRAGMA, keeps RoPE for order, and adds the seconds since the last payment as time.
November 30th, 2022. OpenAI launches ChatGPT. Half the upgrades on this ruler were already out. Inside was a GPT-3.5 model: the same kind of block as 2017, stacked layer after layer. So the engine was barely new. The surprise came from how it was taught.
What was new was the training. People ranked its answers, and it learned toward the ones they preferred. That's RLHF: reinforcement learning from human feedback. It turned a text predictor into an assistant anyone could talk to. A model that only guessed the next word now answered the question you actually asked. Payments have no chat window. What crossed over was the recipe, and the momentum behind it.
Now every answer cost money, because it is written one token at a time. To write the next token, the model needs what it worked out for every token before it.
So it keeps notes on every past token, instead of working them out again. That's the KV cache. The notes grow with every token and every layer. These bars are the caches of real models, side by side. The bigger the notes, the fewer conversations one chip can hold at once, and the higher the bill. In 2023, grouped-query attention let several of attention's readers share one set of notes, and the bars shrank.
A year earlier, FlashAttention had made attention itself faster, by working in small tiles inside the chip's fastest memory. Same answer, exactly. It just moves far less data back and forth. Nubank's 2025 model credits FlashAttention for letting it train on long card histories on a single GPU.
Payments face the same bill. A bank scores one new payment at a time, and could keep notes for every card it serves.
December 2023. Mistral's Mixtral brings an older idea into open models: a mixture of experts. The idea dates from 2017, from Shazeer and colleagues at Google. It took almost seven years to go mainstream.
Instead of one big network inside each block, there are many small specialists, with a router in front.
For each token, the router wakes just two of them. Mixtral keeps eight experts in each layer, and sends every token to two.
All of them are kept, and each takes its share of the work. But every token pays for only two. Nobody assigns the specialities by hand. The router learns, in training, which experts suit which tokens. So the model holds far more learnt numbers, for about the same work per token. DeepSeek pushed it further in 2024. Think of a hospital: many specialists on staff, but each patient sees only the two they need.
In payments, experts could specialise: one for groceries, one for travel, one for fuel. Whether a payments model has enough data to feed them is a question for a later episode.
Then the race moved to length: whole books, codebases, long chains of reasoning. By 2026, a million tokens. In 2026, DeepSeek reached a million tokens by squeezing the notes before attention reads them. Two plain ideas sit underneath.
Here's a long text as a tape of light. Checking every token against every other would cost far too much.
Idea one: a running memory. A small summary glides along the tape, updated at each step, and never grows. It's the relay's note, back again, but now trained to choose what to keep and what to forget.
Idea two: look back in full, but only at a few chosen blocks. The rest stay dark. Which blocks to choose is learnt in training, like a reader who knows which chapter to flip back to.
Several of today's long-text models mix both: most layers carry a memory, a few look back in full.
For a card, a running memory could be updated with each new payment, in one small step. Picking the past payments that matter could work the same way: the last visit to this merchant, not every coffee. But the payments model we sized earlier reads its card's last 128 payments, not a million tokens.
Now the payments lane, in full: fourteen sources, from 2020 to this year. Two research papers came first, in 2020. The launches came after ChatGPT. The first launch came from Featurespace, 328 days after ChatGPT. Featurespace described it as self-supervised and pre-trained: the 2018 recipe, applied to payments. Visa's research teams published three of these papers. Revolut's PRAGMA serves six different tasks from one model. That's a transaction foundation model: one model learnt from payments, reused by many products. A fraud specialist, a card network and a bank: three different builders, one shared engine.
Now the threads: each a payments source's own words, naming the idea it borrowed. In these fourteen payments sources, every borrowed idea came from before ChatGPT. Ten threads, from five ideas: the Transformer itself five times, hide-and-guess twice, next-word guessing, RoPE and FlashAttention once each. And each idea took between two and five and a half years to cross into payments. Hide-and-guess crossed fastest, about two years from BERT to IBM. Next-word guessing took longest, about five and a half. Why not the newest? Partly time: they've had the least of it. An idea from last year hasn't had two years yet. Partly fit, where the papers say so. Revolut chose BERT's design because its goal is representations for financial tasks, not open-ended text. Visa's case, as we saw, was speed.
So: one 2017 translation paper, rebuilt again and again for longer text and cheaper answers, borrowed piece by piece for a card's next payment. Thirty-one upgrades before ChatGPT, thirty-one after. In these sources, payments drew on the first half. If someone pitches a ChatGPT for payments, ask which era it borrows from, and why that one. The best answer names the problem the idea solves, and shows that payments have that problem too. So which of these upgrades should a transaction foundation model use, and why? That's the next episode.
Sources
- Attention Is All You Need — Vaswani, Shazeer, Parmar, Uszkoreit, Jones, Gomez, Kaiser, Polosukhin, NeurIPS 2017
- GLU Variants Improve Transformer — Noam Shazeer, arXiv, 2020
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention — Idiap Research Institute / EPFL (with University of Washington), 2020
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer — Google Brain, 2017
- Universal Transformers — Google Brain + DeepMind, 2018
- DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model — DeepSeek-AI, 2024
- Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention — DeepSeek-AI (with Peking University, University of Washington), 2025
- MoBA: Mixture of Block Attention for Long-Context LLMs — Moonshot AI (with Tsinghua, Zhejiang University), 2025
- DeepSeek-V3.2-Exp release (tech report DeepSeek_V3_2.pdf on GitHub deepseek-ai/DeepSeek-V3.2-Exp) — DeepSeek-AI, 2025
- Kimi Linear: An Expressive, Efficient Attention Architecture — Moonshot AI, 2025
- DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence — DeepSeek-AI, 2026
- MiniMax Sparse Attention — MiniMax, 2026
- DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression — DeepSeek-AI, 2026