CrackML by @ml.with.umang
Interview questions / GenAI & LLM
GenAI & LLM interview question

How is BERT different from GPT?

How is BERT different from GPT?. Structure your response as you would in a top-tier ML/AI engineering interview.

mediumconceptEvidence 88/1003 source reportsAmazonMicrosoft

The 60-second answer

BERT is encoder-only and uses bidirectional self-attention; GPT is decoder-only and uses causal self-attention. BERT is pretrained with masked-token style objectives, while GPT is trained autoregressively to predict the next token.

Build the answer in this order

1
Define the mechanism

BERT is encoder-only and uses bidirectional self-attention; GPT is decoder-only and uses causal self-attention.

2
Explain the architecture

BERT is pretrained with masked-token style objectives, while GPT is trained autoregressively to predict the next token.

3
Compare trade-offs

BERT naturally fits representation/classification tasks; GPT naturally fits generation and can also be adapted to many understanding tasks.

4
Close with serving + evaluation

Compare context direction, training objective, output interface, and serving pattern rather than only parameter count.

A useful interview mental model

This is the shape of a strong answer—not a script to memorize.

01Definition
02Mechanism
03Trade-offs
04Failure modes
05When to use

Senior-level signal

  • Discuss memory bandwidth and attention/KV-cache costs, not only FLOPs, when reasoning about real latency.
  • Tie architectural choices to the task, context length, training objective, and deployment constraints.

What the interviewer is really testing

Understanding beyond prompting: architecture, retrieval, evaluation, inference, safety, latency, cost, and failure recovery.

Likely follow-up questions

What assumption makes this approach work?
When would you choose the strongest alternative instead?
What production or data failure mode changes your answer?

Common weak-answer patterns

  • Reciting a definition without mechanism or assumptions.
  • Claiming one technique is always better without a data regime.
  • Stopping before failure modes, validation, or deployment implications.