When interacting with AI systems such as ChatGPT, Gemini, or other AI assistants, the way we design prompts can vary depending on the task. Different prompt styles help guide the AI to produce more accurate and useful responses.
Below are some common types of prompts used in prompt engineering, explained in simple terms with examples.
1. Zero-Shot Prompt
A Zero-Shot Prompt is when we ask the AI a question without giving any examples. The AI uses its existing knowledge to generate the response.
Example Prompt:
“Explain the concept of machine learning.”
Here, the AI is not given any examples. It must answer the question based only on the instruction.
Another Example:
“What are the benefits of renewable energy?”
In both cases, the AI directly answers the question without any guidance or examples.
Example 3
Prompt:
“Explain the difference between supervised learning and unsupervised learning.”
The AI answers the question using its knowledge without any example guidance.
Example 4
Prompt:
“Write a short paragraph about the importance of data in artificial intelligence.”
The AI creates the paragraph directly from the instruction.
Example 5
Prompt:
“List three applications of machine learning.”
The AI generates a list based only on the instruction.
2. One-Shot Prompt
In a One-Shot Prompt, we provide one example before asking the AI to perform a similar task. This helps the AI understand the expected format or style of the answer.
Example Prompt:
Example:
Input: Apple
Output: A fruit that grows on trees.
Now answer:
Input: Carrot
Output:
Here the AI learns from one example and produces a similar response.
Example 2: Sentiment Classification
Example:
Sentence: “The movie was amazing.”
Sentiment: Positive
Now answer:
Sentence: “The service at the restaurant was terrible.”
Sentiment:
From one example, the AI learns how to classify the sentiment of a sentence.
Example 3: Translation
Example:
English: Hello
French: Bonjour
Now answer:
English: Thank you
French:
The AI uses the example to translate another word into French.
Example 4: Word Meaning
Example:
Word: Ocean
Meaning: A large body of salt water.
Now answer:
Word: Mountain
Meaning:
The AI understands that it needs to provide the meaning of the word.
3. Few-Shot Prompt
A Few-Shot Prompt provides multiple examples so that the AI clearly understands the pattern of the task.
Example Prompt:
Input: Cat → Animal
Input: Rose → Flower
Input: Mango → Fruit
Now classify:
Input: Dog → ?
Because multiple examples are provided, the AI can easily understand the pattern and generate the correct answer.
Example 2: Sentiment Analysis
Sentence: “The phone works perfectly.” → Positive
Sentence: “The battery life is terrible.” → Negative
Sentence: “The design is very attractive.” → Positive
Now classify:
Sentence: “The laptop crashes frequently.” → ?
The AI uses multiple examples to understand how to classify sentiment.
Example 3: Translation
English: Hello → Spanish: Hola
English: Thank you → Spanish: Gracias
English: Good morning → Spanish: Buenos días
Now translate:
English: Good night → Spanish: ?
The AI learns the translation pattern from the examples.
4. Instruction-Based Prompt
In an Instruction-Based Prompt, we clearly tell the AI what task it needs to perform.
Example Prompt:
“List five applications of artificial intelligence in healthcare.”
Another Example:
“Explain neural networks in simple language.”
Here the instructions are clear, so the AI knows exactly what to do.
Example 3: Summarize
Prompt:
“Summarize the following paragraph about climate change in two sentences.”
The instruction “Summarize” tells the AI to shorten the information while keeping the main idea.
Example 4: Compare
Prompt:
“Compare machine learning and deep learning.”
The instruction “Compare” tells the AI to highlight similarities and differences.
Example 5: Describe
Prompt:
“Describe how artificial intelligence is used in healthcare.”
The instruction “Describe” asks the AI to explain the topic in detail.
5. Role-Based Prompt
In a Role-Based Prompt, we ask the AI to act as a specific role such as a teacher, programmer, doctor, or analyst. This helps the AI generate responses in the appropriate style.
Example Prompt:
“You are a computer science teacher. Explain machine learning to first-year engineering students.”
Another Example:
“You are a career advisor. Suggest three career options for someone interested in artificial intelligence.”
The AI adapts its explanation based on the role it is given.
Example 3: Doctor Role
Prompt:
“You are a doctor. Explain the importance of regular exercise for maintaining good health.”
The AI responds from a medical perspective.
Example 4: Programmer Role
Prompt:
“You are a Python programmer. Explain what a loop is in programming with a simple example.”
The AI explains the concept using programming-related explanations.
Example 5: Interviewer Role
Prompt:
“You are a job interviewer. Ask five interview questions for a data science candidate.”
The AI generates questions suitable for a job interview.
6. Output-Format Prompt
In an Output-Format Prompt, we specify how the answer should be presented.
Example Prompt:
“Explain the advantages of artificial intelligence in five bullet points.”
Example 2: Table Format:
“Compare supervised learning and unsupervised learning in a table format.”
By specifying the format, the AI produces a well-structured response.
Example 3: Short Paragraph
Prompt:
“Explain the importance of artificial intelligence in one short paragraph.”
The AI provides the answer in paragraph format.
Example 4: Step-by-Step Explanation
Prompt:
“Explain how a recommendation system works step by step.”
The AI structures the response in clear steps.
Example 5: Bullet Points
Prompt:
“List the applications of artificial intelligence in bullet points.”
The AI presents the information in bullet points for better readability.
7. Chained Prompt
A Chained Prompt breaks a complex task into multiple smaller prompts. Each step helps the AI gradually solve the problem.
Example:
Step 1 Prompt:
“List five applications of artificial intelligence.”
Step 2 Prompt:
“Explain each application in one sentence.”
Instead of doing everything at once, the task is divided into smaller steps.
Example 2: Learning a Programming Concept
Step 1 Prompt:
“Explain what a loop is in programming.”
Step 2 Prompt:
“Give a simple Python example of a loop.”
Step 3 Prompt:
“Explain how the given Python loop works step by step.”
The AI first explains the concept, then provides an example, and finally explains the example.
Example 3: Understanding a Topic
Step 1 Prompt:
“Define machine learning.”
Step 2 Prompt:
“List three applications of machine learning.”
Step 3 Prompt:
“Explain one of these applications with a real-world example.”
This approach helps the student understand the topic gradually.
Example 4: Problem Solving
Step 1 Prompt:
“Identify the main causes of climate change.”
Step 2 Prompt:
“Explain each cause briefly.”
Step 3 Prompt:
“Suggest one solution for each cause.”
Here the AI moves from identifying problems to suggesting solutions.
8. Context-Based Prompt
A Context-Based Prompt provides background information so the AI can produce more relevant answers.
Example Prompt:
“Explain data privacy issues in artificial intelligence for social media platforms.”
Another Example:
“Describe how AI is used in healthcare for disease diagnosis.”
The added context helps the AI focus on a specific situation.
Example 3: Business Context
Prompt:
“Describe how artificial intelligence can improve customer service in online shopping platforms.”
The context helps the AI focus on e-commerce businesses.
Example 4: Technology Context
Prompt:
“Explain the role of machine learning in recommendation systems used by streaming platforms.”
The AI focuses on recommendation systems in streaming services.
Example 5: Healthcare Context
Prompt:
“Explain how artificial intelligence helps doctors analyze medical images such as X-rays.”
The context directs the AI toward medical image analysis.
9. Hybrid or Multimodal Prompt
A Hybrid or Multimodal Prompt involves more than one type of input, such as text, images, or audio.
These prompts allow AI systems to process different forms of data at the same time.
Example:
Providing an image and asking:
“Describe what is happening in this image.”
Another Example:
Uploading an image of handwritten notes and asking:
“Convert this image into editable text.”
Here the AI processes different types of input together, not just text.
Example 1: Image + Text
Upload an image of a plant and ask:
“Identify the plant in this image and describe its main characteristics.”
Here the AI uses the image as input and the text prompt as instruction.
Example 2: Image + Question
Upload an image of a graph and ask:
“Analyze the graph in this image and explain the trend shown.”
The AI reads the visual data in the graph and explains it in text.
Example 3: Image + Problem Solving
Upload an image of a math problem and ask:
“Solve the mathematical equation shown in this image.”
The AI reads the equation from the image and provides the solution.
Example 4: Audio + Text
Provide an audio recording and ask:
“Convert this audio into text.”
The AI listens to the audio input and generates the transcribed text.
Comparison of Different Types of Prompts in AI
Comparison of Different Types of Prompts in AI
Different types of prompts are used depending on the task and the level of guidance given to the AI model. The table below compares common prompt types with simple explanations and examples.
| Prompt Type | Description | Example Prompt |
| Zero-Shot Prompt | The AI is asked to perform a task without giving any example. The model relies on its existing knowledge. | “Explain the concept of machine learning.” |
| One-Shot Prompt | One example is provided to guide the AI before asking it to perform the task. | Example: Apple → Fruit. Now classify: Carrot → ? |
| Few-Shot Prompt | Multiple examples are provided so the AI can understand the pattern of the task. | Cat → Animal, Rose → Flower, Mango → Fruit. Now classify: Dog → ? |
| Instruction-Based Prompt | The prompt clearly instructs the AI what task it needs to perform. | “List five applications of artificial intelligence in healthcare.” |
| Role-Based Prompt | The AI is asked to act in a specific role, which helps shape the style and perspective of the response. | “You are a teacher. Explain neural networks to first-year students.” |
| Output-Format Prompt | The prompt specifies how the output should be structured. | “Explain the advantages of AI in five bullet points.” |
| Chained Prompt | A complex task is divided into multiple smaller prompts executed step by step. | Step 1: List applications of AI. Step 2: Explain each application in one sentence. |
| Context-Based Prompt | Background information is provided to help the AI generate more relevant responses. | “Explain the role of AI in healthcare for disease diagnosis.” |
| Hybrid / Multimodal Prompt | The prompt uses multiple types of inputs such as text, images, or audio. | Upload an image and ask: “Describe what is happening in this image.” |
Summary
Each type of prompt provides a different level of guidance to the AI system. Choosing the appropriate prompt type helps improve the accuracy, relevance, and structure of the AI-generated response.
