Generative AI Leader Google Cloud's Generative AI Offerings Practice Question
A software company is using Vertex AI to build a generative AI application that creates code snippets from natural language descriptions. They want to improve the model's performance on their specific coding style and libraries. Which two techniques should they use? (Choose two.)
⚠ Common exam trap
The trap here is assuming that infrastructure changes like larger GPUs or evaluation tools can customize model behavior, when in fact they do not affect the model's learned patterns.
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
✓
Use prompt engineering with few-shot examples of the desired code style.
Fine-tuning on a custom dataset and using few-shot prompt engineering are both effective ways to adapt a generative model to a specific coding style. Fine-tuning provides deep customization, while few-shot prompting offers a lightweight alternative. Together, they can significantly improve the relevance and accuracy of generated code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Deploy the model on a larger GPU to increase generation speed.
Why it's wrong here
Using a larger GPU improves inference speed and throughput but does not affect the model's knowledge or ability to generate code in a specific style. It does not address the need to adapt to the company's coding conventions.
- ✗
Use Vertex AI Model Evaluation to compare different models and select the best one.
Why it's wrong here
Model Evaluation helps assess model performance but does not directly improve the model's ability to generate code in a specific style. It is a monitoring tool, not a customization technique, so it does not fulfill the requirement.
- ✗
Increase the model's temperature setting to encourage more creative code.
Why it's wrong here
Adjusting temperature affects randomness in generation; higher values produce more diverse but not necessarily more accurate outputs. It does not teach the model the company's coding style or libraries, so it is not a suitable technique.
- ✓
Use prompt engineering with few-shot examples of the desired code style.
Why this is correct
Prompt engineering with few-shot examples provides the model with concrete instances of the desired output format and style. This guides the model to generate code that matches the company's conventions without retraining, and it is a correct, efficient technique for customization.
- ✓
Fine-tune the Gemini model on a dataset of code snippets and descriptions.
Why this is correct
Fine-tuning a Gemini model on a curated dataset of code snippets and corresponding natural language descriptions adapts the model to the company's specific coding style and libraries. This supervised tuning improves the model's ability to generate relevant code, making it a correct technique.
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.