Implementing Retrieval-Augmented Generation to Reduce Hallucinations
A company uses Azure OpenAI Service to generate product descriptions. They notice that the descriptions sometimes contain factually incorrect information. Which strategy should they use to reduce hallucinations?
Quick Answer
Hallucinations happen because a language model generates text from patterns learned during training rather than by looking anything up, so when a prompt asks about specifics the model never saw clearly or has since blurred together, it can produce fluent, confident, and wrong output. RAG addresses this at the source rather than trying to filter bad output after the fact: before the model generates a response, the system retrieves relevant, verified documents from a trusted knowledge base — in this case, real product information — and injects that retrieved content directly into the prompt as grounding context. The model then generates its description working from that supplied factual material rather than reconstructing details purely from its own parametric memory, which is where the inaccuracies were originating. This is why RAG is the standard fix specifically for factual-accuracy problems, as opposed to prompt engineering techniques like few-shot examples, which shape style and tone but don't supply the model with facts it doesn't already have. Any scenario describing generated content that's fluent but factually wrong, where the fix needs to connect the model to a source of truth, is pointing at RAG.
⚠ Common exam trap
Test-takers frequently confuse hyperparameter tuning (temperature, max_tokens) or prompt engineering (system messages) as solutions for factual accuracy, when in fact only grounding with external data (RAG) directly addresses the hallucination problem by providing a verifiable source of truth.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Implement Retrieval-Augmented Generation (RAG) by grounding prompts with a knowledge base.
Retrieval-Augmented Generation (RAG) grounds the model's output in a trusted, external knowledge base, providing factual context that directly reduces hallucinations. By retrieving relevant documents and injecting them into the prompt, the model generates responses based on verified information rather than relying solely on its parametric memory, which is the primary cause of factual inaccuracies in Azure OpenAI Service.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the temperature parameter to 1.0.
Why it's wrong here
Higher temperature increases randomness, likely increasing hallucinations.
- ✓
Implement Retrieval-Augmented Generation (RAG) by grounding prompts with a knowledge base.
Why this is correct
RAG provides factual context from a trusted source, reducing hallucinations.
- ✗
Reduce the max_tokens parameter to limit output length.
Why it's wrong here
Reducing max_tokens does not improve factual accuracy.
- ✗
Add a system message instructing the model to be more careful.
Why it's wrong here
System messages are not sufficient to prevent hallucinations without grounded data.
Go deeper
Related to this question
About these practice questions
This AI-102 question is part of Courseiva's 945-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AI-102
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An organization is deploying a conversational AI solution using Azure OpenAI. They want to ensure the model's responses are grounded in their own knowledge base documents to reduce hallucinations. Which approach should they implement?
hard- ✓ A.Integrate Azure Cognitive Search for retrieval-augmented generation (RAG)
- B.Fine-tune the model on the knowledge base documents
- C.Implement Azure AI Content Safety filters
- D.Use prompt engineering to instruct the model to only use the knowledge base
Why A: Retrieval-Augmented Generation (RAG) with Azure Cognitive Search allows the model to dynamically retrieve relevant chunks from the organization's knowledge base documents at inference time. This grounds responses in authoritative, up-to-date content, directly reducing hallucinations by providing factual context rather than relying solely on the model's parametric memory.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.