Generative AI Leader Practice Question: Techniques to Improve Generative AI Model Output
A retail company uses a generative AI model to create personalized product recommendations. The model sometimes generates recommendations that include products the company does not sell. Which technique should be used to prevent the model from generating non-existent products?
⚠ Common exam trap
The trap here is assuming that fine-tuning or prompt engineering can completely eliminate hallucinations, when a validation step is often necessary.
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 a post-processing filter that checks generated product names against the company's inventory database.
A post-processing filter that cross-references generated product names with the company's inventory database ensures that only real products are recommended. This method is direct, reliable, and does not rely on the model's internal knowledge, effectively preventing hallucinations of non-existent products.
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 model's temperature to allow more creative recommendations.
Why it's wrong here
Increasing temperature would make the model more likely to hallucinate non-existent products, worsening the problem. For factual tasks like product recommendations, lower temperature is preferred. This approach does not address the issue and would likely increase errors.
- ✓
Implement a post-processing filter that checks generated product names against the company's inventory database.
Why this is correct
A post-processing filter that validates product names against the actual inventory ensures that only existing products are recommended. This directly prevents the inclusion of non-existent products by catching and removing them before presentation. It is a reliable and straightforward solution for this scenario.
- ✗
Fine-tune the model on a dataset of customer reviews.
Why it's wrong here
Fine-tuning on customer reviews might improve the model's understanding of product sentiment but does not guarantee it will only recommend existing products. Reviews may mention products not in the inventory, and the model could still generate non-existent items. This approach is not directly targeted at the problem.
- ✗
Use a larger context window to include the entire product catalog in the prompt.
Why it's wrong here
Including the entire product catalog in the prompt could help, but it is impractical for large catalogs due to context window limits and cost. Moreover, the model might still hallucinate. A post-processing filter is more efficient and reliable for ensuring only valid products are recommended.
Go deeper
Related to this question
About these practice questions
Courseiva writes every Generative AI Leader question from scratch — 1,008 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This Generative AI Leader practice question is part of Courseiva's free Google Cloud 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 Generative AI Leader exam.