What are embeddings, and what can you build with them besides RAG?
What the interviewer wants to hear
- Vectors that capture meaning; similar items are close
- Semantic search and recommendations
- Clustering, deduplication, classification
- Similarity measured with cosine or dot product
Model answer
Embeddings are lists of numbers that represent the meaning of text, images or other data. An embedding model is trained so that similar items end up close in vector space, and we compare them with cosine similarity or dot product. Besides RAG, I can use them for semantic search, where a query like "laptop will not charge" finds articles about "battery not charging". I can recommend similar products or articles. I can cluster support tickets to find common themes, and detect near-duplicate documents. Embeddings also make good features for simple classifiers: for example, a logistic regression on embeddings can route tickets to the right team cheaply. They are fast and cheap compared to calling a large model for every item, which makes them useful at scale.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy AI Engineer (LLM & Generative AI) questions
- Explain retrieval-augmented generation (RAG) to a new team member. Why do we use it?
- Why do LLMs hallucinate, and what simple steps reduce it in an application?
- How do tokens affect the cost and speed of an LLM application?
- What do temperature and top-p control, and how would you set them for different tasks?
- What is an LLM agent, and how is it different from a single LLM call?
- How does vector search work, and why is it useful for an AI application?
- Your app starts getting rate-limit errors from the LLM API. How do you handle them?
- What is the difference between zero-shot and few-shot prompting, and when would you use each?
- How do you protect personal data when building a feature on a hosted LLM API?