Model comparison
This page compares specific configurations (such as ResNet-50 or BERT-base), not general families; each number is tied to the configuration named at the top of its column. “Unspecified” means the number is not documented in the atlas.
| Property | T5 (Text-to-Text Transfer Transformer) | Transformer |
|---|---|---|
| Family | Transformers | Transformers |
| Year of appearance | 2019 | 2017 |
| Researchers | Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang,… | Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,… |
| Architecture type | Encoder–decoder Transformer | Encoder–decoder Transformer |
| Learning mechanism | self-supervised | supervised |
| Compared configuration | T5-base: 12 + 12 layers, d = 768, d_ff = 3072, 12 heads | Transformer (base): N = 6, d_model = 512, h = 8, d_ff = 2048 |
| Input shape | n SentencePiece tokens | n source tokens and n target tokens |
| Output shape | n × 32128 | n × 37000 |
| Depth | 12 encoder layers + 12 decoder layers | 6 encoder layers + 6 decoder layers |
| Parameters (computed) | 222,903,552 ≈222.9M | 63,084,544 ≈63.08M |
| Parameters (published) | 220,000,000 ≈220M | 65,000,000 ≈65M |
| MACs | 29,431,431,168 ≈29.43B For a source and target of length n = 128. | 8,363,966,464 ≈8.36B For a source and target of length n = 128: from torch.utils.flop_counter (including the tied projection to the vocabulary). |
| Complexity | O(L·(n²d + nd²)) for each of the encoder and the decoder. | Attention O(n²·d) per layer, and the linear layers O(n·d²). |
| Tasks | Machine translation, Summarisation, Question answering, Text classification | Machine translation, Sequence transduction |
| Main advantage | A unified format for all tasks | Fully parallel training |
| Main limitation | Huge training cost for the large versions | Attention cost is quadratic in the sequence length |
| Review status | Needs review | Needs review |
| Calculation assumptions | T5Model from Hugging Face with the t5-base configuration (version 1.0 with a tied output). | nn.Transformer in PyTorch with a shared 37,000 × 512 embedding and a tied output projection. PyTorch adds two final normalisations (2,048 parameters), and the actual vocabulary size may differ slightly, so the total differs from the stated 65M. |
Recorded relations between the compared models
- T5 (Text-to-Text Transfer Transformer) Variant of Transformer — T5 is an encoder-decoder in text-to-text form.
