Entry

What is the difference between an embedding model and a generative model?

How to answer it in an AI engineer interview: what is being tested, a step-by-step framework, a sample answer and the mistakes to avoid.

$19.99 on Gumroad, instant download40% off with code EARLYBF until Nov 3, 11:59 PM PTEARLYBF: 40% off until Nov 3

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Practiced one out loud? Paste your answer into the free self-check and get a score in 30 seconds

What the interviewer is testing

Whether you can explain the different outputs and jobs of the two model types and show how they combine in a retrieval system.

Answer framework

  1. Embedding model: maps a piece of text to a fixed-length vector so that similar meanings land close together.
  2. Generative model: predicts and outputs tokens to produce text, code or structured data.
  3. Uses of embeddings: semantic search, clustering, deduplication, classification and recommendations.
  4. Cost: embedding calls are far cheaper and faster, so you can embed a whole corpus once.
  5. Together: in RAG the embedding model finds candidate passages and the generative model reads them and writes the answer.

Sample answer

An embedding model turns text into a single vector of fixed length, for example a few hundred or a few thousand numbers. It is trained so that texts with similar meaning have vectors that are close by a measure such as cosine similarity. It does not write anything; its output is only useful for comparison.

A generative model produces tokens one at a time. It is what writes the answer, the summary or the SQL query.

They solve different problems and have very different costs. Embeddings are cheap enough to compute for millions of documents at ingestion, which is why they back semantic search, deduplication, clustering and simple classifiers. In a RAG system I embed every chunk once, embed each query at request time, find the nearest chunks, and only then pay for the generative model to read those few chunks and answer.

Likely follow-ups

Can you use a generative model to create embeddings? You can take hidden states from it, but dedicated embedding models trained with contrastive objectives usually retrieve better and are much cheaper.

Common mistakes

The PlaybookWant the full method?

The 0 to 1 AI Engineer Interview Playbook covers the answer frameworks, system-design walkthroughs and an 8-week plan.

Get the playbook 40% off with code EARLYBF until Nov 3, 11:59 PM PTEARLYBF: 40% off until Nov 3

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Interviewing for PM or TPM? See the full PM package, $59 on Gumroad: a resume system, a PM, TPM and PGM interview handbook, a 1:1 cheat sheet and a PM playbook. PM and TPM content, not AI engineer prep.

Related questions

Based on question #15 in the full question bank.