Table of Contents
Share this Resource

Different Prompt Engineering Techniques

Quick Overview

1. Zero-shot, one-shot and few-shot prompting use different numbers of examples to guide AI responses.
2. Contextual and role-based prompting help AI adapt responses to specific situations, audiences and perspectives.
3. Retrieval-augmented prompting uses external information to support more relevant and informed responses.
4. Prompt chaining and structured output prompting help organise complex tasks and control response formats.
5. Chain-of-thought and iterative prompting support step-by-step problem presentation and progressive response refinement, depending on the AI model.

Which of these prompts is likely to produce the most useful response?

1) Prompt A: "Explain cybersecurity."

2) Prompt B: "Explain cybersecurity to a beginner."

3) Prompt C: "Explain cybersecurity to a beginner using simple language and three real-world examples."

All three ask about the same topic, but they provide different levels of guidance. The difference lies in context, specificity and structure.

Prompt engineering techniques help you use these elements intentionally to guide AI-generated responses. But these are just the basics. There are several techniques you can use to guide AI towards more structured outputs. Let's explore some of these prompt engineering techniques and understand when to apply them.

Prompt Engineering Techniques

Prompt engineering involves various techniques that help users structure instructions, provide relevant context and guide AI-generated responses. Each technique serves a different purpose, from handling simple queries to supporting complex tasks and improving output consistency.

Here are the key prompt engineering techniques that you can try:

Top 10 Prompt Engineering Techniques

1) Zero-shot Prompting

Zero-shot prompting allows language models to perform tasks using instructions without providing task-specific examples in the prompt. It relies on the model's existing capabilities to interpret requests and generate relevant responses. This technique is useful for tasks such as classification, translation, summarisation and answering questions.

Clear instructions can help the model understand the task and produce an appropriate response without requiring examples. However, zero-shot prompting may be less effective when the task involves unfamiliar formats, specialised requirements or complex patterns.

Example:

Summarise the following article in 100 words using simple language and highlight its three main points.

Join the best ChatGPT Prompt Engineering Certification Training

2) One-shot Prompting

One-shot prompting is a technique in which an AI model is provided with a single example of the expected output before being asked to perform a similar task. The example helps the model understand the required format, style or pattern without needing multiple demonstrations.

This technique is useful for tasks such as text classification, content formatting, translation and generating responses in a specific style. It offers more guidance than Zero-shot prompting while keeping instructions relatively simple.

Example:

a) Prompt: Classify the following customer reviews as positive, negative or neutral.

b) Example: The delivery was quick and the product was excellent. → Positive

c) Now Classify: The product arrived late and the packaging was damaged.

d) Expected Output: Negative

3) Few-shot Prompting

Few-shot prompting is a technique that uses multiple examples to help AI recognise patterns and generate responses that follow a specific format or style. By showing the model several input-output pairs, users can guide it towards more consistent results. This approach is especially useful for content classification, data extraction, text formatting and repetitive tasks.

Example:

Prompt: Classify the following customer reviews as positive, negative or neutral.

a) Example 1: The delivery was quick, and the product quality is excellent. → Positive

b) Example 2: The product stopped working after two days. → Negative

c) Example 3: The package arrived yesterday, and I haven't used the product yet. → Neutral

Now Classify: The customer support team was helpful and resolved my issue quickly.

Expected Output: Positive

4) Retrieval-Augmented Prompting

Retrieval-augmented prompting uses information retrieved from external sources to provide additional context for AI-generated responses. It is commonly associated with Retrieval-Augmented Generation (RAG), where a retrieval system searches relevant documents, databases or knowledge sources and supplies the retrieved information to the AI model before it generates a response.

This technique is particularly useful for answering questions based on company documents, technical manuals, research materials or frequently updated information. It can help improve factual accuracy and relevance, although the quality of the output depends on the reliability and relevance of the retrieved sources.

Example:

a) User Query: How many days of annual leave are employees entitled to each year?

b) Retrieved Information: Employees are entitled to 25 days of annual leave per year, excluding public holidays.

c) Augmented Prompt: Using the retrieved company policy excerpt, how many days of annual leave are employees entitled to each year? Answer in one sentence.

d) Expected Output: Employees are entitled to 25 days of annual leave per year, excluding public holidays.

Pro Tip

Prompts containing leading questions or assumptions can influence how AI models respond. Use neutral wording when evaluating options, analysing information, or making comparisons.

Create prompts that drive consistent and reliable outcomes with Generative AI in Prompt Engineering Training – Register today!

5) Contextual Prompting

