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

  1. Identify which limitations matter for the use case
  2. Use grounding or RAG when current or internal information is needed
  3. 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

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?

  1. Ground answers in the internal policy documents and show sources
  2. Fine-tune the model on policy documents so it memorizes them
  3. Lower temperature to reduce variation in answers
  4. 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?

  1. Evaluate from diverse viewpoints, and revisit data or operations if bias is found
  2. Models are neutral, so there's no need to check for bias
  3. Bias is unrelated to training data, so don't check the data
  4. 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

  1. Set business KPIs and quality metrics and track them
  2. Manage model versions and evaluate before updating
  3. 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

Mini quiz

Q1. Which are the best example metrics to track in “continuous monitoring” of generative AI models?

  1. Length of the model's name and color of its logo
  2. Employees' commuting time and office days
  3. Age of the data center building
  4. 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?

  1. Version management is needed only for image generation
  2. Model updates change output, so record versions to compare and roll back
  3. Higher version numbers always mean lower fees
  4. 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

  1. Try simple tasks with zero-shot first
  2. Show few-shot examples to standardize output format
  3. Split complex work into stages with prompt chaining
  4. 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

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?

  1. Prompt chaining (run several prompts in order)
  2. Zero-shot prompt (instructions only)
  3. Few-shot prompt (several examples)
  4. 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?

  1. Brightening image colors
  2. Writing a one-word greeting
  3. Translating a single word
  4. 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

  1. Decide which sources answers should be based on
  2. Ground internal information with RAG or Agent Search
  3. Use grounding with Google Search for current general information
  4. 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

Mini quiz

Q1. Which correctly describes how RAG (retrieval-augmented generation) works?

  1. Registering model answers in a search engine for other users to see
  2. Converting the question to an image and returning image search results as is
  3. Retrieving relevant information and adding it to the prompt to generate the answer
  4. 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?

  1. You want to fix the model's tone to a specific character's way of speaking
  2. You want to raise accuracy on a specialized classification task with many examples
  3. You want the model to deeply internalize a specific output format
  4. 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

  1. Lower temperature for fact-based answers and classification
  2. Raise temperature somewhat for ideation
  3. Control length and cost with max tokens
  4. 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

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?

  1. Answer accuracy depends on model size; the quality of retrieval results has no effect
  2. The content and freshness of retrieved documents determine the accuracy of generated answers
  3. With a high temperature, retrieval results are ignored and answers come from pretrained knowledge
  4. 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?

  1. Tighten safety settings to block inappropriate words
  2. Lower top-p so the next word is chosen from candidates with high cumulative probability
  3. Lower the output token limit to shorten text and reduce unnatural words
  4. 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)