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 happens when you set temperature to 0?
The model effectively always picks the most likely next token, so output becomes close to deterministic and repeatable. It suits extraction and classification, but it is not a guarantee of a correct or perfectly identical answer.
BeginnerQuick answer1 min read - Which sampling settings would you use for JSON extraction versus brainstorming taglines?
For JSON extraction use low temperature, near zero, so output is stable and format errors are rare. For brainstorming use a higher temperature, with perhaps a moderate top-p, so the model offers varied options. Always validate structured output.
BeginnerQuick answer1 min read - Should you change temperature and top-p at the same time?
Usually adjust one and leave the other at its default. Both reshape the randomness of the choice, so changing both makes it hard to tell which caused a difference and can overshoot, giving output that is either too rigid or too erratic.
IntermediateQuick answer1 min read