Contextual prompting provides AI with relevant background information to help it understand the situation, target audience and desired outcome. This may include business objectives, audience preferences, available resources, and specific limitations. Providing useful context reduces ambiguity and helps AI produce responses that better match the user's requirements.

Example:

Prompt: You are writing an email for a software company that has recently introduced a new project management tool. The target audience is small business owners who struggle with managing multiple projects. Write a professional, friendly email of approximately 100 words highlighting how the tool can help organise tasks and track deadlines. Include a clear call to action.

Myth vs Facts of Prompt Engineering Techniques

6) Prompt Chaining

Prompt chaining divides a complex task into smaller, connected prompts, where the output of one step becomes the input for the next. This approach makes lengthy workflows easier to manage and allows users to review results at different stages.

It is particularly valuable for research, content creation, report preparation and business analysis. However, errors in earlier steps can affect subsequent responses.

Example: Organising a Team Meeting Using Prompt Chaining

Prompt 1: Prepare an Agenda

"Create a simple agenda for a weekly team meeting to discuss project progress and upcoming deadlines."

Prompt 2: Draft an Email

"Using the meeting agenda created above, write a professional email inviting team members to the meeting."

Prompt 3: Create a Checklist

"Using the meeting agenda and invitation email created above, prepare a checklist of items team members should review before attending."

7) Role-based Prompting

Role-based prompting is a technique in which an AI model is instructed to adopt a specific professional role, perspective, or area of expertise when responding to a task.

By assigning roles such as a Marketing Manager, Business Analyst or Customer Support Representative, users can guide the model towards responses that reflect the responsibilities and communication style associated with that role. However, assigning a role does not guarantee expert-level knowledge or factual accuracy.

Example:

Prompt: Act as a Digital Marketing Specialist. Explain five practical ways a small business can improve its social media engagement without increasing its advertising budget.

8) Structured Output Prompting

Structured output prompting is a technique that guides an AI model to present information in a predefined format rather than generating a free-form response. Users specify how the output should be organised, including required headings, fields, sections or formats such as tables, lists, JSON, XML, CSV and YAML.

However, formatting instructions alone do not guarantee valid machine-readable output. Additional validation or schema constraints may be necessary.

Example:

Prompt: Compare Python, Java and JavaScript in a table with four columns: programming language, primary uses, key advantages and common applications. Keep each explanation under 20 words.

9) Chain-of-Thought Prompting

Chain-of-Thought (CoT) prompting is a technique that encourages certain AI models to work through complex tasks using intermediate reasoning steps. It is commonly associated with multi-step problem-solving, where intermediate calculations or explanations can help users understand and verify the result. However, its effectiveness depends on the AI model and task.

Example:

Prompt: A company purchases 50 office chairs at £80 each and receives a 10% discount on the total purchase. Calculate the final amount payable. Show the calculation steps.

Expected Output:

a) Calculate the original cost: 50 × £80 = £4,000.

b) Calculate the discount: 10% of £4,000 = £400.

c) Subtract the discount: £4,000 − £400 = £3,600.

Final Answer: £3,600.

10) Iterative Prompting

Iterative prompting is a technique in which users progressively refine their prompts based on the responses generated by an AI model. Instead of relying on a single instruction, they review the initial output, identify areas for improvement and provide additional guidance to achieve a more suitable result.

This technique is particularly useful for content writing, problem-solving, brainstorming and refining business documents. It allows users to adjust the tone, structure, level of detail or accuracy of AI-generated responses through repeated interactions.

Example:

a) Initial Prompt: Write a professional email inviting employees to a training session.

b) Second Prompt: Revise the email to make it shorter and highlight the benefits of attending the training.

c) Third Prompt: Refine the revised email using a friendly but professional tone and include a clear call to action.

Develop practical AI skills that create business value with Generative AI in Business Training – Join now!

The Knowledge Academy
The Knowledge Academy

Global Training Provider

The Knowledge Academy develops accessible learning content across Project Management, IT, Cybersecurity, Data Science, Business Analysis, HR, Accounting and Finance, Leadership and Health and Safety. Its resources combine subject research with clear explanations to help professionals build practical knowledge across a wide range of disciplines.

View Detail icon
cross

Exclusive Deals For Future Leaders!

friday-sale UP TO 60% OFF!

* WHO WILL BE FUNDING THE COURSE?

close

close

Thank you for your enquiry!

One of our training experts will be in touch shortly to go over your training requirements.

close

close

Press esc to close

close close

Back to course information

Thank you for your enquiry!

One of our training experts will be in touch shortly to go overy your training requirements.

close close

Thank you for your enquiry!

One of our training experts will be in touch shortly to go over your training requirements.