Skip to content
RED SAGSkills
easyAI Engineer (LLM & Generative AI) interview question

Why do LLMs hallucinate, and what simple steps reduce it in an application?

What the interviewer wants to hear

  • Models predict likely text, not verified facts
  • Ground answers with retrieved sources
  • Instruct to say "I do not know" and to cite
  • Lower temperature for factual tasks; validate outputs

Model answer

LLMs are trained to predict the next likely token, so they produce fluent text even when they do not have the facts. If the answer is not in their training data or context, they may fill the gap with something that sounds right. In an application, the biggest fix is grounding: give the model the relevant facts through retrieval or tool calls, and tell it to answer only from those sources and cite them. I also explicitly allow "I do not know" so the model does not feel forced to guess. For factual tasks I use low temperature. Then I check outputs: for example verifying that cited passages actually contain the claim, validating numbers against the database, and using structured output so fields can be checked. Finally I measure hallucination rate on an eval set.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy AI Engineer (LLM & Generative AI) questions