GPT

Generative Pre-trained Transformer

Definition

GPT is a family of large language models by OpenAI. They are based on the decoder variant of the Transformer architecture and generate text token by token.

What for?

GPT models understand and generate natural language and code. They are first pre-trained on large amounts of text (predicting the next token) and then fine-tuned to follow instructions and hold dialogues.

Technical architecture

flowchart LR
  A[Prompt] --> B[Tokenizer]
  B --> C[Embeddings]
  C --> D[Decoder blocks<br/>self-attention + feed-forward]
  D --> E[Next-token probabilities]
  E --> F[Sampling]
  F -->|token appended| D
  F --> G[Generated text]

Core components

Tokenizer
Splits text into tokens (word pieces) and maps them to numbers.
Embeddings
Represent each token as a vector, combined with position information.
Decoder blocks
Stacked layers of masked self-attention and feed-forward networks.
Sampling
Picks the next token from the probability distribution, controlled e.g. by temperature.

Practical examples

  • A chat assistant answers questions about internal documentation.
  • An IDE suggests the next line of code while you type.

Enterprise use cases

  • Customer support with draft replies for agents
  • Summarising long reports and meeting notes
  • Code generation and code review

Quiz

1. What does the “P” in GPT stand for?

2. Which task does a GPT model learn during pre-training?

3. Which Transformer variant do GPT models use?

Related news

QCon San Francisco 2026: Lessons from Building a $100M Product in Six Weeks at OpenAI

Source excerptAt QCon San Francisco 2026, OpenAI's Brian Yang described building the ChatGPT ads product with Codex agents and no human-written code. He outlined layered testing, sandboxes, and batched pull request reviews, and noted failure modes such as code "slop" and unsafe agent actions. He advised gradual adoption and framed engineers as managers of agents. By Daniel Curtis