mediumMultiple Choice
Generative AI Leader Practice Question: A developer is building a code generation…
A developer is building a code generation assistant using Codey. They notice that the generated code sometimes contains deprecated API calls. What is the most likely cause?
⚠ Common exam trap
A common trap in Google Gen AI exams is that candidates focus on hyperparameter tuning (temperature, top-p) as the cause for deprecated API calls, but the real issue is the training data's knowledge cutoff. For Codey, this is especially important when using older model versions.
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
✓
Codey's training data has a knowledge cutoff date before the deprecation
Codey, like all large language models, is trained on a static dataset with a specific knowledge cutoff date. If the training data predates the deprecation of certain APIs, the model will not be aware of the newer, recommended alternatives and will continue to generate code using the deprecated calls. This is a fundamental limitation of the model's training data recency, not a parameter tuning issue.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The top-p sampling is too low, limiting the model's vocabulary
Why it's wrong here
Top-p narrows token sampling to the smallest set whose cumulative probability exceeds the threshold; it never injects outdated API names. Raising it widens vocabulary choice, not factual currency. Deprecated calls stem from stale training data or missing retrieval grounding, so top-p tuning would be the right lever only for controlling output diversity or randomness.
- ✗
The temperature setting is too high, causing creative but incorrect outputs
Why it's wrong here
High temperature widens token sampling, producing varied phrasing rather than stale syntax; deprecated API calls trace to the model's training cutoff, not randomness. Temperature tuning suits brainstorming or creative drafting where diversity is wanted. Here the fix is retrieval augmentation or a newer model version supplying current API signatures.
- ✗
The context window is too short to include relevant API documentation
Why it's wrong here
A short context window truncates retrieved documentation, yet Codey still emits deprecated calls when no API reference is supplied at all, so window size is not the operative cause. Context length is the correct lever when relevant documentation exists but is being cut off before the model can condition on it.
- ✓
Codey's training data has a knowledge cutoff date before the deprecation
Why this is correct
Codey's training corpus has a fixed knowledge cutoff, so APIs deprecated after that date remain represented as current in its learned patterns. The model reproduces those stale calls because it has no post-cutoff knowledge, satisfying the deprecated-API symptom described.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.