TLDRocket
Sign in

The Transformer Family

Lil'Log

Lilian Weng's classic deep-dive walks through how the original Transformer got upgraded for longer memory and less compute waste. It's the paper trail behind why models like GPT and BERT actually work at scale.

Based on reporting by Lil'Log — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Lilian Weng's post is one of those reference pieces that quietly became load-bearing infrastructure for anyone trying to understand how Transformers evolved past the 2017 "Attention Is All You Need" blueprint. It starts where her earlier attention post left off and asks a practical question: how do you take a model that's great at short sequences and make it handle longer context, use less memory, and still train efficiently?

The piece opens with the mechanics everyone glosses over — scaled dot-product attention, the multi-head split-and-concatenate trick, and the encoder-decoder stack with its six identical layers each. It's a good refresher on why positional encoding exists at all: self-attention has no built-in sense of order, so Vaswani's team bolted on sinusoidal encodings, alternating sine and cosine waves across dimensions, to give the model a notion of sequence position. Weng also flags the lesser-known alternative, learned positional embeddings from Gehring's 2017 work, which just lets the model memorize position vectors instead of computing them.

Where the post gets genuinely useful is in the fixes people built on top of vanilla Transformers. Al-Rfou's 2018 character-level model added auxiliary losses so intermediate layers and intermediate positions all had to make correct predictions too, not just the final output — a trick that reportedly beat LSTMs at the time. Then there's Adaptive Computation Time, borrowed from Graves' 2016 recurrent-network work, which lets a model decide dynamically how many computation steps a given input deserves, with a

My take — AI-written commentary, not fact-checked reporting

This kind of survey writing ages weirdly well — Weng's 2019 notes on Transformer-XL and ACT read like archaeology now that everyone's chasing million-token context windows, but the core tension she identifies, more context versus more compute, is exactly the fight still playing out in 2024's model releases. I'll take a good explainer over a flashy benchmark any day; benchmarks get gamed, but a clear explanation of why segment-based attention breaks down doesn't go stale.

Read more about this at: Lil'Log

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.