Notes

T5

Most models need a new output head for every job — a classifier here, a span predictor there. T5 throws all of that away by making one assumption: whatever the task, the input is text and the output is text.

One interface, one loss
T5 — the Text-to-Text Transfer Transformer, from Raffel and colleagues at Google — is a standard encoder-decoder transformer trained to read a string and write a string. A short prefix tells it which task it is doing: translate English to German:, summarize:, or cola sentence: for a grammaticality judgement whose answer is the literal word acceptable. Pre-training uses span corruption: random spans of the input are replaced by numbered sentinel tokens and the decoder learns to reproduce the missing stretches — a denoising objective run over C4, the cleaned Common Crawl dump released alongside the model.

Why it matters
The unified format is what makes multi-task pre-training and fine-tuning practical: one checkpoint, one loss function, and tasks that share capacity instead of competing heads. The paper is as valuable as the model — a controlled sweep over objectives, corpora, architectures and scales that settled several open arguments at once. In practice you meet T5 through Hugging Face as t5-base, or through its descendants mT5 and Flan-T5, usually for summarisation or translation, where having a real decoder beats coaxing text out of an encoder. The format has a sharp edge: the prefix is not decoration. Fine-tune with a wording the model never saw in pre-training and you lose the transfer you chose the architecture for, and anything numeric has to survive the round trip through characters.

T5 (Text-to-Text Transfer Transformer) is an encoder-decoder transformer that casts every task as mapping an input string to an output string, with a task prefix such as summarize: selecting the behaviour. It is pre-trained on the C4 corpus with a span-corruption denoising objective, then fine-tuned without task-specific output heads. The uniform format lets one checkpoint and one loss serve classification, question answering, translation and summarisation alike.

Think of an assistant who only accepts written notes and only ever replies in writing. A translation, a summary, a verdict on whether a sentence sounds right — every request arrives the same way, and every answer comes back the same way.

T5 is a language system built on exactly that idea. Rather than having a separate mode for each job, it treats everything as turning one piece of text into another. You put a short instruction at the front — “summarize:” or “translate English to German:” — and the rest is simply text in, text out. That one habit means a single trained system can be nudged into dozens of different jobs, rather than a new system being built for each.