Models

January 3, 2024 ยท View on GitHub

This page lists the available pre-trained T5 models. To use a pre-trained model, you need a Gin config file that defines the model params, and the model checkpoint to load from. For your convenience, TensorFlow checkpoints and Gin configs for common T5 pre-trained models have been made available for use in T5X. Following is a list of these pre-trained models and their Gin and checkpoint locations.

Selecting a model:

Publicly Available Models:

ModelUse Case
T5 1.1Improved T5, recommended for most research. English only.
T5The original T5 work for reproducibility. English only.
T5 1.1 LM-AdaptedTrained for 100k additional steps on the LM objective, per prompt tuning paper.
mT5Multilingual T5. Recommended for multilingual research. Note that at smaller scales (at least through XL), mT5 performance is lower than T5 on English tasks.
mT5 LM-AdaptedTrained for 100k additional steps on the LM objective, per zero-shot cross-lingual generation (XGen) paper.
umT5umT5, an updated mT5 model trained using a more uniform language distribution, per the UniMax paper.
ByT5ByT5. A "token-free" model that uses UTF-8 bytes for input and output. Recommended for tasks involving word-internal phenomena such as spelling, pronunciation, or morphology.
LongT5Recommended checkpoints to fine-tune for long input sequence tasks
MoEUseful for MoE experimentation.
Flan-T5General purpose T5 checkpoints for few-shot and finetuning. We recommend Flan-T5 over vanilla T5 and T5 LM-adapted
UL2Checkpoints for 20B pretrained and FLAN-based instruction-tuned models using the UL2 objective from UL2 paper
BigScienceCheckpoints from the BigScience paper
FLIPLanguage-Image models trained with an alternative to CLIP, presented in the FLIP paper
RankGen1.2B parameter encoder model for English to score model generations given a prefix for decoding from the RankGen paper
Dipper11B parameter paraphrase generation model from the Dipper paper

Public Research Models

T5 Checkpoints

These are the checkpoints used in the paper Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. They are encoder-decoder models pre-trained on C4 with a "span corruption" denoising objective, in addition to a mixture of downstream tasks including: GLUE, SuperGLUE, CNN/Daily Mail, SQuAD, and WMT.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
T5 Smallt5_small.gings://t5-data/pretrained_models/t5x/t5_small/checkpoint_1000000
T5 Baset5_base.gings://t5-data/pretrained_models/t5x/t5_base/checkpoint_999900
T5 Larget5_large.gings://t5-data/pretrained_models/t5x/t5_large/checkpoint_1000700
T5 3Bt5_3B.gings://t5-data/pretrained_models/t5x/t5_3B/checkpoint_1000000
T5 11Bt5_11B.gings://t5-data/pretrained_models/t5x/t5_11B/checkpoint_1000000

T5 1.1 Checkpoints

These are similar to the models from Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer, but with the following improvements:

  • GEGLU activation in feed-forward hidden layer, rather than ReLU - see https://arxiv.org/abs/2002.05202 .
  • Dropout was turned off in pre-training (quality win). Dropout should be re-enabled during fine-tuning.
  • Pre-trained on C4 only without mixing in the downstream tasks.
  • no parameter sharing between embedding and classifier layer
  • "xl" and "xxl" replace "3B" and "11B". The model shapes are a bit different - larger d_model and smaller num_heads and d_ff.

For English-language, sequence-to-sequence-style tasks (ones where the goal is to map from an input text sequence to a target sequence) these are usually the best models to fine-tune.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
T5 1.1 Smallt5_1_1/small.gings://t5-data/pretrained_models/t5x/t5_1_1_small/checkpoint_1000000
T5 1.1 Baset5_1_1/base.gings://t5-data/pretrained_models/t5x/t5_1_1_base/checkpoint_1000000
T5 1.1 Larget5_1_1_large.gings://t5-data/pretrained_models/t5x/t5_1_1_large/checkpoint_1000000
T5 1.1 XLt5_1_1_xl.gings://t5-data/pretrained_models/t5x/t5_1_1_xl/checkpoint_1000000
T5 1.1 XXLt5_1_1_xxl.gings://t5-data/pretrained_models/t5x/t5_1_1_xxl/checkpoint_1000000

T5 1.1 LM-Adapted Checkpoints

These "LM-adapted" models are initialized from T5 1.1 (above) and trained for an additional 100K steps on the LM objective discussed in the T5 paper. This adaptation improves the ability of the model to be used for prompt tuning. These checkpoints were also used within the BigScience T0 project.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
T5 1.1 LM-100K Smallt5_1_1_small.gint5_1_1_lm100k_small/checkpoint_1100000
T5 1.1 LM-100K Baset5_1_1_base.gint5_1_1_lm100k_base/checkpoint_1100000
T5 1.1 LM-100K Larget5_1_1_large.gint5_1_1_lm100k_large/checkpoint_1100000
T5 1.1 LM-100K XLt5_1_1_xl.gint5_1_1_lm100k_xl/checkpoint_1100000
T5 1.1 LM-100K XXLt5_1_1_xxl.gint5_1_1_lm100k_xxl/checkpoint_1100000

