In one line: Casts every NLP task as text in, text out so that objective, architecture, corpus, fine-tuning scheme and multi-task mixing become swappable ablations of one fixed pipeline: encoder-decoder plus span corruption wins, denoising beats language modelling while the denoising variants barely differ, unfiltered Common Crawl is worst on six of seven benchmarks (level with Wikipedia on SuperGLUE) despite being 8x larger, and multi-task pretraining then fine-tuning matches plain pretraining; scaled to 11B on 1T tokens of the new C4 corpus for 90.3 GLUE and 88.9 SuperGLUE against a human 89.8, though translation stayed out of reach on English-only pretraining.
How far to trust it: Believe the big gaps (denoising over language modelling, an encoder-decoder over a causal LM, cleaned over unfiltered web text, pretraining over multi-task training alone): they are 8 to 42 standard deviations of the paper’s own run-to-run noise. Read its many “no difference” findings as “none detectable with one run each at 220M”, not as proof of equality. The evidence, point by point.
The idea in one sentence: write every NLP task as text in, text out, so that one encoder-decoder with one loss and one decoding procedure turns objective, architecture, corpus, fine-tuning and scale into knobs moved one at a time against a fixed baseline; the winners (span corruption, an encoder-decoder, the cleaned C4 corpus), scaled to 11B, reached the state of the art on 18 of 24 tasks.
You need: the encoder-decoder Transformer with cross-attention (Attention Is All You Need; the decoder block itself on The transformer from zero), and what masked and causal objectives are (Families and objectives). New terms:
By 2019 pretrain-then-fine-tune clearly worked, but the field had fragmented into variations nobody could compare. Papers differed at once in pretraining objective (BERT's masked language modelling, GPT's left-to-right language modelling, XLNet's permutation objective), architecture (encoder-only, decoder-only, prefix LM), corpus (Wikipedia plus BooksCorpus, WebText, CC-News), fine-tuning scheme and evaluation protocol, so no gain could be attributed to any one axis (§1).
The goal is explicitly not a new method ("our goal is not to propose new methods but instead to provide a comprehensive perspective on where the field stands", §1): make every one of those choices a swappable component of one fixed pipeline, move one at a time against a fixed baseline, and run the grid at a scale where the answers mean something.
The authors call it "coordinate ascent" and name its weakness: it can miss interactions, such as an objective that only wins on a bigger model (§3). A secondary problem fixed along the way: there was no standard large clean pretraining corpus, because data sets usually came out as a side effect of a model release and often were never published (§3.4). The answer is C4.
Every task feeds the model text and trains it to produce text, with plain maximum likelihood (teacher forcing, cross-entropy) and greedy decoding (§2.4, §3.1.2). A short task prefix selects the task: translate English to German: That is good. produces Das ist gut. Classification emits the label as a word, so MNLI outputs the literal string entailment; an output matching no label counts as wrong, which "we never observed". Prefix wording mattered little and was not studied.
STS-B, a regression task scoring similarity from 1 to 5, is rounded to the nearest 0.2 and written as a string ("2.57" becomes "2.6"), which "effectively recasts the STS-B regression problem as a 21-class classification problem". Try it:
The Winograd tasks (WNLI, WSC, DPR) mark the ambiguous pronoun with asterisks and the model generates the noun phrase it refers to: "The city councilmen refused the demonstrators a permit because *they* feared violence." becomes "The city councilmen". WNLI overlaps WSC's training set, so it is never trained on and is left out of validation GLUE averages (§2.4, Appendix B).
The payoff: one model, one loss, one decoding procedure and one hyperparameter set cover translation, summarisation, question answering and classification, which is the only reason the ablations that follow are comparable.
A standard encoder-decoder Transformer, encoder and decoder each sized like BERT-Base: 12 blocks, dmodel 768, dff 3072 (ReLU), 12 heads, dropout 0.1. "About 220 million parameters", roughly twice BERT-Base because there are two stacks; the configuration counts to 222.9 million, exactly the released checkpoint (recount). Three departures from Vaswani et al. 2017 outlived the paper (§2.1):
Computed with T5's own bucketing function (Hugging Face's _relative_position_bucket, from Mesh TensorFlow; in src/inputs/t5_code_extracts.py). The bidirectional encoder splits the 32 into 16 per direction (offsets 0 to 7 exact, then wider bins); the decoder looks back only and spends all 32 on the past.
Budget (§3.1.2): pretraining is 219 steps of 128 sequences of 512 tokens packed to about 216 tokens, so 235 ≈ 34B tokens with no repeats: about a quarter of BERT's 137B and a sixty-fourth of RoBERTa's 2.2T (137B / 235 = 4.0, 2.2T / 235 = 64.0), so dozens of variants are affordable.
Adafactor (Adam's second-moment matrix factorised into row and column vectors, to save memory) (§3.1.2, §3.1.3). The learning rate is 1/√max(n, 104): 0.01 for 104 steps, then an inverse square root decay (which the paper calls "exponential"). Fine-tuning is 218 steps per task at a constant 0.001, best validation checkpoint (every 5,000 steps). SentencePiece, 32,000 wordpieces shared by input and output, trained on English C4 mixed 10:1:1:1 with German, French and Romanian so translation targets are representable at all.
Noise floor (§3.1.5, Table 1): the baseline was trained 10 times; its spread (GLUE standard deviation 0.235, SuperGLUE 0.416, but 3.2 on CB's F1, whose validation set has 56 examples) is assumed for every variant, and every table bolds scores within two standard deviations of the best. Without pretraining the model scores 66.22 GLUE and 53.04 SuperGLUE against 83.28 and 71.36; only English to French, a big data set, barely moves.
Sample 15% of tokens; replace each consecutive run of corrupted tokens with one sentinel unique within the example; make the target only the dropped spans, each after its sentinel, closed by a final sentinel. Unlike BERT-style masking the target is the missing text, not the whole sequence, so decoder sequences stay short, a choice made "to reduce the computational cost of pre-training".
The baseline decides token by token, so spans happen by chance; the final recipe corrupts contiguous spans of mean length 3, which shortens sequences further (§3.3.4). Span corruption is now one of the standard objectives, compared with the others on Families and objectives; here is only what this paper built and measured.
Steps 1 to 4 use the paper's own corrupted examples: BERT-style from Table 3 (with "apple" as the random replacement), the i.i.d. baseline from Figure 2, random spans from Table 3 (an illustrative mask, heavier than 15%). Step 6 is to scale at 512 tokens of original text, with the expected lengths computed from the corruption rules (the lengths chart in Objectives). Scores are SuperGLUE from Tables 4, 5 and 7.
Every objective here is T5's own preprocessing (random_spans_noise_mask, noise_span_to_unique_sentinel, random_spans_helper, i.i.d. noise, BERT-style) ported line by line from t5/data/preprocessors.py (code; the excerpts are in src/inputs/t5_code_extracts.py) and checked against it by src/check_core.mjs.
Try: pick an objective and press Resample a few times: with i.i.d. noise the number of corrupted words changes from draw to draw, while random spans always corrupt exactly round(n × rate) words in exactly round(that / mean span) spans, because the T5 code fixes both counts and only shuffles where the boundaries fall. Raise the rate to 50% and watch the target catch up with the input.
The variants differ mainly in their attention masks (Figure 3): fully visible (every position sees the whole input) or causal (position i sees only up to i). An encoder-decoder has a fully visible encoder, a causal decoder and cross-attention; a language model is one causal stack over input and target concatenated; a prefix LM is that stack made fully visible over the input, "similar to an encoder-decoder model with parameters shared across the encoder and decoder" (§3.2.1).
Making them comparable (§3.2.2): an L + L encoder-decoder has the parameters of a 2L-layer language model but the cost of an L-layer one, since each of its stacks sees only half the sequence (step times matched). Cross-attention is set aside as "about 10%" of the parameters (12.7% at the baseline size, recount). Five structures: encoder-decoder (2P, M), the same with shared parameters (P, M), half depth (P, M/2), language model (P, M) and prefix LM (P, M), each with the denoising and a language-modelling objective.
The paper's example: 7 input words, 3 target words. Each plate on the floor is that structure's attention mask (row: the position attending; column: the position it reads), coloured by whose weights do it; each slab is one block. P is one BERT-Base-sized stack, M the FLOPs of the L + L encoder-decoder per example (§3.2.2). Masks in general, and the encoder-decoder's read-once cache, are drawn on Families and objectives (its Figs. 2 and 5).
From Table 2. Sharing the weights costs almost nothing (82.81) while halving the parameters; halving the depth hurts (80.88); the prefix LM lands below the shared encoder-decoder (81.82), "suggesting that the addition of an explicit encoder-decoder attention is beneficial"; the causal language model is far behind (74.70 GLUE, 61.14 SQuAD). Denoising beat language modelling for every architecture.
So the encoder-decoder with denoising wins on every task, at matched compute and twice the parameters. Why it matters says why the field went decoder-only anyway.
A funnel (Figure 5), each step in the grid:
The authors' conclusion (§3.3.5): choose among denoising variants on cost, not quality, and further tinkering here is unlikely to pay. That cost is mostly the target length: per 512 tokens of text, 512 for BERT-style, about 144 for the i.i.d. baseline, exactly 104 for spans of mean 3 (computed by the chart beside this text). The same gap-is-noise reading of objectives, and what decoder-only models train on instead, is on Pretraining.
The decoder's target length is that cost's clearest part (the decoder runs over the target, and its self-attention grows with the target's square). The chart puts every objective row of Tables 4 to 7 at its target length per 512 tokens of original text, against its measured score; the grey band is two baseline standard deviations below the best, the paper's own "no real difference" zone.
Target lengths are computed, not published: full reconstruction (BERT-style, MASS-style, deshuffling) is all 512; prefix LM about 256 (a uniform random split); i.i.d. noise at rate p is np corrupted tokens plus one sentinel per clean run, np + (1 − p) + (n − 1)p(1 − p) + 1 on average (dropping tokens: np + 1); random spans are round(np) + round(round(np) / span) + 1 exactly. Counting EOS as the T5 code does. Check against the T5 code:
C4 is about 750 GB of English (745 GB in Table 8) from one month of Common Crawl (April 2019), cleaned with blunt heuristics (§2.2): keep only lines ending in terminal punctuation and with at least 5 words; drop pages with fewer than 3 sentences; drop pages with a word from the "List of Dirty, Naughty, Obscene or Otherwise Bad Words", with "lorem ipsum", or with a curly bracket (a cheap code detector); drop lines mentioning Javascript or policy boilerplate ("terms of use", "cookie policy" and similar); strip Wikipedia citation markers; keep one copy of any repeated three-sentence span; keep pages langdetect calls English with probability at least 0.99. These rules run on real Common Crawl text, beside Gopher's and FineWeb's, on Extraction and filtering.
From Table 8: unfiltered C4 is worst on every task, the paper's cleanest data lesson (the baseline only sees 34B tokens, so the extra volume is never used). In-domain corpora win where domains match: Wikipedia plus Toronto Books lifts SuperGLUE to 73.24 almost entirely through MultiRC (exact match 25.78 to 50.93), whose largest source is fiction; RealNews-like lifts ReCoRD; Wikipedia helps SQuAD. "Unsurprising but also unsatisfying" for one general model, and such sets are small: WebText-like is about 40× smaller than C4.
Repetition (Table 9): truncating C4 and looping it for the same 235 tokens, 64 repeats is harmless, 1,024 repeats costs 3.7 GLUE points and 4.6 on SQuAD, and training loss falls as the set shrinks (Figure 6), the memorisation signature. Unlabelled data is cheap, so use a large set. How much repetition is safe at today's scale (about four epochs) is on Data mixing.
Fine-tuning (Table 10): updating all parameters wins. Adapter layers (dense-ReLU-dense blocks after each feed-forward network, only they and the layer norms trained) work only with an inner size scaled to the task; gradual unfreezing costs a little accuracy and buys some speed. The main-text Table 10 has a misprint (checks).
Multi-task learning (§3.5.2): with no task-specific heads it is just mixing data sets, C4 included. Examples-proportional mixing samples task m with rm = min(em, K) / Σ min(en, K), the cap K stopping C4 and WMT English to French from crowding out everything; temperature-scaled mixing raises each rate to 1/T and renormalises; equal mixing samples every task alike. Runs last 219 + 218 steps.
Multi-task training alone loses to pretrain-then-fine-tune; equal mixing is a disaster (76.13 GLUE); examples-proportional mixing has a sweet spot in K; T = 2 is a reasonable single knob (temperature mixing as later multilingual models used it is on Data mixing). But multi-task pretraining then per-task fine-tuning matches plain pretraining (83.11 against 83.28, Table 12), and leaving a task out of the pretraining mix barely hurts it afterwards, so task interference is mild.
The rule is the paper's; the sizes are TensorFlow Datasets training-split counts for the sets it names (it used TFDS, §2.3; WSC plus DPR approximate). Passes assume one example per sequence, 128 per batch, 786,432 steps; packing raises them, so they are illustrative. Scores are the measured Table 11 row.
"You were just given 4× more compute. How should you use it?" (§3.6): 4× steps, a 4× batch, a 2× model (BERT-Large-shaped) for 2× steps, a 4× model for the baseline's steps, or an ensemble of 4 separately trained models.
From Table 13. Everything helps; size gives a slightly bigger bump than time alone; 2× size for 2× steps is indistinguishable from 4× size; 4× steps and a 4× batch tie. Ensembling four models is an orthogonal win that beats every single-model route on summarisation and translation, though not on SuperGLUE. A bigger model also makes every fine-tune and inference dearer.
The question is answered as a fitted law, size against tokens for a fixed budget, on Pretraining (scaling laws) and the Chinchilla page.
Everything combined (§3.7): span corruption at mean length 3; C4; multi-task pretraining (C4 given an artificial size from 710,000 examples for Small to 133,000,000 for 11B) then per-task fine-tuning (GLUE and SuperGLUE task by task, batch 8); 1M steps at a batch of 211 sequences of 512 tokens, "about 1 trillion" tokens, "about 32×" the baseline; beam search (width 4, α = 0.6) for translation and summarisation. Five sizes: Small 60M, Base 220M, Large 770M, 3B and 11B. The two largest keep Large's 24 layers and dmodel 1024 and scale dff (16,384 and 65,536) and heads (32 and 128) instead, because TPUs are "most efficient for large dense matrix multiplications".
"About 32×" is exactly 32× if the million steps are 220; 106 would give 30.5×. Large's configuration counts to 737.7M (770.6M only if its tied output layer is counted twice), and 3B to 2.85B (recount).
Was the study worth anything beyond scale? The baseline trained for the same 1T tokens ("baseline-1T") against T5-Base, which differs only in the "non-scaling" changes (Table 15): T5-Base wins on every task.
Gains over the baseline from 1T tokens, then from the non-scaling changes (Table 15, validation). Scale bought more on GLUE, SuperGLUE and EnRo; the changes bought more on CNN/DM, SQuAD, EnDe and EnFr.
The benchmark numbers are the least durable part. What aged well is the ablation grid, a controlled same-pipeline measurement of what each choice is worth, which is why the paper is cited for its negative findings (corruption rate barely matters, denoising variants barely differ, multi-task alone underperforms) as often as for T5. The ablation grid rebuilds all of it.
What holds up. The paper measured its own noise (10 runs of the baseline, Table 1) and changed one thing at a time against a fixed pipeline. The findings the field kept are many standard deviations wide (gap / Table 1's standard deviation): encoder-decoder over a causal LM (83.28 − 74.70) / 0.235 = 36.5 on GLUE (Table 2); BERT-style over deshuffling 41.7 and over prefix language modelling 9.7 (Table 4); C4 over unfiltered 7.7 on GLUE and 8.0 on SuperGLUE (Table 8); pretrain-then-fine-tune over equal mixing 30.4 (Table 11). Later work kept them: span corruption and C4's filters were reused for years, and FineWeb re-ablated each filter on a newer crawl and kept all but one (FineWeb §3.5).
Where to be careful.
Verdict. Trust the direction of the large effects and the C4 recipe. Treat the rankings among near-equal variants (objectives, corruption rates, span lengths, mixing settings) as unresolved, and the leaderboard numbers as a snapshot of October 2019.
C4 became infrastructure. Released with its pipeline (a TensorFlow Datasets build; AllenAI later hosted the files), it pretrained unrelated models such as LLaMA 1 (15% C4, per Dolma), and FineWeb calls it "one of the first large scale LLM training datasets". Its heuristics became the template later corpora argued with: RefinedWeb tabulates them (RefinedWeb), Dolma reuses some, FineWeb kept all but terminal punctuation, which helps most alone but removes around 30% of tokens (FineWeb §3.5). That filtering beats raw volume is now assumed.
Span corruption became the default encoder-decoder objective: kept by mT5 (mT5) and ByT5 (spans of 20 bytes on average, ByT5), and one of UL2's denoisers (UL2). Not LongT5, which the older version of this page listed: it uses PEGASUS-style principle-sentence generation instead (LongT5 §5.3).
Text to text prefigured instruction tuning. Task prefixes are a hard-coded ancestor of the natural-language instruction: FLAN fine-tuned on "tasks described via instructions" (FLAN) and Flan-T5 did it on T5 checkpoints across 1.8K tasks (Flan-T5), the direct line to how models are post-trained today.
The encoder-decoder finding lost, and why. T5 measured it above decoder-only at matched compute; the field went decoder-only regardless, for reasons T5 did not test: in-context learning arrived seven months later with GPT-3, "without any gradient updates or fine-tuning" (GPT-3), rewarding one causal stack; a decoder is simpler to serve (one KV cache, no encoder pass); prompt-and-continue unifies training and inference. Reruns: Ettin (2025) finds encoder-only against decoder-only task-dependent, without testing an encoder-decoder (Ettin); Encoder-Decoder Gemma, adapted from Gemma, is comparable in pretraining and substantially better after fine-tuning at a similar inference budget (arXiv 2504.06225).
Details leaked. Rescale-only norm outside the residual path, the shared relative position bias and Adafactor were popularised here; T5 1.1 then moved to GeGLU, no pretraining dropout, C4 only and untied embeddings (released checkpoints). The SuperGLUE human baseline held until January 2021, when a single 1.5B DeBERTa passed it, 89.9 against 89.8 (DeBERTa).
Connections. Attention Is All You Need: the architecture kept. BERT: the denoising objective is a modified BERT masked LM, and the architecture ablation largely a controlled test of BERT's encoder-only assumption. GPT-3: the opposite fork, seven months later. Switch Transformers: T5-Base and T5-Large with span corruption on C4 as its dense control, 7× faster against them (Switch). Ettin and Encoder-Decoder Gemma: the architecture question rerun. Chinchilla: the size-or-steps question answered with a fitted law. RAG: facts in a swappable index rather than in the weights. Topics: llm-training-and-post-training (objectives, multi-task mixing, transfer), data-curation-and-datasets (C4, filtering, repetition), llms (the encoder-decoder lineage).
The paper's lasting product is this grid: one fixed pipeline, one component moved at a time, every variant scored on the same seven benchmarks (and, in the appendix's Table 16, on every one of 33 task metrics). Here are all of its tables, transcribed from the arXiv HTML with the printed precision, the paper's bold marks recomputed, and its averages and cross-references checked.
Every size counted from its configuration (no biases anywhere; rescale-only norms, two per encoder block and three per decoder block plus one per stack; one embedding matrix shared by input and output; the checkpoints' vocabulary is 32,128 (32,000 wordpieces, 100 sentinels and padding); one 32-bucket relative bias table per stack, one scalar per head), against the printed size and the released checkpoint's own count on Hugging Face.
Every link opens in a new tab. Reading time of the resources below: 4h 17m.
JMLR 21(140), 2020, the paper itself (53 pages: read it as a survey rather than a paper); the HTML version has the anchors this page links to. abstract page, PDF.
(1h 30m)
code and checkpoints (repo, about 20 minutes for the README and entry path); span corruption lives in t5/data/preprocessors.py, ported line by line on this page.
(20 min)
TensorFlow Datasets: the corpus and its variants (en, en.noclean, realnewslike, webtextlike) with their sizes; the build script that regenerates it.
(5 min)
Allen Institute for AI, Hugging Face: the processed C4 hosted as files, which is how most people download it rather than rebuilding it from Common Crawl.
(5 min)
Google AI blog, Feb 2020: the authors' own short framing, the fastest way to get the shape of the paper before committing to it.
(12 min)
Hugging Face: practical: covers the sentinel-token convention (<extra_id_0>, ...) and how to format inputs and targets, which the paper describes but never spells out at code level.
(25 min)
T5 repository: the map of what "T5" means in practice now, including T5 1.1 (GeGLU, no dropout in pretraining, C4 only with no multi-task mixing, untied embedding and classifier) and the LM-adapted variants; almost nobody should start from the original checkpoints.
(10 min)
Xue et al., 2020: the same recipe on 101 languages via mC4, and the direct answer to T5's own weakest result.
(45 min)
Chung et al., 2022: what happened when task prefixes were replaced by natural-language instructions across 1.8K tasks, on T5 checkpoints.
(45 min)
2017: the encoder-decoder T5 keeps, with three changes (rescale-only norm, norm outside the residual path, relative position bias).
2018: T5's denoising objective is a modified BERT masked LM, and the architecture ablation is largely a controlled test of BERT's encoder-only assumption.
2020, seven months later and pointing the other way: in-context learning on a decoder-only stack instead of fine-tuning; the two papers together are the fork in the road.
2021: built directly on this setup, T5-Base and T5-Large on C4 with span corruption as the dense control, and up to 7x faster pretraining against them.
2022: T5's scaling section asks the same question (more compute: size or steps?) informally at a fixed 4x budget; Chinchilla answers it with a fitted law.
2020, contemporaneous: the counterpoint on knowledge, facts in a swappable index rather than in the weights T5 scaled up.
2025: encoder-only against decoder-only with one recipe at matched sizes; finds the split task-dependent.
2025 to 2026: decoder-only Gemma adapted into an encoder-decoder; the closest modern rerun of T5's encoder-decoder against decoder-only result.
2020: loss as a power law in parameters, data and compute; the fitted version of T5's "bigger model or more steps" question.
pretraining objectives, multi-task mixing, transfer learning.
C4, filtering, data repetition.
under Topic: llm-architecture: the encoder-decoder lineage against decoder-only and the other families.
where the frozen T5 encoder lives on, as the text conditioner of Imagen, Stable Diffusion 3 and FLUX.1.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.