LLM Interview Questions
How large language models work — tokens, context windows, sampling and why they hallucinate.
What is a token and why does it matter?
A token is a chunk of text (often part of a word) the model reads and writes. Pricing, context limits and latency are all measured in tokens.
Key Points:
- Roughly 4 characters or ¾ of a word per token in English.
- Non-English text often uses more tokens.
What does temperature control?
Temperature scales how random sampling is. Low values give predictable output (good for extraction, JSON); higher values give more varied output (good for brainstorming).
Key Points:
- Temperature 0 is near-deterministic, not guaranteed identical.
Why do LLMs hallucinate?
LLMs predict likely next tokens, not verified facts. Without grounding they can produce fluent but false answers. Retrieval, citations, constrained output and evals reduce it.
Key Points:
- Ask for sources and allow "I don't know".