GPT (Generative Pretrained Transformer) is a family of transformer language models developed by OpenAI. GPT uses a causal language-modeling objective: it predicts the next token from the tokens before it. This makes it useful for text generation, including chatbot applications. section 7.2 section 7.3
GPT combines self-supervised pretraining on a large text corpus with supervised fine-tuning on a target task. This transfer-learning approach has been used for natural language inference, question answering, semantic similarity, and text classification. section 7.2
The architecture stacks transformer decoders without an encoder or encoder-decoder attention. Masked self-attention prevents a token from attending to future tokens, preserving the causal ordering needed for next-token prediction. By contrast, BERT stacks encoders and uses a masked language-modeling objective. section 7.2.1 section 7.2
Figure 7.7 A high-level representation of the GPT architecture, showing stacked decoders, input embeddings, and positional encodings. The output from the top can be used for both text prediction/generation and classification.
Follow the stacked-decoder architecture from input embeddings and positional encodings to outputs used for generation or classification. section 7.2.1
Textual entailment
To test whether a premise implies a hypothesis, concatenate the two statements with a special delimiter token. The resulting single input can be classified by the same architecture, without changing its structure. section 7.2.1
GPT has evolved through successive iterations. GPT-2 had 1.5 billion parameters, while GPT-3 had 175 billion. Larger models bring resource considerations as well as potential for misuse; GPT-2 was initially not fully open-sourced because of abuse concerns. section 7.2


