mT5 Checkpoints

These are the checkpoints used in the paper mT5: A Massively Multilingual Pre-trained Text-to-Text Transformer. They are encoder-decoder models trained on multilingual C4 with a denoising objective. These are the best checkpoints to fine-tune for non-English sequence-to-sequence tasks.

Vocabulary: mc4.250000.100extra

ModelGin File LocationCheckpoint Location
mT5 Smallmt5/small.gings://t5-data/pretrained_models/t5x/mt5_small/checkpoint_1000000
mT5 Basemt5/base.gings://t5-data/pretrained_models/t5x/mt5_base/checkpoint_1000000
mT5 Largemt5/large.gings://t5-data/pretrained_models/t5x/mt5_large/checkpoint_1000000
mT5 XLmt5/xl.gings://t5-data/pretrained_models/t5x/mt5_xl/checkpoint_1000000
mT5 XXLmt5/xxl.gings://t5-data/pretrained_models/t5x/mt5_xxl/checkpoint_1000000

mT5 LM-Adapted Checkpoints

These are the checkpoints released as part of the zero-shot cross-lingual generation (XGen) paper.

These "LM-adapted" models are initialized from mT5 (above) and trained for an additional 100K steps on the LM objective discussed in the T5 paper.

This adaptation improves the ability of the model to be used for prompt tuning.

Vocabulary: mc4.250000.100extra

ModelGin File LocationCheckpoint Location
mT5 LM-Adapted Smallmt5/small.ginmt5_lm_adapted/small/checkpoint_1100000
mT5 LM-Adapted Basemt5/base.ginmt5_lm_adapted/base/checkpoint_1100000
mT5 LM-Adapted Largemt5/large.ginmt5_lm_adapted/large/checkpoint_1100000
mT5 LM-Adapted XLmt5/xl.ginmt5_lm_adapted/xl/checkpoint_1100000
mT5 LM-Adapted XXLmt5/xxl.ginmt5_lm_adapted/xxl/checkpoint_1100000

umT5 Checkpoints

These are the checkpoints described in the paper UniMax: Fairer and More Effective Language Sampling for Large-Scale Multilingual Pretraining. umT5 is similar to mT5 (see above); both are multilingual encoder-decoder models ranging from 300M to 13B parameters, trained on the mC4 corpus using a denoising objective. umT5 is trained on a fresher version of the mC4 corpus (3.1.0), and with a more uniform language balancing strategy.

Vocabulary: umt5.256000

ModelGin File LocationCheckpoint Location
umT5 Smallumt5/pretrain_small.ginumt5/small/checkpoint_1000000
umT5 Baseumt5/pretrain_base.ginumt5/base/checkpoint_1000000
umT5 XLumt5/pretrain_xl.ginumt5/xl/checkpoint_1000000
umT5 XXLumt5/pretrain_xxl.ginumt5/xxl/checkpoint_1000000

ByT5 Checkpoints

These are the checkpoints used in the paper ByT5: Towards a Token-Free Future with Pre-trained Byte-to-Byte Models. They are similar to mT5 (above), but are "token-free", processing text as raw UTF-8 bytes, as opposed to using a pretrained subword vocabulary. These models are more robust to character-level noise, and outperform parameter-matched mT5 models in many settings, particularly on word-level tasks sensitive to spelling, pronunciation, or morphology. However inference is significantly slower, up to 10x depending on the task.

Vocabulary: None

ModelGin File LocationCheckpoint Location
ByT5 Smallbyt5/small.gings://t5-data/pretrained_models/t5x/byt5_small/checkpoint_1000000
ByT5 Basebyt5/base.gings://t5-data/pretrained_models/t5x/byt5_base/checkpoint_1000000
ByT5 Largebyt5/large.gings://t5-data/pretrained_models/t5x/byt5_large/checkpoint_1000000
ByT5 XLbyt5/xl.gings://t5-data/pretrained_models/t5x/byt5_xl/checkpoint_1000000
ByT5 XXLbyt5/xxl.gings://t5-data/pretrained_models/t5x/byt5_xxl/checkpoint_1000000

LongT5 Checkpoints

These are the checkpoints used in the paper LongT5: Efficient Text-to-Text Transformer for Long Sequences. They are encoder-decoder models trained on C4 using the PEGASUS Principle Sentences Generation objective. These are the recommended checkpoints to fine-tune for long input sequence tasks.

LongT5 Local Attention Checkpoints

