GAIL · LESSON 3
Section 3: Techniques to improve generative AI model output約20% · 5 topics
Learn foundation model limitations and countermeasures, continuous monitoring and evaluation, prompting techniques, grounding, and sampling parameters.
3.1Foundation model limitations and countermeasures
Foundation model limitations (data dependency, knowledge cutoff, bias, fairness, hallucination, edge cases) and countermeasures (grounding, RAG, prompt engineering, fine-tuning, Human in the Loop)
Concept
Foundation models depend on training data, have a knowledge cutoff (no information after training), bias and fairness issues, hallucination, and weakness on rare cases (edge cases). Countermeasures are grounding (tying to trusted sources), RAG, prompt engineering, fine-tuning and Human in the Loop (human review).
How it works / steps
- Identify which limitations matter for the use case
- Use grounding or RAG when current or internal information is needed
- Add human review for high-impact decisions
Workplace example
In a chat that answers about the latest pricing plans, ground answers in the price list data and show sources to avoid knowledge cutoff problems.
Common confusions and exam tips
- Fine-tuning isn't suited to adding new facts (RAG is)
- Hallucination can't be eliminated completely
- Human in the Loop is human judgment at key points, not reviewing everything
Mini quiz
Q1. For a chat answering internal policy questions, you want users to be able to verify the basis of answers. Which method fits best?
- Ground answers in the internal policy documents and show sources
- Fine-tune the model on policy documents so it memorizes them
- Lower temperature to reduce variation in answers
- Enable Grounding with Google Search to supplement answers with web information
Show answer and explanation
Answer: A Ground answers in the internal policy documents and show sources
Grounding shows the basis for output and reduces hallucination. [Other options] Fine-tuning shows no sources and handles policy updates poorly. Google Search doesn't cover internal policies. Temperature controls stability, not evidence.
Q2. What is the most appropriate countermeasure to the “bias” limitation of foundation models?
- Evaluate from diverse viewpoints, and revisit data or operations if bias is found
- Models are neutral, so there's no need to check for bias
- Bias is unrelated to training data, so don't check the data
- Hide biased output so users don't notice
Show answer and explanation
Answer: A Evaluate from diverse viewpoints, and revisit data or operations if bias is found
Bias arises from skewed training data and the like. Continuous evaluation is needed.
Reference links
3.2Continuous monitoring and evaluation
Continuous monitoring and evaluation (automatic model upgrades, KPIs, security patches, version management, performance tracking, drift monitoring, Feature Store)
Concept
Generative AI is monitored and evaluated continuously in production too: behavior changes from automatic model upgrades, KPIs, security patches, version management (pinning the model version you use), performance tracking, and monitoring drift (changes in input or output trends). Feature Store centrally manages ML features so the same features are used in training and inference.
How it works / steps
- Set business KPIs and quality metrics and track them
- Manage model versions and evaluate before updating
- Monitor drift and re-evaluate or retrain as needed
Workplace example
When a new model version is released, compare it with the old one on evaluation data and confirm quality doesn't drop before switching.
Common confusions and exam tips
- Automatic upgrades can change output tendencies
- Pre-release evaluation alone won't catch changes in production
- Feature Store is a mechanism for feature consistency
Mini quiz
Q1. Which are the best example metrics to track in “continuous monitoring” of generative AI models?
- Length of the model's name and color of its logo
- Employees' commuting time and office days
- Age of the data center building
- Answer accuracy, satisfaction and response time
Show answer and explanation
Answer: D Answer accuracy, satisfaction and response time
Set KPIs, track performance, and detect drift and degradation.
Q2. Why is “version management” of generative AI models important?
- Version management is needed only for image generation
- Model updates change output, so record versions to compare and roll back
- Higher version numbers always mean lower fees
- Pinning a version automatically applies security updates
Show answer and explanation
Answer: B Model updates change output, so record versions to compare and roll back
Choosing between automatic model upgrades and pinning a version is also an operational decision.
Reference links
3.3Prompting techniques
Prompting techniques (zero-shot, one-shot, few-shot, role prompting, prompt chaining, Chain-of-Thought, ReAct)
Concept
Zero-shot gives no examples, one-shot gives one, and few-shot gives several. Role prompting assigns the model a role, prompt chaining runs several prompts in order and links their results, and Chain-of-Thought makes it think step by step. ReAct alternates reasoning and acting (tool use) and underlies agents.
How it works / steps
- Try simple tasks with zero-shot first
- Show few-shot examples to standardize output format
- Split complex work into stages with prompt chaining
- Use ReAct for tasks that think while using tools
Workplace example
Split report writing into a prompt chain of ① summarize data → ② extract issues → ③ write proposals, so each stage's output can be checked.
Common confusions and exam tips
- Few-shot doesn't retrain the model
- ReAct alternates thinking and tool use
- Role prompting alone doesn't guarantee expertise or accuracy
Mini quiz
Q1. You want consistent output format for inquiry classification. The prompt must stay short, and you have only one typical example. Which technique fits best?
- Prompt chaining (run several prompts in order)
- Zero-shot prompt (instructions only)
- Few-shot prompt (several examples)
- One-shot prompt (show one example)
Show answer and explanation
Answer: D One-shot prompt (show one example)
Zero-shot (0 examples), one-shot (1), few-shot (several). [Other options] Zero-shot gives no example, so format varies. Few-shot needs several examples, but only one exists. Prompt chaining splits the work into steps and doesn't demonstrate the format.
Q2. Which task does Chain-of-Thought help most?
- Brightening image colors
- Writing a one-word greeting
- Translating a single word
- Problems requiring step-by-step reasoning
Show answer and explanation
Answer: D Problems requiring step-by-step reasoning
Step-by-step reasoning raises accuracy on complex problems.
Reference links
3.4Grounding
Grounding (first-party, third-party and world data; RAG, Agent Search, RAG API, grounding with Google Search)
Concept
Grounding ties model answers to verifiable sources. Sources include your own data (internal documents, databases), third-party data, and world data (the web). On Google Cloud you can use RAG, Agent Search, the RAG API, and grounding with Google Search (answers based on current web information).
How it works / steps
- Decide which sources answers should be based on
- Ground internal information with RAG or Agent Search
- Use grounding with Google Search for current general information
- Show sources so users can verify
Workplace example
Ground internal policy questions in internal documents and industry news questions in Google Search, showing sources for each.
Common confusions and exam tips
- Grounding with Google Search can't be used for private internal information
- Even with grounding, hallucination doesn't drop to zero
- Source quality determines answer quality
Mini quiz
Q1. Which correctly describes how RAG (retrieval-augmented generation) works?
- Registering model answers in a search engine for other users to see
- Converting the question to an image and returning image search results as is
- Retrieving relevant information and adding it to the prompt to generate the answer
- Training the model on all answers in advance and doing no search at all
Show answer and explanation
Answer: C Retrieving relevant information and adding it to the prompt to generate the answer
RAG reflects current and internal information in answers without retraining the model.
Q2. When is RAG most appropriately preferred over fine-tuning?
- You want to fix the model's tone to a specific character's way of speaking
- You want to raise accuracy on a specialized classification task with many examples
- You want the model to deeply internalize a specific output format
- You want answers with evidence from frequently updated internal information
Show answer and explanation
Answer: D You want answers with evidence from frequently updated internal information
Updating information and citing sources is RAG; adapting format, style and tasks is tuning.
Reference links
3.5Sampling parameters
Sampling parameters (token count, temperature, top-p, safety settings, output length)
Concept
Sampling parameters adjust output. Temperature sets randomness (low is consistent, high is diverse), top-p sets the range chosen from high-probability candidates by cumulative probability, and output tokens (max length) control output length and cost. Safety settings decide how strongly to block content in harmful categories.
How it works / steps
- Lower temperature for fact-based answers and classification
- Raise temperature somewhat for ideation
- Control length and cost with max tokens
- Adjust safety thresholds to the use case
Workplace example
For FAQ answers, set temperature to 0.2 for stability; for campaign name ideas, set it to 0.9 for diverse suggestions.
Common confusions and exam tips
- Lowering temperature doesn't guarantee factual accuracy
- Too small a max token count cuts answers off midway
- Loosening safety settings too far raises the risk of harmful output
Mini quiz
Q1. A RAG chat over internal documents answered based on an abolished old rule. What is the most appropriate explanation of the cause?
- Answer accuracy depends on model size; the quality of retrieval results has no effect
- The content and freshness of retrieved documents determine the accuracy of generated answers
- With a high temperature, retrieval results are ignored and answers come from pretrained knowledge
- In RAG the model favors pretrained knowledge and uses retrieved documents only as a supplement
Show answer and explanation
Answer: B The content and freshness of retrieved documents determine the accuracy of generated answers
If outdated or irrelevant documents are retrieved, answers will be wrong. [Other options] In RAG, retrieved documents ground the answer. Temperature controls output variety and doesn't make the model ignore retrieval. Retrieval quality directly affects answers.
Q2. For product descriptions, you want to avoid unlikely, unnatural words while keeping some variety of expression. Which setting should you adjust?
- Tighten safety settings to block inappropriate words
- Lower top-p so the next word is chosen from candidates with high cumulative probability
- Lower the output token limit to shorten text and reduce unnatural words
- Raise temperature so the next word is chosen from more varied candidates
Show answer and explanation
Answer: B Lower top-p so the next word is chosen from candidates with high cumulative probability
Smaller top-p narrows candidates, making output more conservative. [Other options] The token limit sets length. Safety settings control harmful categories. Raising temperature makes unlikely words more likely.
Reference links
Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.
Notes (unofficial, original questions, no pass guarantee)
- The questions on this site are original practice questions written by this site based on publicly available skills outlines and exam guides. They are not actual exam questions.
- Google Cloud, Gemini, Vertex AI and Google Workspace are trademarks of Google LLC. This site is not affiliated with or endorsed by Google.
- This content is a study aid and does not guarantee a pass. Exam content, format and prerequisites may change without notice; always check the latest information on the official page before taking the exam.
- Your accuracy on the mock exam cannot be converted to the official (scaled) score and does not predict a pass or fail.
- Progress is saved only in this browser (localStorage) unless you sign in with Google to sync it. You can delete it from the Cookie & storage settings page (Japanese).