An enterprise is using OCI Generative AI with a RAG architecture. They observe that the LLM sometimes produces hallucinated answers that are not supported by the retrieved documents. Which strategy is most effective in reducing these hallucinations?
Explicit grounding instructions guide the model to stick to retrieved documents, reducing unsupported claims.
Why this answer
Explicitly instructing the LLM to answer only based on the provided context directly addresses the root cause of hallucinations in a RAG pipeline: the model's tendency to rely on its parametric knowledge rather than the retrieved documents. This system prompt acts as a behavioral constraint, forcing the model to ground its responses in the supplied context, which is the most effective and widely recommended mitigation strategy.
Exam trap
Oracle often tests the misconception that increasing context quantity (top-k) or adjusting model parameters like temperature will solve hallucinations, when in fact the most reliable solution is explicit behavioral instruction through system prompts.
How to eliminate wrong answers
Option A is wrong because increasing the temperature parameter actually increases randomness and creativity in the output, making hallucinations more likely, not less; lower temperature values (closer to 0) produce more focused and deterministic outputs. Option C is wrong because using a smaller LLM reduces model capacity and may actually increase hallucination rates due to poorer reasoning and comprehension abilities, not decrease them. Option D is wrong because retrieving more chunks (increasing top-k) can introduce irrelevant or conflicting information that confuses the model, potentially increasing hallucinations rather than reducing them; the quality and relevance of retrieved chunks matter more than quantity.