The checkpoints below use local attention, which uses a sliding window to reduce training time from quadratic (with regards to input length) to linear. These are the recommended checkpoints to use for faster training/inference time.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
LongT5 Local Attention Baselongt5/models/longt5_1_1_base.gings://t5-data/pretrained_models/t5x/longt5/local_base/checkpoint_1000000
LongT5 Local Attention Largelongt5/models/longt5_1_1_large.gings://t5-data/pretrained_models/t5x/longt5/local_large/checkpoint_1000000
LongT5 Transient Global Attention Checkpoints

The checkpoints below use transient global attention, which introduces global tokens at each encoder layer to allow tokens to interact with each other at longer distances. These are the recommended checkpoints to use for increased performance on long input sequence tasks.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
LongT5 Baselongt5/models/longt5_1_1_transient_base.gings://t5-data/pretrained_models/t5x/longt5/tglobal_base/checkpoint_1000000
LongT5 Largelongt5/models/longt5_1_1_transient_large.gings://t5-data/pretrained_models/t5x/longt5/tglobal_large/checkpoint_1000000
LongT5 XLlongt5/models/longt5_1_1_transient_xl.gings://t5-data/pretrained_models/t5x/longt5/tglobal_xl/checkpoint_1000000

Mixture of Experts (MoE) Checkpoints

These MoE checkpoints need to be used with T5X MoE overrides -- specifically, the MoeTrainer and the MoePjitPartitioner. For example, for fine-tuning, use the MoE fine-tune run config.

Converted Mesh Tensorflow checkpoints

Switch Transformer model.

Vocabulary: cc_all.32000.100extra

ModelGin File LocationCheckpoint Location
Switch Transformer Base 8 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e8/checkpoint_500100
Switch Transformer Base 16 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e16/checkpoint_550000
Switch Transformer Base 32 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e32/checkpoint_550000
Switch Transformer Base 64 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e64/checkpoint_550000
Switch Transformer Base 128 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e128/checkpoint_550000
Switch Transformer Base 256 Expertsswitch_base.gings://t5-data/pretrained_models/t5x/moe/switch_classic/base/e256/checkpoint_550000
Switch Transformer Large 128 Expertsswitch_large.gings://t5-data/pretrained_models/t5x/moe/switch_classic/large/e128/checkpoint_483100
Switch Transformer XXL 128 Expertsswitch_xxl.gings://t5-data/pretrained_models/t5x/moe/switch_classic/xxl/e128/checkpoint_634600
Switch Transformer C 2048 Experts (1.6T)switch_c.gings://t5-data/pretrained_models/t5x/moe/switch_classic/c/e2048/checkpoint_611800

Flan-T5 Checkpoints

These are the checkpoints released as part of the paper Scaling Instruction-Finetuned Language Models. They were initialized from the T5 1.1 LM-Adapted and instruction-finetuned.

They significantly outperform the LM-adapted checkpoints. For example, Flan-T5-XXL outperforms T5-LM-XXL by 26.6% absolute on the normalized average score. It even outperforms a much larger PaLM 62B model on BigBench Hard a set of challenging BigBench benchmark.

Unlike the vanilla T5 checkpoints, these can be directly used for few-shot prompting as well as standard finetuning. See Chung et al. 2022 for details.

ModelGin File LocationCheckpoint Location
Flan-T5 Smallt5_1_1/small.gings://t5-data/pretrained_models/t5x/flan_t5_small/checkpoint_1198000
Flan-T5 Baset5_1_1/base.gings://t5-data/pretrained_models/t5x/flan_t5_base/checkpoint_1184000
Flan-T5 Larget5_1_1_large.gings://t5-data/pretrained_models/t5x/flan_t5_large/checkpoint_1164000
Flan-T5 XLt5_1_1_xl.gings://t5-data/pretrained_models/t5x/flan_t5_xl/checkpoint_1138000
Flan-T5 XXLt5_1_1_xxl.gings://t5-data/pretrained_models/t5x/flan_t5_xxl/checkpoint_1114000

UL2 Checkpoints

Checkpoints for 20B pretrained and FLAN-based instruction-tuned models using the UL2 objective from UL2 paper. Checkpoints are released at https://github.com/google-research/google-research/tree/master/ul2#checkpoints.

BigScience Checkpoints

Checkpoints from the BigScience paper, released at https://github.com/bigscience-workshop/architecture-objective/tree/main#checkpoints.

FLIP Checkpoints

Language-Image models trained with an alternative to CLIP, presented in the FLIP paper. Checkpoints are released at https://github.com/facebookresearch/flip#results-and-pre-trained-flip-models.

RankGen Checkpoints

1.2B parameter encoder model for English to score model generations given a prefix for decoding from the RankGen paper. Checkpoints are released at https://github.com/google-research/google-research/tree/master/rankgen.

Dipper Checkpoints

11B parameter paraphrase generation model from the Dipper paper. Checkpoints are released at https://github.com/google-research/google-research/tree/master/dipper.