Prompting, grounding, RAG or tuning on Google Cloud
Match each foundation model limitation to the right fix: prompting, grounding, RAG, fine-tuning or human review, plus sampling settings and monitoring.
9 min readBy AI Guru AcademyFacts last checked
By AI Guru Academy
In short
Foundation models have predictable limits: they only know what they were trained on, their knowledge stops at a cutoff date, they can reflect bias, they can state wrong things confidently, and they can fail on unusual cases. Each limit has a usual remedy. Prompt engineering fixes unclear instructions and format. Grounding and retrieval-augmented generation (RAG) fix missing or out-of-date knowledge by giving the model trusted information at the moment it answers. Fine-tuning changes the model's behaviour or style for a specialised task. Human in the loop catches what automation should not decide alone. This is the "techniques to improve gen AI model output" section of the Google Cloud Generative AI Leader exam, about 20% of it.
What are the common limitations of foundation models?
| Limitation | What it looks like |
|---|---|
| Data dependency | The model only knows patterns in its training data; gaps there become gaps in answers |
| Knowledge cutoff | It does not know events or changes after its training data ends |
| Bias and fairness | It can repeat or amplify unfair patterns from its data |
| Hallucinations | It produces fluent, confident content that is wrong or unsupported |
| Edge cases | It handles common inputs well but fails on rare or unusual ones |
Which remedy fixes which limitation?
| If the problem is... | Start with... | Why |
|---|---|---|
| Vague or inconsistent output | Prompt engineering | Clear instructions, examples and format fix most quality issues cheaply |
| Missing company knowledge or out-of-date facts | Grounding or RAG | The model answers from trusted, current sources you supply |
| Hallucinated facts or no citations | Grounding or RAG | Answers tied to sources can be checked |
| A specialised style, format or task the model does poorly even with good prompts | Fine-tuning | Training on your examples changes the model's behaviour |
| High-stakes or edge-case decisions | Human in the loop | A person reviews before the output is used |
| Bias | Better data, evaluation and human review | No single technique removes bias; it needs ongoing checks |
The order matters. Google's tuning guidance recommends starting with prompting before you tune. Prompting is fast and cheap, grounding adds knowledge without retraining, and tuning costs more time and data. A common exam trap is choosing fine-tuning to add knowledge that changes often: grounding is the better fit, because a tuned model is frozen at the time of tuning.
Which prompting techniques should you know?
Google's prompting guidance describes prompts with no examples as zero-shot and prompts with examples as few-shot. The exam guide lists these techniques:
- Zero-shot: just the instruction. Good for simple, common tasks.
- One-shot: one example in the prompt (a few-shot prompt with a single example).
- Few-shot: several examples showing the input and the expected output. Good for a consistent format or tone.
- Role prompting: give the model a persona, such as "You are a compliance reviewer", usually in system instructions.
- Prompt chaining: break a complex task into steps, with each prompt's output feeding the next.
Two advanced techniques help with reasoning:
- Chain-of-thought prompting: ask the model to reason step by step before answering. Use it for multi-step logic or calculations.
- ReAct: the model loops through thought, action and observation, using tools until the task is done. It is the pattern behind many agents.
What is grounding, and how does RAG fit in?
Grounding connects a model's answer to verifiable information. The exam guide distinguishes three sources:
- First-party enterprise data: your own documents and databases, such as policies or product catalogues.
- Third-party data: data from outside providers you license or connect to.
- World data: public information on the web.
RAG is the most common way to ground in your own data. The system retrieves the most relevant passages for a question and adds them to the prompt, so the model answers from them. RAG makes answers more current and specific, reduces hallucinations and lets you cite sources. Its quality depends on retrieval: if the wrong passages come back, the answer will be wrong too.
The exam guide names three Google Cloud grounding offerings:
| Offering | Use it when |
|---|---|
| Pre-built RAG with Agent Search | You want managed, Google-quality search and answers over your own data with little engineering |
| RAG APIs (RAG Engine) | Developers need more control over how private data is chunked, indexed and retrieved |
| Grounding with Google Search | Answers need world knowledge or up-to-date public information |
Example (fictional): Northwind Travel's assistant must quote current visa rules (world data, often changing) and the company's own refund policy (first-party data). Grounding with Google Search covers the first and Agent Search over the policy documents covers the second. Fine-tuning would fit neither, because both change.
How do sampling parameters and settings control output?
The exam guide lists the main settings:
| Setting | Effect |
|---|---|
| Token count and output length | Max output tokens caps how long the response can be; a token is roughly four characters |
| Temperature | Lower values make output more focused and repeatable; higher values make it more varied and creative |
| Top-p (nucleus sampling) | Limits choices to the most likely words whose probabilities add up to p; lower values make output more focused |
| Safety settings | Content filters that block harmful categories of output; they block, they do not steer |
One current detail: Google's documentation says that for Gemini 3.6 Flash and later models, custom temperature, top-p and top-K values are ignored. The concepts still appear on the exam, so learn what each setting does.
How do you keep a gen AI system healthy after launch?
Improving output is not a one-off. The exam guide lists practices for continuous monitoring and evaluation: key performance indicators, security patches and updates, versioning, performance tracking, drift monitoring, automatic model upgrades and Agent Platform Feature Store. In practice that means pinning model versions and re-testing before upgrades (Google publishes model retirement dates), evaluating output quality regularly, and monitoring data drift in deployed ML models.
Key takeaways
- Limits: data dependency, knowledge cutoff, bias, hallucinations and edge cases.
- Prompt first, ground or use RAG for knowledge, tune for behaviour, and keep humans in the loop for high stakes.
- Know zero-, one- and few-shot, role prompting, prompt chaining, chain-of-thought and ReAct.
- Grounding sources: first-party, third-party and world data; offerings: Agent Search, RAG APIs, Grounding with Google Search.
- Temperature and top-p control variety, output length caps size, safety settings filter.
FAQ
What is the difference between grounding and RAG?
Grounding is the goal: tying answers to trusted information. RAG is a common way to achieve it with your own data, by retrieving relevant passages and adding them to the prompt.
When should I fine-tune instead of using RAG?
Fine-tune when you need to change how the model behaves, such as a specialised format or task, and prompting is not enough. Use RAG or grounding when the model needs knowledge, especially knowledge that changes.
What does temperature do?
It controls randomness. Lower temperature gives more focused, repeatable answers; higher temperature gives more varied ones.
What is chain-of-thought prompting?
Asking the model to work through a problem step by step before giving the answer, which helps on multi-step reasoning tasks.
What is Grounding with Google Search for?
Connecting a model's answers to public web information, for world knowledge and up-to-date facts.
Sources
- Generative AI Leader exam guide (PDF): https://services.google.com/fh/files/misc/generative_ai_leader_exam_guide_english.pdf
- Few-shot examples in prompts: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/prompts/few-shot-examples
- Choose a design pattern for agentic AI (ReAct): https://docs.cloud.google.com/architecture/choose-design-pattern-agentic-ai-system
- Grounding with Google Search: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/grounding/grounding-with-google-search
- RAG Engine overview: https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/rag-engine/rag-overview
- Content generation parameters: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/content-generation-parameters
- Model tuning on Agent Platform: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/tuning
Last checked 2026-11-22.
AI Guru Academy is an independent training provider and is not affiliated with or endorsed by Google. Google, Google Cloud and Gemini are trademarks of Google LLC.
Next step: see the Generative AI Leader course at /courses/gcp-genai-leader-exam-prep.