Generative AI Leader Practice Question: Techniques to Improve Generative AI Model Output
Exhibit
Refer to the exhibit.
```
# Model configuration before change
model = GenerativeModel("text-bison@002")
response = model.generate(
prompt="Summarize the following article: ...",
temperature=0.7,
top_k=40,
top_p=0.95
)
# After change
model = GenerativeModel("text-bison@002")
response = model.generate(
prompt="Summarize the following article: ...",
temperature=0.2,
top_k=10,
top_p=0.85
)
```Refer to the exhibit. The team changed the generation parameters to reduce output variability. However, summaries now often repeat the same phrases. Which parameter change is most likely causing the repetition?
⚠ Common exam trap
Generative AI Leader often tests the confusion between temperature (sharpens distribution, can cause repetition at low values) and top_p/top_k (truncate candidates but preserve randomness), causing candidates to blame the wrong parameter.
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
✓
Reducing temperature from 0.7 to 0.2
Reducing temperature from 0.7 to 0.2 makes the model's token selection much more deterministic, favoring the highest-probability tokens. This low-entropy sampling often causes the model to repeat the same phrases across summaries because it consistently picks the most likely continuation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Reducing top_p from 0.95 to 0.85
Why it's wrong here
Lower top_p also reduces diversity but less impactful than temperature.
- ✓
Reducing temperature from 0.7 to 0.2
Why this is correct
Low temperature increases determinism and repetition.
- ✗
Using the same model text-bison@002
Why it's wrong here
Keeping the same model text-bison@002 changes nothing about decoding; the model version is fixed and identical before and after the parameter edit, so it cannot introduce repetition. Pinning a model version is correct when you need reproducible, stable behaviour across deployments.
- ✗
Reducing top_k from 40 to 10
Why it's wrong here
Reducing top_k from 40 to 10 restricts sampling to the ten highest-probability tokens, which can cause looping, but top_k is a hard cutoff that still samples randomly among those ten, so repetition is less pronounced than with greedy decoding. Top_k is correctly used to bound the candidate pool.
Go deeper
Related to this question
About these practice questions
One of 1,008 original Generative AI Leader practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.