Prompt Engineering
What prompt engineering is and why it matters
Ask a model to "write about our new running shoe" and you get generic marketing copy. Ask it to "write a 40-word product description for a lightweight trail-running shoe, aimed at weekend hikers, in a friendly tone," and the output is usable. Nothing about the model changed between those two requests. Only the wording did, and that is the whole idea of prompt engineering.
A prompt is the text input you send a large language model (LLM). Prompt engineering is the process of crafting that input to reliably get the output you want, described by Google as an iterative, test-driven process of refining inputs to achieve a specific outcome[1]. You write a prompt, read the response, and adjust the wording, repeating until the answer is accurate and well formatted. The diagram shows that loop.
Why a leader should care
Prompt engineering is the fastest, lowest-cost lever[2] for improving model output. It needs no training data, no labeled examples, and no infrastructure, so a team can improve results in an afternoon instead of a project cycle. That makes it the first lever to reach for, and often the only one a use case needs.
One lever among siblings
Prompt engineering changes the words you send in. It does not add new knowledge to the model or permanently change how the model behaves. When answers must reflect current or private facts, the right lever is grounding, and when the model must consistently perform a specialized task, the right lever is fine-tuning, which adapts the model's weights on labeled examples. Both are covered in their own subtopics. Keeping these separate matters because the exam rewards matching the lever to the problem, and reaching for a prompt tweak when the real gap is missing facts is a classic wrong answer.
Core techniques: shots, roles, and chaining
Suppose you need a model to classify incoming support tickets as billing, technical, or account. Depending on how much you show it in the prompt, you are using one of several named techniques, and they form a clear ladder from showing nothing to showing several examples.
Zero-shot, one-shot, few-shot
A zero-shot prompt gives the model an instruction and no examples, relying on its pre-existing knowledge[1] to respond. A one-shot prompt adds a single worked example of the input and the desired output. A few-shot prompt adds several. Examples teach the model the format, phrasing, and scope you expect, so Google recommends including few-shot examples[3] in most prompts and notes that prompts without them are often less effective. The counterweight is that if you include too many examples, the model starts copying them too closely instead of generalizing to new inputs, which is what overfitting means, so a few well-chosen examples usually beat a long list. The diagram places the three on that ladder.
Role prompting
Role prompting, also called persona prompting, tells the model who to act as. Casting it as a specific persona[4] such as a financial analyst, a friendly retail assistant, or a security reviewer steers the vocabulary, tone, and depth of the answer without any examples. A practical rule from Google's guidance: if you assign a role, define that role in the prompt, because a prompt that refers to a persona it never established leaves the model guessing.
Prompt chaining
Prompt chaining breaks a complex job into a sequence of smaller prompts and feeds each output into the next. Rather than asking one prompt to research, outline, and write a report, you chain the prompts[3]: one summarizes the source, the next drafts an outline from that summary, and a third writes each section. Each step is simpler, easier to check, and easier to fix. The cost is that an error early in the chain flows downstream, so the earliest steps deserve the most scrutiny.
What the three have in common
All three reshape the prompt rather than the model, and each answers a different question: shots decide how much you show the model, role prompting decides who it speaks as, and chaining decides how many steps the job is broken into. Read a scenario for which of those three is missing and the technique names itself.
Advanced techniques: chain-of-thought and ReAct
A single instruction is fine for looking up a fact, but it struggles with a word problem that needs several steps of arithmetic, or with a task that needs information the model does not have. Two advanced techniques address those two different gaps.
Chain-of-thought: show the reasoning
Chain-of-thought (CoT) prompting asks the model to explain its reasoning step by step[5] before giving a final answer. Google's glossary describes CoT as a technique that has the model detail its intermediate reasoning[1] rather than jump straight to a conclusion, which significantly improves performance on complex reasoning tasks. Do not confuse it with prompt chaining from the previous section: chain-of-thought asks for the reasoning steps inside a single prompt, while prompt chaining links separate prompts end to end, feeding each output into the next. In practice, adding a line like "explain your reasoning step by step" can turn a wrong one-line answer into a correct worked-through one. The trade is length: the model produces more text, which costs more and takes longer, so reserve CoT for problems that genuinely need multi-step reasoning.
ReAct: reason and act
CoT reasons but cannot look anything up. ReAct, short for reasoning and acting, adds that missing half. The model interleaves a reasoning step with an action, such as calling a tool or running a search, then reads the result and reasons again, repeating until it can answer. The diagram shows that loop of thought, action, and observation. This reasoning-and-acting pattern is the conceptual basis of AI agents, which on Google Cloud run on Vertex AI Agent Engine[6], a runtime where the model decides which actions to take and in what order. The agent tooling subtopic covers the products. Here the point is that ReAct is what lets a model move beyond its own knowledge and interact with live systems.
Which of the two
Reach for CoT when the task is self-contained reasoning the model can do from what it already knows, such as math, logic, or planning. Reach for ReAct when the task needs facts or actions from outside the model, such as checking an order status or querying a live database. CoT makes the thinking visible; ReAct makes the model able to act on the world.
Exam patterns: matching the technique to the symptom
Exam questions here describe a business situation and a symptom, then ask which prompting technique fixes it. The answer follows from two signals in the stem: how much the model needs to be shown, and whether it needs to reason or reach outside itself.
Read the symptom, name the technique
If the output has the wrong format or tone, the fix is prompt engineering in general, usually few-shot examples[3] that demonstrate the format. If the stem stresses a consistent structure across many responses, that is few-shot. If it stresses a particular voice, persona, or expertise, that is role prompting. If it describes a long task with several stages, that is prompt chaining. If it involves multi-step math, logic, or reasoning the model keeps getting wrong, that is chain-of-thought. If it needs current data, a lookup, or a tool call, that is ReAct.
Common distractors
Two wrong answers recur. The first offers grounding or RAG (retrieval-augmented generation) for a formatting or tone problem, or fine-tuning for a one-off request. Those are heavier levers for different failures: grounding adds facts and fine-tuning changes behavior, when a prompt tweak was all the scenario needed. The second offers more few-shot examples as a cure-all. Past a handful, extra examples cause overfitting and stop helping, and some symptoms, such as stale facts, no number of examples can fix. Match the lever to the symptom: prompting shapes how the model responds, not what it knows.
Watch the vocabulary
The exam uses Google's terms precisely. Zero-shot means no examples, not a quick or careless prompt. Few-shot means a few examples inside the prompt, not fine-tuning on a few files, which is a separate, weight-changing technique. Chain-of-thought is about showing reasoning, while prompt chaining is about linking separate prompts, and the similar names are easy to confuse.
Prompting techniques: what each gives the model and when to reach for it
| Technique | What you give the model | Best for | Watch out for |
|---|---|---|---|
| Zero-shot | An instruction only, no examples | Simple, familiar tasks the model already handles | Vague or inconsistent output on nuanced tasks |
| One-shot | An instruction plus one example | Pinning down a format with a single clear pattern | One example may not cover the real variety of inputs |
| Few-shot | An instruction plus several examples | Consistent format, style, and structure | Too many examples cause overfitting to them |
| Role prompting | A persona or role to adopt | Setting tone, vocabulary, and expertise | A role the prompt relies on but never defines |
| Prompt chaining | One subtask per prompt, output fed to the next | Complex, multi-step workflows | Errors in an early step compound down the chain |
| Chain-of-thought | A request to show reasoning step by step | Math, logic, and multi-step reasoning | Longer, slower, costlier responses |
| ReAct | Reasoning interleaved with tool actions | Tasks needing live data or external tools | Needs tool integration, so it edges into agents |
Decision tree
Sharp facts the exam loves — give these one last read before exam day.
Cheat sheet
Sharp facts the exam loves — scan these before test day.
- Prompt engineering steers output without retraining the model
Prompt engineering is the practice of crafting the words you send a large language model so it returns the output you want, changing nothing inside the model itself. Because it needs no training data, no labeled examples, and no infrastructure, it is the cheapest and fastest lever for improving results, so it is the first one to try. Google describes it as an iterative, test-driven process of refining inputs to reach a specific outcome.
6 questions test this
- A mid-sized insurance company's innovation lead wants to improve the usefulness of Gemini's outputs but has no budget for additional…
- A technology company has limited labeled data and needs to quickly test different generative AI approaches for a new chatbot application.…
- A small e-commerce startup wants a foundation model in Vertex AI Studio to write friendlier product blurbs. The team has no labeled…
- A retail company's customer-experience leader notices that staff using the Gemini app get inconsistent results: some employees receive…
- A chief executive officer questions why employees should spend time carefully wording their requests to the company's Gemini-powered…
- A logistics company must improve a foundation model's call-center reply drafts within two weeks to meet a seasonal demand spike. The model…
- Treat prompting as an iterative loop, not a one-shot write
Good prompts are refined, not written perfectly the first time. The loop is write the prompt, run it, read the output, and adjust the wording, repeating until the answer is accurate and well formatted. Building in a few refinement passes is normal practice rather than a sign the approach is wrong.
- Zero-shot prompting gives an instruction and no examples
A zero-shot prompt states the task and relies entirely on the model's pre-existing knowledge, with no worked examples included. It is the right choice for simple, familiar tasks the model already handles well, where adding examples would only lengthen the prompt.
Trap Reading zero-shot as a hasty or vague prompt; it specifically means no worked examples are supplied, not that the prompt is low-effort.
9 questions test this
- A communications manager needs Gemini in Vertex AI Studio to summarize a single, well-structured news article. The task is straightforward,…
- A leader is comparing prompting options for Gemini in Vertex AI Studio and asks what one-shot prompting adds compared with zero-shot…
- A marketing team is experimenting with prompting techniques in Vertex AI Studio to generate product descriptions. They want to quickly test…
- A business leader is documenting the prompting approaches their analytics team uses with Gemini in Vertex AI Studio. They want to label the…
- A multinational retailer wants Gemini in Vertex AI Studio to translate short English product names into Spanish for an online catalog. This…
- A business leader is reviewing prompting practices and wants to understand which approach asks the model to perform a task using only an…
- A financial services firm wants to use Gemini in Vertex AI Studio to draft plain-language definitions of widely known investment terms for…
- A business analyst is designing prompts in Vertex AI Studio for a straightforward task that the model handles well with its general…
- A communications officer needs Gemini to translate a short internal announcement from English into Spanish. The task is common and…
- One-shot prompting supplies a single worked example
A one-shot prompt includes exactly one example of the desired input and output to demonstrate the pattern you want. It fits when a single example is representative enough to pin down the format, and it sits one rung above zero-shot on the example ladder.
12 questions test this
- A leader is comparing prompting options for Gemini in Vertex AI Studio and asks what one-shot prompting adds compared with zero-shot…
- A product team uses Gemini to rewrite blog titles in their brand's distinctive voice. To guide the model, a writer pastes exactly one prior…
- A finance team uses Gemini in Vertex AI Studio to draft a quarterly investor-update blurb that must match a particular layout and phrasing…
- A regional manager wants Gemini in Vertex AI Studio to format weekly team status updates to match exactly one report format that leadership…
- A UX writer wants Gemini to generate in-app error messages that follow the product's consistent, friendly wording style. A direct…
- An operations lead has only one carefully prepared example of a desired inventory report layout and limited time to gather more. The task…
- A recruiting coordinator wants Gemini to generate polite interview-decline emails in a specific, warm tone. The coordinator pastes one…
- A support operations manager asks Gemini to reformat a knowledge-base article so it matches the company's house style. The manager pastes…
- A customer success lead wants Gemini to write a subscription renewal-reminder message that matches the company's preferred tone. A plain…
- A human resources team wants Gemini in Vertex AI Studio to rewrite hiring-manager notes into job descriptions that follow one specific…
- A product team wants Gemini to convert short feature descriptions into a specific marketing tagline format. They have one strong example of…
- A legal operations team wants Gemini in Vertex AI Studio to extract clauses from contracts into an unusual two-part annotation structure…
- Use few-shot examples for consistent format and style
A few-shot prompt includes several worked examples that teach the model the format, phrasing, and scope you expect, which is why Google recommends including them for most non-trivial tasks. The counterweight is a ceiling: too many examples cause the model to overfit to them and generalize worse, so a handful of well-chosen examples beats a long list.
Trap Piling on more and more examples expecting steady gains; past a few, extra examples overfit the model to them rather than improving the answer.
16 questions test this
- A logistics analyst uses Gemini in Google AI Studio to convert freeform delivery updates into a small set of fixed labels such as 'In…
- A customer service team uses Vertex AI Studio for automatic email classification. Their zero-shot prompt provides instructions to…
- An operations analyst is using the Gemini app to extract product details from messy supplier descriptions and return them in a strict,…
- A data analytics team uses a simple zero-shot prompt in Vertex AI Studio to classify customer feedback sentiment with Gemini, but the label…
- A marketing team wants to use Vertex AI Studio to classify customer feedback emails into categories such as 'Complaint', 'Suggestion', or…
- A customer experience manager wants to use the Gemini app to classify incoming support tickets into categories such as 'Billing',…
- A retail merchandising analyst uses Gemini in Google AI Studio to sort incoming product descriptions into seasonal collections such as…
- A compliance analyst uses Gemini in Google AI Studio to flag potential policy-violation phrases in employee messages. Violations take many…
- A customer insights team uses Gemini in Google AI Studio to rate open-ended survey comments on a five-level satisfaction scale. A plain…
- A market research team uses Gemini in Vertex AI Studio to produce competitive-analysis briefs that must follow several recurring structural…
- A marketing team is using Vertex AI Studio to generate product descriptions. They want the model to produce descriptions in a specific…
- A media company wants Gemini in Vertex AI Studio to tag opinion articles using its own custom editorial tone scale, which has several…
- A business leader is comparing prompting approaches their team uses with Gemini in Vertex AI Studio. They want to identify the approach…
- A product team is using Vertex AI Studio to generate product descriptions. Initially, they provide only an instruction like 'Generate a…
- A customer service team is setting up a text generation task in Vertex AI Studio. They want the model to respond to customer inquiries in a…
- A customer-experience lead at a travel agency finds that when a foundation model in Vertex AI Studio is shown two or three sample…
- Role prompting casts the model as a persona to steer tone and depth
Role prompting, also called persona prompting, tells the model who to act as, such as a financial analyst or a support agent, which shapes the vocabulary, tone, and depth of the answer with no examples needed. Google's guidance adds a practical rule: if you assign a role, define it in the prompt, because a prompt that refers to a persona it never established leaves the model guessing.
Trap Referring to a persona the prompt never actually defined; the model cannot consistently adopt a role it was never given.
10 questions test this
- A hospitality company is building a virtual concierge with Vertex AI Agent Builder. They want the agent to consistently respond as a…
- A wealth management firm wants to use the Gemini app to draft client-facing investment update emails that consistently read as if they were…
- A hotel chain's guest-experience team wants a Gemini-powered assistant to answer guest messages as though it were a warm, knowledgeable…
- A pharmaceutical company's communications team wants a generative AI assistant built on Gemini to draft patient-facing materials that…
- A marketing manager configures a Gemini-based agent to write all of the brand's social media posts in the distinctive, playful voice of its…
- An IT department is building a custom support agent with Vertex AI Agent Builder. They want the agent to consistently respond as a patient,…
- A travel-booking company wants its Gemini-powered help responses to consistently sound like a cheerful, well-traveled trip advisor. Each…
- A corporate sustainability team wants Gemini to draft employee-facing materials that consistently reflect the perspective, judgment, and…
- A wealth management firm wants a Gemini-powered assistant to reply to routine client emails so that every response consistently reflects…
- A B2B software company wants to use the Gemini app to draft customer-facing FAQ answers that consistently read as if written by an…
- Prompt chaining splits a complex job into linked prompts
Prompt chaining breaks a complex task into a sequence of smaller prompts and feeds each output into the next, so one prompt summarizes, the next outlines, and a third writes. Each step stays simple and easy to check, but an error in an early step flows downstream, so the earliest prompts deserve the most scrutiny.
Trap Trusting a long chain without checking the early steps; a mistake in the first prompt is carried into every prompt that follows it.
7 questions test this
- A market research analyst uses Gemini to turn thousands of open-ended survey responses into a client recommendations report. The process…
- A compliance analyst uses Gemini to process incident reports in stages: first extract the key facts, then classify the severity from those…
- A regional operations manager uses Gemini to produce a quarterly business review. The process must first summarize each region's metrics,…
- A marketing operations manager wants Gemini to power a content workflow in which the model first generates a campaign theme, then uses that…
- A product team receives thousands of customer reviews in multiple languages. They want Gemini to first translate the reviews into English,…
- A product management team at a software company wants to use Gemini to turn a raw feature brief into polished documentation through an…
- A recruiting team wants to use Gemini to process applications through an ordered sequence of dependent steps: first summarize each resume,…
- Chain-of-thought asks the model to show its reasoning steps
Chain-of-thought (CoT) prompting has the model spell out its intermediate reasoning before giving a final answer, which significantly improves accuracy on math, logic, and other multi-step problems. The cost is length: the model produces more text, so it is slower and more expensive, which is why CoT is reserved for tasks that genuinely need multi-step reasoning.
Trap Adding chain-of-thought to a simple lookup or one-step task; it only adds tokens, latency, and cost without improving a direct answer.
3 questions test this
- A financial planning team uses a foundation model on Vertex AI to work through multi-step budgeting and tax calculations. The model often…
- A financial planning analyst asks Gemini to evaluate whether a proposed equipment purchase will pay for itself. Reaching a conclusion…
- A procurement analyst uses Gemini to recommend a single supplier from several competing bids. Reaching a justified recommendation requires…
- ReAct interleaves reasoning with actions and observations
ReAct, short for reasoning and acting, has the model reason about the task, take an action such as calling a tool or running a search, read the result, and reason again, looping until it can answer. This lets the model use information beyond its own training, and the reasoning-and-acting pattern is the conceptual basis of tool-using agents.
Trap Choosing chain-of-thought when the task needs live data or a tool; CoT reasons but cannot look anything up, so a lookup calls for ReAct.
3 questions test this
- An online electronics retailer is building a shopping-assistant agent with Vertex AI Agent Builder. To help a shopper, the agent must…
- An IT operations leader is building a service-desk agent with Vertex AI Agent Builder. When an employee reports an outage, the agent must…
- A logistics company is building a customer-service agent with Vertex AI Agent Builder that must reason about a shipping question and then…
- Match the prompting technique to the symptom in the task
The technique follows from the failure you see. Wrong format or tone points to few-shot examples, a consistent structure across responses to few-shot, a specific voice to role prompting, a long multi-stage job to prompt chaining, hard multi-step reasoning to chain-of-thought, and a need for live data or tools to ReAct.
Trap Reaching for more few-shot examples as a universal fix; some failures, such as stale facts, no number of examples can solve.
- Prompting cannot add facts the model never learned
Prompt engineering changes the wording, not the model's knowledge, so it cannot supply current events or private data the model was never trained on. When answers must reflect fresh or authoritative facts, grounding or retrieval-augmented generation (RAG) is the correct lever, not a cleverer prompt.
Trap Adding examples or rephrasing to fix outdated or missing facts; wording shapes format, not knowledge, so the fix is grounding or RAG.
- Fine-tuning, not prompting, changes model behavior at scale
When a specialized task or house style must hold consistently across every request, fine-tuning adapts the model's weights on labeled examples, whereas prompting only shapes a single response and does not persist. Prompting is the lighter, cheaper lever, so you reach for fine-tuning only when prompt techniques cannot reach the needed consistency.
Trap Fine-tuning to add fresh facts; tuning changes behavior and style, not knowledge freshness, which is grounding's job.
- Chain-of-thought and prompt chaining are different techniques
The similar names hide a real difference. Chain-of-thought is a single prompt that asks the model to expose its reasoning steps, while prompt chaining links several separate prompts in sequence, passing each output to the next. One is about visible reasoning inside one prompt, the other about wiring prompts together.
Trap Treating chain-of-thought and prompt chaining as the same thing because the names rhyme; they operate at different levels, one inside a prompt and one across prompts.
- Few-shot prompting is not fine-tuning on a few examples
Few-shot means placing a few worked examples inside the prompt at request time, and nothing is trained or permanently changed. Fine-tuning on a few examples instead updates the model's weights, so the shared word 'few' hides two very different mechanisms with different costs and durability.
Trap Reading few-shot prompting as a lightweight form of fine-tuning; few-shot trains nothing and only adds examples to the prompt.
- Put the needed context and clear instructions in the prompt
Rather than assuming the model already has the facts and constraints a task needs, include them in the prompt, and state specific instructions instead of vague ones. Adding the relevant context and being explicit about the desired output is often the single biggest, lowest-effort quality improvement.