Sequence-to-sequence learning predicts an output sequence from an input sequence, even when their lengths or representations differ. It supports tasks such as translating paragraphs or answering questions. section 20.1.6
A sequence-to-sequence Transformer uses two coordinated components:
- A TransformerEncoder converts the input vector sequence into representations that capture context and order. section 20.1.6
- A TransformerDecoder receives the encoded sequence and target sequence, then predicts what should come next. section 20.1.6
Machine translation
Map a source-language paragraph to a target-language paragraph with an encoder-decoder Transformer; question answering is another stated use. section 20.1.6
Table 20.1 Model architectures for different data types
|
Input
|
Output
|
Model
|
|---|---|---|
|
Vector data
|
Class probability, regression value
|
Densely connected network
|
|
Timeseries data
|
Class probability, regression value
|
RNN, Transformer
|
|
Images
|
Class probability, regression value
|
Convnet
|
|
Text
|
Class probability, regression value
|
Transformer
|
|
Text, images
|
Text
|
Transformer
|
|
Text, images
|
Images
|
VAE, diffusion model
|
Use the architecture table to compare Transformers with RNNs and other model families across input and output types. section 20.1.6
