Core

"Attention Is All You Need" in context

The Transformer replaced recurrent sequence processing with parallel attention — and Qwen3.8-27B shows which parts of that 2017 design survived and which were replaced.

Updated

01 · Concept

Concept

Start with the concrete problem of 2016-era machine translation. To translate a hundred-token sentence, a recurrent network reads token one, updates a hidden state, then reads token two, and so on: one hundred strictly sequential steps. Information from the first token reaches the hundredth only by surviving ninety-nine state updates. Training is slow because no step can start before the previous one finishes, and long-range signal is fragile because it travels through every intermediate step.

The obvious first fix — the one the field actually tried — was to make recurrence stronger: LSTM and GRU gates to protect the state, deeper stacks, bigger hidden vectors. It helped, but it attacked the wrong term. The gates improved what survives each handoff; they did nothing about the number of handoffs. The dependency chain, not the cell design, was the bottleneck. The correction was to remove the chain entirely.

Attention Is All You Need, published in June 2017, proposed an encoder–decoder architecture whose main route between sequence positions used attention rather than recurrence or convolution. Two properties follow, and a small worked example makes both visible. Take a four-token sequence. An RNN needs 3 sequential state updates before the last token is processed, and the path from token 1 to token 4 crosses all 3 of them. Attention instead computes a score for every allowed pair of positions: 4×4=164 \times 4 = 16 scores, all produced together in one matrix multiplication, and the path from token 1 to token 4 is a single direct edge. Scale that to length nn: the sequential depth stays constant while the pairwise work grows as n2n^2. The Transformer traded a sequential bottleneck for a quadratic one — a trade that made sense because accelerators are excellent at large parallel matrix multiplications and terrible at long dependent chains.

The slogan is memorable but easy to overread. A Transformer is not only attention. The original system contained token embeddings, positional encodings, multi-head attention, position-wise feed-forward networks, residual connections, layer normalization, an output projection, softmax, and a training objective. “All you need” meant that attention could replace recurrent and convolutional sequence-mixing layers in that design. It did not mean that embeddings, nonlinear transformations, optimization, or order information disappeared.

The encoder and decoder had different jobs: bidirectional self-attention in the encoder, causal self-attention plus cross-attention in the decoder. Later families kept different subsets — encoder-only BERT, decoder-only GPT, encoder–decoder T5 — and the decoder-only causal stack became the standard shape for large language models. Read any of these as two alternating operations: attention lets positions exchange information, and the feed-forward network transforms each position independently, with residual paths carrying the evolving state through both.

The quadratic cost was the price. For a sequence of length nn, conventional attention forms on the order of n2n^2 pairwise scores per head, and that cost returns with force when context windows reach hundreds of thousands of tokens. Track 7 is largely about paying, dodging, or restructuring this bill.

This course studies one shipped 2026 model against that 2017 baseline, and the comparison is the cleanest summary of what lasted. Qwen3.8-27B keeps the three load-bearing ideas: attention as content-dependent routing, a feed-forward network at every layer, and a pre-norm residual stream running through all 64 layers. It replaces the uniform stack: instead of attention in every layer, it repeats a 3

pattern — three layers of Gated DeltaNet, a gated linear-attention recurrence, followed by one layer of full Gated Attention — sixteen times, for 48 DeltaNet layers and 16 full-attention layers. The recurrence the Transformer famously deleted returns in modernized form for three quarters of the depth, precisely to blunt the quadratic cost, while full attention is retained at intervals for direct content-addressed access to distant positions. Lesson 4.15 covers that mechanism; the rest of this track first builds the classic block the 2017 paper defined, because it remains both the pedagogical baseline and one quarter of the shipped model.

02 · Analogy

Analogy

Imagine translating a speech with a row of editors. An RNN passes one increasingly crowded notebook from editor to editor; the hundredth editor depends on what survived ninety-nine handoffs. A Transformer gives every editor a view of all allowed notes, numbered position cards, and a shared routing rule for choosing relevant passages. No editor is magically omniscient: the routing, numbering, revision desk, and skip lanes must work together.

03 · Teach it back

Teach it back

Explain what the Transformer removed, what it kept, and which of its parts survive unchanged in a 2026 model like Qwen3.8-27B.

Minimum: 80 characters and 15 words. Your writing stays only in this browser.

Waiting for your explanation.

Compare with a model answer

The 2017 Transformer removed recurrence and convolution from the main sequence path, so training positions could be processed in parallel with matrix operations. It kept embeddings, position information, feed-forward networks, residual connections, normalization, and an output projection. In Qwen3.8-27B the attention mechanism, the feed-forward block, and the residual stream survive essentially intact, but the uniform stack of attention layers does not: three of every four layers replace attention with Gated DeltaNet, keeping full attention in only sixteen of sixty-four layers.

04 · Check your understanding

Check your understanding

01What did the 2017 Transformer chiefly remove from its sequence model?
Answer and explanation

Recurrence and convolution — The architecture relied on attention rather than recurrent or convolutional sequence-processing layers, while retaining many other neural-network components.

02Why does an RNN's dependency chain limit training parallelism, a problem attention avoids?
Answer and explanation

Each hidden state must wait for the previous state before it can be computed — The state-to-state recurrence forces sequential computation across positions; an attention layer computes all positions together with batched matrix operations.

03In Qwen3.8-27B, what happened to the uniform attention stack of the original design?
Answer and explanation

Only one layer in four keeps full attention; the other three use Gated DeltaNet — The model interleaves 48 Gated DeltaNet layers with 16 full-attention layers in a repeating 3:1 pattern, while keeping the FFN and residual stream in every layer.

Complete the teach-back and answer the quiz correctly to finish this lesson.

◎ · Evidence marker

Sources

  1. Ashish Vaswani et al. (2017). Attention Is All You Need.
  2. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio (2015). Neural Machine Translation by Jointly Learning to Align and Translate.
  3. Qwen Team (2026). Qwen3.8-27B Model Card.