Generative AI Interview Questions
Frequently asked generative AI interview questions — LLMs, diffusion, evaluation, cost and responsible AI — with answers.
Generative AI interview questions
These questions come up in interviews for AI engineer, ML engineer and software roles that use GenAI. Practise explaining each in simple words.
1. What is generative AI?
AI that creates new content — text, code, images, audio or video — by learning the patterns of its training data and producing new samples from them. Traditional (discriminative) AI classifies or predicts instead.
2. How does an LLM generate text?
It's an autoregressive transformer: given the tokens so far, it predicts a probability for every possible next token, picks one (by greedy decoding or sampling), appends it, and repeats until it produces an end token or hits a length limit.
3. What is a token?
A unit of text the model processes — often a word or part of a word. Context limits, speed and cost are all measured in tokens, for both input and output.
4. What do temperature and top-p do?
Temperature scales how spread out the next-token probabilities are: low is focused and deterministic, high is varied and creative. Top-p samples only from the smallest set of tokens whose combined probability reaches p. Use low values for factual tasks.
5. What is a hallucination and how do you reduce it?
A confident but false output. Reduce it with RAG (ground answers in retrieved documents), tools for facts and calculations, asking the model to cite sources or say "I don't know", lower temperature, and evaluation on known-answer test sets.
6. Explain diffusion models.
They learn to reverse a noising process. Training adds noise to images step by step; the network learns to predict that noise. Generation starts from pure noise and removes predicted noise over many steps, guided by a text prompt through cross-attention.
7. What is latent diffusion?
Running diffusion in the compressed latent space of a VAE instead of on full-resolution pixels. It is much cheaper, which is why models like Stable Diffusion run on consumer GPUs.
8. GANs vs diffusion models?
GANs train a generator against a discriminator — fast to sample but unstable to train and prone to low diversity. Diffusion models train stably and give higher-quality, more diverse output at the cost of many sampling steps.
9. Prompting vs RAG vs fine-tuning — when would you use each?
- Prompting — first choice; cheap and fast to iterate.
- RAG — the model needs private or up-to-date knowledge.
- Fine-tuning — you need a consistent style, format or specialised behaviour that prompting can't reliably achieve, and you have good training data.
10. What is a context window?
The maximum number of tokens a model can consider at once — prompt plus response. Longer contexts allow bigger documents but cost more and can dilute attention, so relevant, well-organised context still matters.
11. How do you evaluate a GenAI application?
Build a test set of realistic inputs with expected properties, then score outputs with automatic checks (format, exact facts), LLM-as-judge with a clear rubric, and periodic human review. Track quality, latency and cost per request, and re-run after every change.
12. How do you control GenAI costs?
Choose the right model size, keep prompts concise, cap max_tokens, cache repeated prompt prefixes, batch offline work, and measure cost per successful task — not just per request.
13. What is multimodal AI?
Models that handle several data types — for example, reading images or documents alongside text. A vision encoder turns images into tokens the language model can attend to.
14. What are the main risks of generative AI?
Hallucinations, bias, privacy leaks, copyright questions, prompt injection in apps that use tools, and misuse such as deepfakes. Mitigations include grounding, guardrails, human review, data policies and clear labelling of AI-generated content.
15. What is RLHF?
Reinforcement Learning from Human Feedback — after pre-training and instruction tuning, humans rank model outputs, a reward model learns those preferences, and the LLM is optimised to produce preferred answers. It makes models more helpful and safer.
Practice tip
Build the AI study helper from this tutorial, then add conversation memory and a small evaluation script with ten test topics. Explaining what you measured and what you changed is a strong answer in any GenAI interview.