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.

PropertyT5 (Text-to-Text Transfer Transformer)Transformer
FamilyTransformersTransformers
Year of appearance20192017
ResearchersColin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang,…Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,…
Architecture typeEncoder–decoder TransformerEncoder–decoder Transformer
Learning mechanismself-supervisedsupervised
Compared configurationT5-base: 12 + 12 layers, d = 768, d_ff = 3072, 12 headsTransformer (base): N = 6, d_model = 512, h = 8, d_ff = 2048
Input shapen SentencePiece tokensn source tokens and n target tokens
Output shapen × 32128n × 37000
Depth12 encoder layers + 12 decoder layers6 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
MACs29,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).
ComplexityO(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²).
TasksMachine translation, Summarisation, Question answering, Text classificationMachine translation, Sequence transduction
Main advantageA unified format for all tasksFully parallel training
Main limitationHuge training cost for the large versionsAttention cost is quadratic in the sequence length
Review statusNeeds reviewNeeds review
Calculation assumptionsT5Model 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.