Skip to content
  • GPT vs BERT · Generative AI

GPT vs BERT

LearnViaNotes @learnvianotes· 1 min read

Contrasting the two dominant architectural paths spawned by the original Transformer design.

FeatureGPT (Generative Pre-trained Transformer)BERT (Bidirectional Encoder Representations from Transformers)
ArchitectureDecoder-only (stacked masked self-attention)Encoder-only (stacked bidirectional self-attention)
Context LookLeft-to-right (causal masking hides future tokens)Bidirectional (looks left and right simultaneously)
Pre-training ObjectiveNext-token prediction (Autoregressive Generation)Masked Language Model (MLM) & Next Sentence Prediction (NSP)
Primary UtilityCreative generation, dialog, coding, text synthesisSearch queries, sentiment analysis, NER, semantic representation
Generation StyleAutoregressive (outputs token, appends to prompt, repeats)Non-generative (outputs representation vectors per token)

Autoregressive Loop Visualized

Step 1: Input: "Prompt: The sky is" -> Predict: "blue" (Probability: 85%)Step 2: Input: "Prompt: The sky is blue" -> Predict: "and" (Probability: 40%)Step 3: Input: "Prompt: The sky is blue and" -> Predict: "clear" (Probability: 60%)

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report