BERT (bidirectional encoder representations from transformers) is a transformer-based model built on the encoder stack. It predicts masked or hidden words using bidirectional context, making it especially useful for text classification. section 1.4
BERT differs from GPT in architecture, training objective, and typical applications:
- Uses the transformer encoder rather than the decoder. section 1.4
- Learns through masked-word prediction rather than text completion. section 1.4
- Supports tasks such as sentiment prediction, document categorization, and toxic-content detection. section 1.4
Figure 1.5 A visual representation of the transformer’s encoder and decoder submodules. On the left, the encoder segment exemplifies BERT-like LLMs, which focus on masked word prediction and are primarily used for tasks like text classification. On the right, the decoder segment showcases GPT-like LLMs, designed for generative tasks and producing coherent text sequences.
Compare the encoder segment associated with BERT-like models with the decoder segment associated with GPT-like generative models. section 1.4








