3: Techniques to Improve Gen AI Model Output

    Describe the limitations of foundation models and gen AI output, including data dependency, knowledge cutoff, bias, fairness, hallucinations, and edge cases

    A foundation model is a probabilistic next-token engine trained on a frozen snapshot of text, images, audio, or code.

    Every decision the model makes during inference is a function of that frozen snapshot plus the live prompt.

    The business consequence is that the model has no awareness of the world beyond its training window, no awareness of the enterprise's private data, and no built-in mechanism to refuse a request it cannot answer factually.

    Leaders who treat foundation models as databases or search engines build solutions that look fluent in a demo and fail in production.

    The first lever for a successful gen AI program is honest classification of where the model will fail, which then drives the choice of remediation technique covered later in this chapter.

    Key points

    The six failure categories on the official outline are not independent.

    • Data dependency is the root cause: the model only knows what was in its training corpus.
    • Knowledge cutoff is the time-domain projection of data dependency.
    • Bias and fairness are the distributional projections, where the training corpus over-represents some perspectives and under-represents others.
    • Hallucination is the inferential projection, where the model invents a continuation that fits the statistical pattern of fluent prose without any verification against ground truth.
    • Edge cases are the operational projection, where rare or adversarial inputs land outside the dense region of the training distribution and the model's behaviour becomes unpredictable.

    A leader who understands the shared root cause can pattern-match a customer complaint to a category in seconds and route it to the right remediation team.

    Data dependency

    Foundation models are entirely a function of the data on which they are trained. A model trained on English-language web text reflects the demographic, linguistic, and topical distribution of that web text.

    It will perform well on subjects that are widely discussed online (popular software libraries, mainstream consumer products, common business processes) and poorly on subjects that are sparsely represented (a private contract template, a proprietary part-numbering scheme, a regional dialect outside the training set). Data dependency is the reason a generic Gemini call cannot quote a customer's internal HR policy verbatim: the policy never appeared in the training corpus, so the model has no probability mass concentrated on the correct sequence of tokens.

    The business implication is that any use case that relies on internal documents, internal product catalogues, or internal numerical records must add a retrieval layer; no amount of clever prompting alone can recover information the model never saw.

    The same property applies in reverse: the model has absorbed the biases, errors, and noise present in the training corpus. If the corpus contains many forum threads with incorrect tax advice, the model will reproduce that incorrect tax advice with the same confident tone as it reproduces correct tax advice.

    The model has no internal mechanism for separating verified statements from unverified statements, because every training example was treated as a sequence to learn. Leaders should treat the training corpus as the model's worldview and assume the model will defend that worldview unless given external evidence.

    Knowledge cutoff

    Every foundation model has a knowledge cutoff: the date after which no further data was included in pre-training.

    Asking a model about an event that occurred after the cutoff produces one of three outcomes, all bad for the business:

    • The model can refuse to answer (best case for trust, worst case for user experience).
    • The model can answer using its closest pre-cutoff knowledge and produce a stale but plausible response (worst case for trust, fluent for the user).
    • The model can fabricate a fictional answer that fits the pattern of the question (the hallucination path).

    Knowledge cutoff is the reason every grounded gen AI product on Google Cloud either retrieves from a fresh data store (Vertex AI Search, the RAG Engine, BigQuery) or invokes a live search tool (Google Search grounding) before generating the response.

    The cutoff is not a single global property of the model family. Different Gemini versions, different fine-tuned variants, and different distilled models can each have different cutoffs. When evaluating a model for a use case, treat the cutoff as a product attribute the same way a leader treats latency or price.

    📊 Limit: Google Search grounding for Gemini on Vertex AI returns the response with citations and a googleSearchQueries array, and is metered separately from the model tokens. The public pricing page publishes the per-1000-requests fee for Google Search grounding; verify the current rate on the Vertex AI pricing page before committing to a unit-economics model.

    Bias and fairness

    Bias and fairness are related but distinct concepts.

    Bias describes a statistical skew in the model's outputs that reflects a skew in the training corpus or the human feedback loop.

    Fairness describes a normative judgement about whether the observed bias produces an unjust outcome for a person or a group.

    A model can be statistically unbiased on a benchmark and still produce unfair outcomes in a specific business context, because the benchmark and the business context measure different things.

    Conversely, a model can show a measurable bias on a metric (for example, sentiment scores skewed toward one product brand) that does not translate into a fairness concern (because the brand differential reflects genuine product-quality differences in the training data).

    How it works

    The Google AI Principles, introduced in Chapter 1 and revisited in Chapter 4 of this course, set the policy frame for fairness in any production gen AI deployment.

    The operational tooling sits in Vertex AI:

    • The model evaluation service supports curated and custom fairness metrics.
    • The Responsible AI safety filters apply to every generation call by default.
    • The safety_settings parameter on the Gemini API lets a product team raise or lower the thresholds per harm category (hate speech, harassment, sexually explicit content, dangerous content).

    The Leader-level decision is not which threshold to set but who owns the threshold.

    A common anti-pattern places threshold ownership with the engineering team, which optimises for false-positive rate; the responsible-AI office must own the threshold for any customer-facing product, because the office bears the reputational cost of false negatives.

    💡 Exam Trap: Treating bias and fairness as the same concept. The exam asks the reader to identify which of bias and fairness is a statistical property of model output and which is a normative judgement about impact on people. Bias is the statistical skew; fairness is the impact assessment. A model that has measurable bias may still be deployed if the use case shows no fairness harm; a model that shows fairness harm must be remediated regardless of the bias metric.

    Hallucinations

    Hallucination is the production of fluent, well-formed text that asserts a fact that is not supported by the training data or by any retrieved evidence. Hallucinations are a structural feature of large language models, not a bug to be patched out.

    The model is a next-token engine; when the correct token has no probability mass (because the model has never seen the correct answer), the engine selects the highest-probability incorrect token. From the user's perspective the output reads as confident, because the model has no token for hedging unless one is prompted in.

    Three properties make hallucinations particularly dangerous in a business setting. First, the confidence signal is decoupled from the correctness signal: the model writes wrong answers in the same prose register as right answers.

    Second, hallucinations are not random; they cluster around plausible-sounding entities (a fictitious legal precedent, a fictitious medical citation, a fictitious internal policy number) that pass casual review. Third, downstream automation amplifies the harm: a hallucinated invoice number, account number, or product code that flows into a transactional system can produce a real financial loss before any human notices.

    The remediation stack is layered. Grounding to a verified knowledge source (covered in the next section and in Section 4 of this chapter) caps the model's freedom to invent.

    Lower temperature reduces the probability of selecting low-probability tokens. Chain-of-thought prompting reduces hallucinations on multi-step reasoning by exposing each step for verification.

    Citations exposed to the user shift the verification burden onto the user (acceptable for search-style products, unacceptable for autonomous transaction products). Human-in-the-loop review provides a final filter for high-stakes outputs.

    ⚠️ Anti-Pattern: "We ran an internal accuracy test on 200 prompts and the hallucination rate was under five percent, so we are shipping to production." Hallucination rate measured on a curated test set is not the production rate. Production traffic exposes the model to a longer tail of inputs, including adversarial prompts, prompts in low-resource languages, and prompts that combine multiple domains. Production deployments require ongoing evaluation against live traffic samples and a roll-back plan tied to a published quality threshold.

    Edge cases

    Edge cases are inputs that lie in low-density regions of the training distribution.

    The model's behaviour on these inputs is not predictable from its behaviour on dense regions, because the loss function during pre-training rewarded average performance on common inputs, not worst-case performance on rare inputs. Examples include:

    • prompts in rarely-spoken languages
    • prompts that combine specialised vocabularies from two domains (for example, biotech regulation written in legal French)
    • prompts containing adversarial prefixes designed to override system instructions
    • prompts referencing rare named entities
    • prompts at the boundaries of the supported modality set (a multimodal model receiving a corrupted image, a long-context model receiving a near-cutoff document)

    Edge cases are the dominant operational risk for autonomous agents, because an agent that loops over its own output amplifies edge-case behaviour.

    A small probability of an edge-case input on each agent step compounds across the loop, so a multi-step agent's overall reliability is bounded by the per-step reliability raised to the number of steps.

    Leaders planning agent deployments must budget for a step-count ceiling and a confidence-based stop condition.

    🎯 Scenario: A logistics director plans to deploy a Gemini-powered agent that answers customs-classification questions for a multinational shipper. A pilot on 500 well-formed questions shows 97 percent agreement with the in-house customs team. The director asks whether the agent can replace the first-line desk for the holiday peak. The right answer is no, for two reasons. First, the 500-question pilot under-samples the long-tail of edge-case inputs (regional dialects, ambiguous photographs of cargo, multilingual shipping manifests) that drive holiday-peak traffic. Second, customs errors carry asymmetric cost: a wrong classification can trigger fines and a load hold, whereas a referred question only costs a minute of human time. The recommended posture is to ship the agent as an assistant to the human desk with a confidence-based escalation, not as an unattended replacement, then revisit after eight weeks of telemetry.

    How the limitations map to remediation techniques

    Each limitation has a matched remediation technique.

    • Data dependency and knowledge cutoff are remediated by grounding (point the model at a fresh, authoritative data source).
    • Bias and fairness are remediated by a combination of model selection, prompt design, safety filters, and structured human review.
    • Hallucination is remediated by a stack of grounding, lower temperature, chain-of-thought, citation exposure, and human review.
    • Edge cases are remediated by input validation, confidence-based escalation, and human-in-the-loop.

    The Leader-level discipline is to name the limitation first and the technique second, not the other way around. Teams that pick a technique first (for example, "we are doing RAG") and then look for a problem to apply it to end up over-spending on infrastructure that does not match the actual failure mode.

    💡 Exam Trap: Confusing data dependency with knowledge cutoff. Data dependency is the more general property (the model only knows what it was trained on). Knowledge cutoff is the time projection of that property (the model only knows what was in the training set before a specific date). A model can have a recent cutoff and still fail on a niche enterprise topic because of data dependency, since the enterprise's private data was never in the training set regardless of date. The exam tests whether the reader can pick the right vocabulary word for each scenario.

    Visualising the limitation-to-technique map

    The matrix below names the dominant remediation technique for each limitation category. The matrix is a starting heuristic; production deployments usually layer two or three techniques.

    LimitationDominant remediationSecondary remediation
    Data dependency on private dataGrounding with first-party data (RAG)Fine-tuning for tone and format
    Knowledge cutoffGrounding with world data (Google Search) or fresh RAG corpusScheduled re-evaluation of model version
    BiasModel selection and prompt designSafety filters and human review
    FairnessResponsible-AI review and human-in-the-loopCurated evaluation metrics on Vertex AI Evaluation
    HallucinationGrounding with citationsLower temperature, chain-of-thought, HITL
    Edge casesInput validation and confidence-based escalationHuman-in-the-loop, agent step-count ceiling

    Decision Anchor

    Choose to invest in grounding when the dominant failure mode is missing or stale knowledge. Choose to invest in safety filters, prompt design, and human review when the dominant failure mode is harmful or unfair output. Choose to invest in fine-tuning only after grounding and prompt design fail to deliver the required tone, format, or domain accuracy. ---

    Continue with the interactive course

    Track your progress, jump into practice questions and use the Shark AI tutor inside the GCP - Generative AI Leader learning hub.