An encoder-only transformer turns input text into contextual representations rather than generating an output sequence. It is suited to non-generative tasks where understanding the input matters more than producing new text. section 4.1.4
Use an encoder-only transformer when you need to:
- Train predictive models from text embeddings. section 4.1.4
- Extract meaningful context from an input instead of predicting the next token. section 4.1.4
- Fine-tune with labeled data for a defined prediction task. section 4.1.4
Figure 4.4 Traditional classification models use supervised learning to predict one of several predefined classifications. They look for the intent, or meaning, of a user input. Generative models use decoding transformers to create a text completion. They predict the next sequence of tokens (loosely, words or characters) that are most likely to occur after the user input.
Compare encoder-oriented classification with decoder-oriented generation: one predicts among predefined classifications, while the other creates a text completion. section 4.1.4



