Paper 19~8 min readGoogle · 2020
Paper Breakdown

T5,
explained.

NLP in 2019 was a zoo — a different model head for classification, another for translation, another for question answering, each with its own quirks. T5 asked a disarmingly simple question: what if every task were just text in, text out? One model, one loss, one format. That reframing, plus a giant clean dataset and a rigorous study of what actually matters, made T5 both a strong model and a map of the whole field.

Video breakdown
The animated walkthrough is in production.
Read the full breakdown below in the meantime ↓
01

The task zoo

Post-BERT, transfer learning had swept NLP: pre-train once, fine-tune per task. But "fine-tune" hid a mess. Classification bolted a softmax head on the [CLS] token. Span-extraction tasks predicted start/end positions. Sequence tagging labeled every token. Translation used a separate encoder-decoder entirely. Each task had its own output layer, its own loss, its own plumbing.

That fragmentation made it hard to compare ideas cleanly — was a gain due to the model, the objective, the data, or the task-specific head? The T5 authors wanted one framework general enough to express every task the same way, so they could study what really drove transfer learning without the confound of a dozen architectures.

02

The big idea: everything is text-to-text

T5's move is to treat every NLP problem as mapping an input string to an output string. No task-specific heads. The label isn't a class id — it's the literal word. Sentiment analysis outputs the text "positive." Translation outputs the translated sentence. Even regression-style tasks output a number rendered as text.

A short task prefix in the input tells the model which job to do. Prepend "translate English to German:" and the same model translates; prepend "summarize:" and it summarizes. One model, one training objective, one decoding process — the task lives in the words, not the architecture.

Text-to-text — the task is a prefix, the answer is text
translate English to German: That is good.
Das ist gut.
cola sentence: The course is jumping well.
not acceptable
summarize: state authorities dispatched…
six people hospitalized…
03

Why one format is such a win

Uniformity buys leverage. Because every task shares the same input/output shape and loss (predict the next token of the target text), a single set of hyperparameters, a single fine-tuning procedure, and a single model can cover them all. You can even train on many tasks at once — multi-task learning — simply by mixing their examples, since they're already the same format.

It also makes the model a clean experimental testbed. Want to know if a different pre-training objective helps? Swap it and re-measure across every task with no architecture changes. That controlled comparability is exactly what the paper was built to exploit.

04

The architecture: full encoder-decoder

Where BERT kept only the Transformer's encoder and GPT kept only the decoder, T5 uses the full encoder-decoder — the original Transformer shape. The encoder reads the input text bidirectionally; the decoder generates the output text one token at a time, attending to the encoder. Because the output is always generated text, this design fits the text-to-text framing naturally.

The paper's careful comparison found that for this unified, generation-based setup, the encoder-decoder generally beat encoder-only or decoder-only alternatives — a reminder that the "best" architecture depends on how you frame the problem, not an absolute ranking.

05

Span corruption and the C4 corpus

T5's pre-training task is span corruption. Take a sentence, drop out random contiguous spans of words, replace each with a unique sentinel token, and train the model to generate the missing spans as its target text. It's masked language modeling reimagined for text-to-text: instead of predicting single hidden tokens in place, the model produces the removed pieces as an output sequence.

Feeding this needs data — enormous, clean data. So the team built C4, the Colossal Clean Crawled Corpus: ~750GB of English web text scraped from Common Crawl and aggressively filtered to strip boilerplate, duplicates, offensive text, and non-English pages. C4 outlived the paper, becoming a standard pre-training corpus across the field.

Worth knowing

The name is literal: T5 = Text-To-Text Transfer Transformer — five T's. The whole thesis is compressed into the acronym.

06

The real contribution: a systematic study

T5 is as much a survey as a model. Using the unified framework as a control, the authors ran a huge, methodical sweep: which architecture, which pre-training objective, which dataset, how much data, which fine-tuning and multi-task strategy, and how it all scales. Because every variant shared the same text-to-text harness, the comparisons were unusually clean.

Question studiedT5's finding (roughly)
Architectureencoder-decoder wins for text-to-text
Objectivespan corruption > token masking here
Databigger, cleaner (C4) helps
Scalebigger models keep improving

The flagship T5 model (11 billion parameters) set state-of-the-art on many benchmarks, but the durable value is the recipe and the ablations — a well-lit map of which knobs matter for transfer learning, backed by a single consistent framework.

07

The limits

Text-to-text is elegant but not free. Emitting labels as text is slower than a classification head reading off one logit, and generation can produce outputs outside the valid label set that you must constrain or post-process. The encoder-decoder also has roughly double the parameters of a decoder-only model at the same depth.

And T5 still fine-tunes per task — it predates the in-context, prompt-only paradigm that GPT-3 popularized the same year. It's the peak of the "pre-train then fine-tune" era rather than a step beyond it, and it inherits that era's hunger for labeled data at fine-tuning time.

08

Why it still matters

The text-to-text idea won. Framing tasks as strings — with an instruction in the input and an answer in the output — is exactly how we prompt modern chat models. When you type "summarize this" or "translate to French" to an assistant, you're using T5's mental model, now scaled up and made zero-shot.

T5's descendants (mT5 for multilingual, Flan-T5 for instruction tuning, and others) remain workhorses for encoder-decoder tasks like summarization and translation. And its greatest gift may be methodological: it showed the value of a unified framework plus rigorous ablation, a template for how to study these systems honestly rather than chase one benchmark.

The line to today

T5 turned "different task, different model" into "different words, same model." Prompting a chat model — instruction in, answer out — is that idea grown up and made instant.

Frequently asked

Quick answers

What is T5?

A 2020 Google model (Text-to-Text Transfer Transformer) that casts every NLP task as text-in, text-out, handled by one encoder-decoder Transformer with a single training objective.

What does text-to-text mean?

Every task maps an input string to an output string — labels are emitted as literal text, so one model and one loss cover classification, translation, summarization, and Q&A.

What is span corruption?

T5's pre-training task: replace random spans with sentinel tokens and train the model to generate the missing spans as text — masked language modeling reframed for text-to-text.

What is C4?

The Colossal Clean Crawled Corpus — ~750GB of filtered English web text from Common Crawl, built for T5 and reused widely as a pre-training dataset.

How is T5 different from BERT and GPT?

BERT is encoder-only (understanding), GPT is decoder-only (generation); T5 uses the full encoder-decoder and frames everything as text generation, so one model does both.

Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer · Raffel, Shazeer, Roberts, Lee, et al. · JMLR 2020 · read the original paper on arXiv → · Vibe Engines · 2026
Finished this one? 0 / 30 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns