How I Write Prompts For AI (As Taught By Google)


 

AI Prompts 

How I Write Prompts For AI (As Taught By Google)

 The four-part strategy for creating effective ChatGPT prompts

Table Of Contents


How I Write Prompts For AI (As Taught By Google)

Table Of Contents

Prompt Engineering Guidance

What Is Prompt Engineering?

What Is An AI Prompt?

Techniques For Creating Improved Prompts

1. The P-T-C-F Google 4-Part Formula

2. Clearly Define Your Objectives And Goals

3. Provide Context and Background Information

4. Leverage Chain of Thought (CoT) & Verification

What You Need For Prompt Engineering

Types of prompts

Direct Prompts (Zero-shot)

One-, few- and multi-shot prompts

Chain of Thought Prompts

Zero-shot CoT Prompts

Code Generation

Image Generation

Image Generation

Advantages Of Prompt Engineering

Enhanced Performance Of The Model

Decreased Prejudice And Negative Reactions

Enhanced Predictability And Control

Improved User Experience

 

 

Prompt Engineering Guidance

Exciting opportunities for human-computer interaction have emerged with the development of large language models (LLMs). However, unlocking the full potential of these powerful AI models demands a vital skill: prompt engineering. 


This emerging field focuses on developing effective prompts that unleash the potential of LLMs, enabling them to perceive intent, follow instructions, and deliver desired outputs. Prompt engineering is essential to guarantee precise, pertinent, and secure interactions as we engage with AI more frequently in a variety of applications.

What Is Prompt Engineering?

The art and science of creating and refining prompts to direct AI models—especially LLMs—to produce the intended responses is known as prompt engineering. 

You can assist the model comprehend your aim and offer a meaningful response by carefully writing prompts that provide it context, instructions, and examples. Consider it as a road map that directs the AI toward the precise result you have in mind.


Check out the Introduction to Prompt Design on Google Cloud to learn more about prompt design and its uses.


Are you prepared to try prompt engineering and LLMs for yourself? Experience the power of Vertex AI by signing up for a free trial.

What Is An AI Prompt?

The input you give the model to elicit a certain response is known as a prompt in the area of artificial intelligence. This might take many different forms, from straightforward queries or keywords to intricate instructions, pieces of code, or even examples of creative writing. Your prompt's efficacy has a direct impact on the caliber and applicability of the AI's output.

Techniques For Creating Improved Prompts

How to write good AI prompts in 2026

1. The P-T-C-F Google 4-Part Formula

According to Google's study, the most effective suggestions adhere to a particular structural plan. Make sure each prompt incorporates these four foundations for results of a professional caliber:


The Four- Part Formula


Persona

