Skip to content
fn

t5_small

→T5Model60.5M
t5_small(pretrained: bool = False, overrides: object = {})

T5-Small trunk — the 60M model of the paper's scaling study.

Six blocks on each side, dmodel=512d_{\text{model}} = 512, dff=2048d_{ff} = 2048 and eight heads of width 64.

Model Size

Parameters

pretrainedbool= False
Google's T5-Small checkpoint is not hosted for Lucid yet, so True raises NotImplementedError instead of returning an untrained model.
**overridesobject= {}
T5Config fields to change from the Small defaults.

Returns

T5Model

Encoder-decoder trunk with no language-modelling head.

Notes

Reference: Raffel et al., "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer", JMLR 21(140), 2020 (arXiv:1910.10683), §3.7.

Examples

>>> import lucid
>>> from lucid.models.text.t5 import t5_small
>>> model = t5_small().eval()
>>> out = model(lucid.tensor([[13, 5, 42, 1]]), lucid.tensor([[0, 7]]))
>>> out.last_hidden_state.shape
(1, 2, 512)

Used by 1