Interview Q&A / AI & Generative AI
AI & Generative AI interview questions
LLMs, tokens, embeddings, RAG and prompt engineering, the questions every AI role now asks.
Prefer rapid revision? Practise AI & Generative AI short interview answers →
- What do temperature and top-p control in an LLM?
Both control how the next token is picked from the model's probabilities. Temperature sharpens or flattens the probabilities (low means predictable, high means varied), and top-p limits sampling to the smallest set of tokens whose probabilities add up to p.
IntermediateIn-depth3 min read - What do repetition, frequency and presence penalties do during generation?
They lower the chance of tokens that have already appeared. A frequency penalty grows with each repeat, a presence penalty applies once a token has appeared at all. They reduce loops and repeated phrases but can hurt text that needs repetition.
IntermediateQuick answer1 min read - What is top-k sampling, and how does it differ from top-p?
Top-k keeps only the k most likely tokens and samples among them. Top-p keeps the smallest set of tokens whose probabilities add up to p. Top-k uses a fixed count, while top-p adapts the candidate list to how confident the model is.
IntermediateQuick answer1 min read