Give the AI a particular role (for example, "You are a senior investment analyst”.

Task


Clearly state the objective using an action verb (e.g., "Summarize this report").

Context

Give background information, restrictions, or reference materials (such as "Focus on 2026 tax changes").

Format

Specify the output's appearance (e.g., "Present as a Markdown table").

It takes a systematic strategy to create suggestions that work. The official framework that Google uses in Workspace and Vertex AI is the gold standard for this in 2026.

2. Clearly Define Your Objectives And Goals


Strategy

Quick Example

To indicate the intended activity, use action verbs.


Write a bulleted list that summarizes the key findings of the attached research paper.

Specify the output's desired length and format.

Create a Persona

Write a 500-word essay explaining how coastal towns are affected by climate change.

Write for young adults who care about the environment as a Sustainability Expert.

3. Provide Context and Background Information


Strategy

Quick Example

Add pertinent information and facts.



Given that global temperatures have risen by 1 degree Celsius since the pre-industrial era, discuss the consequences for sea level rise.

Cite Particular Files (@Files)


Examine the company's profitability using the attached financial report (@Q1_Report).

Describe important words and ideas.


Explain the concept of quantum computing in simple terms, suitable for a non-technical audience.

4. Leverage Chain of Thought (CoT) & Verification

One 2026 best practice is to encourage the AI to "think step-by-step" in order to minimize errors (hallucinations).

Strategy

Quick Example

Promote methodical thinking.



Work through this tax computation step-by-step. 

Determine the gross income first. Second, use the UK tax brackets for 2026. Third, deduct the personal allowance. Explain each step's rationale.


What You Need For Prompt Engineering


You can effectively communicate with AI models and realize their full potential by grasping a few essential components.


Format for Prompt:The AI will interpret your request based on the prompt's structure. Certain forms, such direct commands, natural language queries, or structured inputs with particular fields, may cause different models to react more favorably. Clarity requires an understanding of the model's preferred format.


Context and Examples: Giving the AI context and pertinent examples enables it to provide outputs that are more accurate. For example, identifying the intended tone or theme gives the model the required safeguards if you're searching for a creative story.


Iterative Refining: Prompting is rarely a one-step procedure.


Over time, you can "narrow in" on the ideal response by modifying your prompts depending on the original model output.


Conversational Flow: The AI can preserve context by participating in multi-turn interactions. This implies that you can create intricate, multi-layered outcomes by consulting earlier segments of the conversation.

Types of prompts


AI uses a variety of prompts, each with a distinct function:


Direct Prompts (Zero-shot)


Giving the model a direct instruction or query without any further background or examples is known as "zero-shot prompting."


Idea creation is one instance of this, in which the model is asked to come up with original concepts or brainstorming solutions. Another example is when the model is requested to translate or summarize a piece of text.

One-, few- and multi-shot prompts

Before giving the actual question, this strategy shows the model one or more samples of the desired input-output pairs. This can improve the model's comprehension of the task and produce more precise answers.


Chain of Thought Prompts


In order to produce a more thorough and organized final product, CoT prompting pushes the model to deconstruct difficult reasoning into a number of intermediate steps.


Zero-shot CoT Prompts


Ask the model to carry out reasoning processes in order to combine chain of thought prompting with zero-shot prompting, which frequently results in superior output.


The Science of Prompting - 2026 Benchmarks

 

AI Prompts

Large-scale community tests and recent research are starting to define precisely what constitutes a high-performing prompt. Recent benchmarks show that these three approaches perform noticeably better than "naive" or straightforward instructions:


1. The "MoT" Method, or Modular Prompting


Research indicates that Modular Prompting is more successful than providing the AI with a large, single instruction. You can improve reasoning by dividing large activities into smaller, more manageable chunks.


The Plan: Break up your request into smaller parts. Instead of doing everything at once, address the "Scouting" phase, "Analysis" phase, and "Execution" phase in that order.


2. Learning with Structure


Stricter formatting or schema restrictions produce far more reliable results, particularly for data or code.


The plan: Always include directives such as "Output as JSON" or "Use this specific naming convention." In 2026 tests, quality-control prompts that incorporate "edge cases" or "input validation" perform noticeably better.


3. Prompt Length's "Sweet Spot"


Shorter is frequently better for precision, according to recent data analysis and group knowledge.


The <50 Word Rule: For certain processes, prompts shorter than 50 words usually produce more accurate results.


The Noise Warning: Prompts longer than 150 words frequently introduce "noise," which may lead the AI to disregard your most crucial limitations.


Tips on Clean Formatting


Use lists, headings, and clear delimiters (e.g., Task:, Constraints:, Examples:). Consistency is crucial. This makes it easier for the model to "map" your intent.


Refinement Loops: Compared to "zero-shot" (first-try) prompts, Automatic Refinement (allowing the AI to suggest modifications of your prompt) improves performance by several percentage points, according to benchmarks.


Examples And Applications Of Prompt Engineering


Here are some concrete instances and use cases that demonstrate how rapid engineering contributes to the creation of tailored and pertinent results.


Language and Text Production


Scenario

Instructions

Example Prompt

Creative Writing

To help the AI create captivating stories, create prompts that identify genre, tone, style, and plot points.

To help the AI create captivating stories, create prompts that define genre, tone, style, and plot aspects.

Summarization

Give the AI text and tell it to produce succinct summaries that highlight important details.

Give the AI text and tell it to create succinct summaries that highlight important details.

Translation

To help the AI translate text accurately while maintaining context and meaning, specify the source and target languages.

Translate the following text from English to Spanish: 'The quick brown fox jumps over the lazy dog.


Dialogue

Create dialogue-like prompts so the AI may produce responses that resemble human interaction while preserving context.

You are an amiable chatbot that assists users in resolving computer issues. Answer the user's question: "My computer won't turn on.


Answering Questions


Scenario

Instructions

Example Prompt

Open-Ended Questions

Create prompts that motivate the AI to use its knowledge base to offer thorough and instructive responses.

Describe the idea of quantum computing and how it might affect technology in the future.

Specific Questions

Create prompts that focus on particular details so the AI can extract exact responses from its internal knowledge base or the given context.

"What is the capital of France?" Alternatively "According to the provided text, what are the main causes of deforestation?"

Multiple Choice Questions

Provide options in prompts so the AI may evaluate and choose the best response based on its comprehension of the situation.

Who penned the Harry Potter books? Stephen King, J.K. Rowling, and J.R.R. Tolkien.

Hypothetical Questions

Create prompts that investigate hypothetical scenarios so the AI can guess, reason, and offer possible solutions or consequences.

What would happen if humans could travel at the speed of light?

Opinion-Based Questions

Create prompts that elicit the AI's viewpoint or opinion on a particular subject and encourage it to justify and explain its position.

Do you think human intelligence will someday be surpassed by artificial intelligence? "Why or why not?


Code Generation


Scenario

Instructions

Example Prompt

Code Completion

Give the AI a portion of the code and ask it to recommend or finish the remaining portion depending on the programming language and context.

Write a Python function to calculate the factorial of a given number.

Code Translation

To allow the AI to translate code while maintaining functionality and grammar, specify the source and target programming languages.

Convert the Python code "def greet(name): print('Hello,', name)" to JavaScript.”

Code Optimization

Ask the AI to evaluate the current code and make recommendations for performance, readability, or efficiency enhancements.

Optimize the following Python code to reduce its execution time.

Code Debugging

Give the AI code that contains errors, then ask it to find the problems and offer possible fixes.

Debug the following Java code and explain why it is throwing a NullPointerException.


Image Generation


Scenario

Instructions

Example Prompt

Open-Ended Questions

Create prompts that motivate the AI to use its knowledge base to offer thorough and instructive responses.

Describe the idea of quantum computing and how it might affect technology in the future.

Specific Questions

Create prompts that focus on particular details so the AI can extract exact responses from its internal knowledge base or the given context.

"What is the capital of France?" Alternatively "According to the provided text, what are the main causes of deforestation?"

Multiple Choice Questions

Provide options in prompts so the AI may evaluate and choose the best response based on its comprehension of the situation.

Who penned the Harry Potter books? Stephen King, J.K. Rowling, and J.R.R. Tolkien.

Hypothetical Questions

Create prompts that investigate hypothetical scenarios so the AI can guess, reason, and offer possible solutions or consequences.

What would happen if humans could travel at the speed of light?

Opinion-Based Questions

Create prompts that elicit the AI's viewpoint or opinion on a particular subject and encourage it to justify and explain its position.

Do you think human intelligence will someday be surpassed by artificial intelligence? "Why or why not?

Image Generation


Scenario

Instructions

Example Prompt

Photorealistic Images

To produce realistic and excellent photographs, create prompts that fully describe the desired image, including items, scenery, lighting, and style.


A photorealistic image of a sunset over the ocean with palm trees silhouetted against the sky.

Artistic Images

The AI is guided in producing images that imitate particular artistic movements or arouse particular emotions via design prompts that specify art styles, techniques, and subject matter.

An impressionist painting of a bustling city street with people walking under umbrellas in the rain.




Abstract Images

Create prompts that encourage the AI to produce interpretable visuals that use textures, colors, and shapes to suggest emotions or ideas.

An abstract image representing the concept of hope, using bright colors and flowing shapes.


Image Editing

Give the AI an existing image and let it know what needs to be changed so it can improve and edit it in accordance with the instructions.

Change the background of this photo to a starry night sky and add a full moon." Alternatively "Remove the person from this image and replace them with a cat."


Tips For Creating More Effective Prompts


It takes a systematic strategy to create suggestions that work. To improve your prompt engineering abilities, think about following tactics:


  1. Establish Specific Goals and Objectives:


Strategy

Quick Example

To indicate the intended activity, use action verbs.

Write a bulleted list that summarizes the key findings of the attached research paper.

Specify the output's desired length and format.

Compose a 500-word essay discussing the impact of climate change on coastal communities.

Indicate who the intended audience is.

Write a product description for a new line of organic skincare products, targeting young adults concerned with sustainability.



  1. Give Background and Context Information:



Strategy

Quick Example

Add pertinent information and facts.

Given that global temperatures have risen by 1 degree Celsius since the pre-industrial era, discuss the potential consequences for sea level rise.

Cite particular documents or sources.

Examine the company's profitability over the last five years using the financial report that is attached.

Explain important words and ideas.

Explain the concept of quantum computing in simple terms, suitable for a non-technical audience.


  1. Make Use of Short-Form Prompting


Strategy

Quick Example

Give a few instances of the required input-output combinations.

Input: "cat" The response was: "A small furry mammal with whiskers." Input: "Dog" Output: "A domesticated canine known for its loyalty." Prompt: "Elephant".

Display the chosen tone or style

Example 1 (funny): "The politician's speech was so dull, it could cure insomnia." Example 2 (formal): "The dignitary delivered an address that was both informative and engaging." The prompt is: "Write a sentence describing the comedian's stand-up routine."

Display the appropriate degree of detail

Example 1 (brief): "The movie was about a young boy who befriends an alien." Example 2 in its entirety: "The science fiction film follows the story of Elliot, a lonely boy who discovers and forms a unique bond with an extraterrestrial stranded on Earth." Ask the question: "Summarize the plot of the novel you just finished reading."


  1. Be specific


Strategy

Quick Example

Avoid uncertainty and speak clearly.


Instead of saying, "Write something about climate change," respond with: "Write a persuasive essay arguing for the implementation of stricter carbon emission regulations."

Whenever feasible, quantify your requests.



Instead of saying, "Write a long poem," say, "Write a sonnet with 14 lines that explores themes of love and loss."

Divide difficult jobs into manageable steps.


Instead of "create a marketing plan," write "1. identify the target audience." 2. Create important marketing messages. 3. Select the relevant marketing channels.


  1. Experiment and Iterate:


Strategy

Quick Example

Try using alternative words and phrases.

Rephrase your prompt with synonyms or other sentence forms.

Modify the degree of specificity and detail

Fine-tune the output by adding or removing information.

Test various prompt durations.

To discover the best balance, try different lengths of prompts.


  1. Use Chain of Thought Prompting


Strategy

Quick Example

Promote methodical reasoning


"Solve this problem step by step: John has five apples, which he eats 2. How many apples has he left? Step 1: John starts with five apples. Step 2: He eats two apples, so subtract two from five. Step 3: 5 - 2 = 3. Answer: John has three apples left.

Request an explanation of the model's thought process.



"Explain your thought process in determining the sentiment of this movie review: 'The acting was superb, but the plot was predictable.'"


Lead the model through a rational cognitive process.

"To determine whether this email is spam or not, examine the following: 1. Is the sender known? 2. Does the subject line contain any suspicious keywords? 3. Is the email offer too good to be true?"

Advantages Of Prompt Engineering

AI models' capabilities and usability are improved via effective rapid engineering, which has many advantages:

Enhanced Performance Of The Model


Because well-written prompts give precise instructions and context, AI models produce outputs that are more accurate, pertinent, and educational.

Decreased Prejudice And Negative Reactions


Prompt engineering reduces bias and the likelihood of producing objectionable or improper information by carefully regulating the input and directing the AI's emphasis.

Enhanced Predictability And Control


With prompt engineering, you can control the AI's behavior and make sure that its replies are reliable, consistent, and in line with your goals.

Improved User Experience


Users may interact with AI models more successfully when prompts are clear and succinct, which results in more intuitive and fulfilling interactions.

 

Writing effective prompts


Similar Posts