AI-102 Implement generative AI solutions Practice Question
You are a data scientist at a healthcare company. You have deployed a GPT-4 model using Azure OpenAI to answer patient inquiries about medical conditions. The model is configured with temperature=0.3 and max_tokens=200. Recently, the compliance team flagged that some responses contain contradictory information compared to the official medical guidelines. You need to ensure the model's answers align strictly with the provided medical documents (stored as PDFs in Azure Blob Storage). You have access to Azure Cognitive Search and Azure AI Document Intelligence. The solution must minimize hallucinations and not require retraining the model. What should you do?
⚠ Common exam trap
Microsoft often tests the distinction between prompt engineering (which is lightweight but unreliable for grounding) and RAG with a search index (which provides verifiable, document-grounded responses), leading candidates to choose the simpler prompt-only solution without considering its inability to enforce factual accuracy.
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
✓
Index the medical PDFs into Azure Cognitive Search. Configure the Azure OpenAI deployment to use 'Add your data' pointing to this index. Set the system message to instruct the model to base answers only on the retrieved context.
It uses Azure Cognitive Search to index the medical PDFs and then configures the Azure OpenAI deployment with 'Add your data' to retrieve relevant context from that index at inference time. This retrieval-augmented generation (RAG) approach grounds the model's answers in the official documents without retraining, directly addressing the compliance team's requirement to align responses with the provided guidelines and minimize hallucinations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use prompt engineering to add a system message that tells the model to only answer based on the uploaded PDFs. Keep the current deployment.
Why it's wrong here
Prompt engineering alone does not guarantee the model will retrieve or adhere to the documents; it may still hallucinate.
- ✓
Index the medical PDFs into Azure Cognitive Search. Configure the Azure OpenAI deployment to use 'Add your data' pointing to this index. Set the system message to instruct the model to base answers only on the retrieved context.
Why this is correct
This RAG approach grounds the model in the documents, reducing hallucinations and ensuring alignment with guidelines.
- ✗
Fine-tune GPT-4 on the medical documents using Azure OpenAI fine-tuning capabilities. Use the fine-tuned model for the chatbot.
Why it's wrong here
Fine-tuning GPT-4 modifies the model's internal weights, adapting its general knowledge and style to the medical domain, which can reduce generic hallucinations. However, it does not guarantee strict alignment with *specific* external medical guidelines stored as PDFs, nor prevent generation not directly from them. Strict alignment with provided documents requires a retrieval-augmented generation (RAG) approach, grounding responses in retrieved content. Fine-tuning is suitable for adapting a model's overall behaviour or knowledge, not for real-time, document-specific factual adherence.
- ✗
Deploy Azure AI Content Safety to filter responses that contradict guidelines. Set up a custom content filter using a list of approved phrases.
Why it's wrong here
Content Safety filters harmful content, not factual accuracy; it cannot ensure alignment with specific documents.
Quick reference
Azure Blob Storage Tier Comparison
| Tier | Storage Cost | Retrieval Cost | Latency | Use Case |
|---|---|---|---|---|
| Hot | Highest | Lowest | Immediate | Active data, frequent reads |
| Cool | Lower | Higher | Immediate | Data accessed < once / month |
| Cold | Lower still | Higher | Immediate | Data accessed < once / quarter |
| Archive | Lowest | Highest + rehydration delay | Hours | Long-term compliance retention |
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI-102 question from scratch — 945 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.