AI-102 Practice Question: Implement natural language processing solutions
You are developing a chat application that uses Azure OpenAI GPT-4 to answer customer questions. You need to ensure the model does not generate harmful content. Which configuration should you set?
⚠ Common exam trap
Many exam-takers assume a system prompt or parameter tuning (temperature, max_tokens) can guarantee safety, but Azure OpenAI's content filter is the only mechanism that actively blocks harmful content at the service level, regardless of model configuration.
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
✓
Enable the content filter in Azure OpenAI Service.
Azure OpenAI Service includes a built-in content filter that actively scans both input prompts and generated completions to detect and block harmful content such as hate speech, violence, or self-harm. This filter operates at the service level, providing a robust safety layer that cannot be bypassed by model configuration alone. While system prompts can guide behavior, they are not a reliable safeguard against adversarial inputs or model misuse.
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 a system prompt that instructs the model to be safe.
Why it's wrong here
A system prompt is soft guidance the model can be persuaded to ignore through adversarial input, so it cannot guarantee harmful content is blocked. It is tempting because it shapes behaviour cheaply, and it would be correct for steering tone, persona or scope rather than enforcing safety.
- ✗
Set the temperature parameter to 0.
Why it's wrong here
Temperature controls randomness of token sampling, not content safety; zero temperature yields deterministic output that can still be harmful. It is tempting because it constrains variability, and it would be correct when reproducible, factual answers are required for a task.
- ✗
Set max_tokens to a low value.
Why it's wrong here
max_tokens caps response length only; it does not filter or block harmful output, and a short harmful answer is still harmful. It is tempting because it limits generation, and it would be correct when controlling cost, latency or truncating verbose replies.
- ✓
Enable the content filter in Azure OpenAI Service.
Why this is correct
Azure OpenAI Service content filters evaluate both prompts and completions against harm categories (hate, violence, sexual, self-harm) and block or annotate flagged content. Enabling the filter satisfies the requirement to prevent the GPT-4 model from generating harmful output.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI-102 question from scratch — 761 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.