Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Three Popular ChatGPT Prompt Engineering Patterns for Life and Business Productivity
Artificial Intelligence   Data Science   Latest   Machine Learning

Three Popular ChatGPT Prompt Engineering Patterns for Life and Business Productivity

Last Updated on February 13, 2024 by Editorial Team

Author(s): Dipanjan (DJ) Sarkar

Originally published on Towards AI.

Created with DALL-E 3

Introduction

In recent years, the landscape of artificial intelligence has undergone a significant transformation with the emergence of Generative AI technologies. Leading this revolution is ChatGPT, a state-of-the-art large language model (LLM) developed by OpenAI. As a large language model, ChatGPT is built on a vast dataset of language examples, enabling it to understand and generate human-like text with remarkable accuracy.

Figure 1: Generative Large Language Models in a nutshell, Source: Google AI

This capability places ChatGPT at the cutting edge of natural language processing, significantly enhancing how we interact with digital systems. The benefits of such a model are manifold, including its ability to provide detailed, context-aware responses, making it a versatile tool for a wide range of applications. ChatGPT’s advanced language understanding, and generation capacities have not only increased user engagement but also opened new avenues for increased productivity and automation in personal life as well as business problems.

Understanding Prompt Engineering

At the heart of effectively leveraging ChatGPT lies β€˜prompt engineering’ β€” a crucial skill that involves crafting specific inputs or prompts to guide the AI in producing the desired outputs. This technique is key in fully utilizing ChatGPT’s capabilities, enabling users to achieve more precise and relevant responses. For example, instead of asking β€œWhat’s the weather like?” a more engineered prompt would be β€œProvide a current weather report for Zurich, including temperature and chance of rain.” This specific prompt helps in generating a more focused and useful response.
Prompts can be as simple as asking a question or as complex as planning meetings based on schedules as shown in the example in Figure 2.

Figure 2: Planning a meeting with ChatGPT prompting

With advancements in LLM capabilities, ChatGPT can now handle both text and images in its prompts as shown in the following example in Figure 3, where it can accurately detect entities as well as context in an image.

Figure 3: ChatGPT prompting with images and text

The essence of prompt engineering patterns

Prompt engineering goes beyond mere question-asking; it’s both an art and a science. It requires an understanding of the subtleties of language and the AI’s processing abilities. Prompt engineering patterns are structured, reusable approaches or templates that assist in eliciting particular types of responses or actions from ChatGPT. These patterns are crucial for enhancing both personal life and business productivity, as they streamline interactions with AI for greater efficiency and effectiveness. For instance, a pattern for gathering information might start with β€œList the steps involved in…” or β€œSummarize the key points of…”, guiding ChatGPT to structure its response in a clear, organized manner.

Popular prompt engineering patterns

In the following sections, we will unveil a selection of popular prompt engineering patterns that have proven to be exceptionally effective in boosting productivity in both personal and professional contexts. These patterns are not just theoretical concepts; they are practical tools that have been honed through widespread use and refinement. By exploring these patterns, we aim to unlock the true potential of ChatGPT in addressing a variety of life and business challenges.

Each pattern is designed to serve a specific purpose, whether it’s streamlining communication, enhancing information retrieval, or aiding in complex problem-solving. We will provide examples and insights into how these patterns can be applied in real-world scenarios, demonstrating their versatility and impact. From simple queries to more sophisticated interactions, these prompt engineering patterns will empower you to navigate and optimize your engagements with ChatGPT, transforming it into a valuable ally in your daily life and business operations.

The Persona Pattern

When it comes to enhancing interactions with AI, the Persona Pattern is an ingenious prompt engineering technique that involves adopting a specific persona to deliver tailored information or services. This pattern is particularly useful when the response needs to be customized for an audience with a specific background or set of circumstances and rules.

Format for the Persona Pattern:

  • Act as Persona P: Here, you assign the AI a specific role or identity. The persona could be any professional or character like an β€˜astronomer,’ β€˜yoga instructor,’ or β€˜financial advisor.’
  • Perform Task T: You define a particular task that the assigned persona should perform, ensuring that the task is relevant to the persona’s expertise or role.
  • Assume that I am Persona U (optional): This is an optional step where you can provide the AI with a target audience persona, which could be yourself or someone else, such as a β€˜curious 6-year-old’ or a β€˜stressed-out college student.’

Examples:

  • β€œExplain the solar system. Assume that I am a curious 6-year-old.”
  • β€œAct as a yoga instructor and guide me through meditation. Assume that I am a stressed-out college student.”
  • β€œAct as a computer engineer and describe how computers work. Assume that I am a senior citizen unfamiliar with modern technology.”

Real-world scenario:

In the scenario provided in Figure 4, the task is to act as a financial advisor for someone looking to invest 10,000 CHF. The persona of the user is a novice investor, aged 32, with no prior investment expertise. The AI, adopting the persona of a financial advisor, provides a simplified yet comprehensive investment strategy that is tailored to the user’s novice status.

Figure 4: persona pattern scenario: investment advice from ChatGPT as a financial advisor

Check out the full prompt pattern and the conversation with ChatGPT by clicking here.

The Cognitive Verifier Pattern

The Cognitive Verifier Pattern is a sophisticated prompt engineering strategy designed to enhance the accuracy and relevance of the responses generated by AI. This pattern is especially useful in situations where the initial query may require additional context or clarification to provide a precise answer.

Format for the Cognitive Verifier Pattern:

To use the Cognitive Verifier Pattern, your prompt should incorporate these fundamental contextual cues:

  • From now on, whenever a question is posed to you, follow these rules
  • Generate a number of additional questions that would help more accurately answer the question
  • Ask these questions one by one
  • Combine the answers to the individual questions to produce the final answer to the overall question
  • Let’s start with the first question

Pattern:

When you are asked a question, follow these rules. Generate a number of additional questions that would help you more accurately answer the question. Ask these questions one by one. Combine the answers to the individual questions to produce the final answer to the overall question. Let’s start with the first question.

Examples:

β€œIf tasked with suggesting a workout routine, follow these rules. Pose additional questions about any existing health conditions, my fitness level, and the type of equipment available to me. Ask these questions one by one. Integrate this information to offer a customized workout plan suitable for my conditions. Let’s start with the first question”

Real-world scenario:

In the scenario provided in Figure 5,the AI adopts the Cognitive Verifier Pattern to recommend a book based on the user’s preferences in genres, recent reads, and current mood. The AI asks targeted questions to discern the user’s preferences, delving deeper into the types of crime, mystery, and thriller books the user enjoys, as well as the mood they are in for reading. By sequentially clarifying these preferences, the AI combines the information to suggest β€œBig Little Lies” by Liane Moriarty, which aligns with the user’s taste for a tranquil yet suspenseful narrative.

Figure 5: Cognitive Verifier Pattern Scenario: Book Recommender using ChatGPT

Check out the full prompt pattern and the conversation with ChatGPT by clicking here.

The Recipe Pattern

The Recipe Pattern is a prompt engineering strategy designed to create a clear, step-by-step guide to accomplish a specific task. This method is incredibly beneficial when you need to outline a process or sequence of actions in a logical and comprehensive manner.

Format for the Recipe Pattern:

  • To effectively apply the Recipe Pattern in your prompts, you should include the following elements:
  • I would like to achieve T: Define the overall task or goal that you want to accomplish.
  • I know that I need to perform steps A, B, C: List some of the key steps that are already known, which contribute to the completion of the task.
  • Provide a complete sequence of steps for me: Request a detailed and ordered list of actions to reach the goal.
  • (Optional) Fill in any missing steps: Ask to identify and include any steps that may have been overlooked.
  • (Optional) Identify any unnecessary steps: Request to eliminate any steps that are not essential to the process.

Example:

β€œI would like to purchase a house. I know that I need to perform steps like selecting a location, looking at various houses, considering house features, and making an offer. Provide a complete sequence of steps for me, fill in any missing steps, and identify any unnecessary steps.”

Real-world scenario:

In the scenario depicted in Figure 6, the task β€œT” is to plan an optimal 12-hour itinerary including visit points such as Vaduz, Bregenz, Lindau, Stein am Rhein, with the starting and ending point at Zurich City. The known steps β€œA, B, C” are the visit points themselves and the desire to spend about 30 minutes to 1 hour at each location, as well as the need to start the day at 8:00 AM and consider travel time between locations.

The Recipe Pattern will guide the AI to structure a travel itinerary that includes all necessary steps such as travel times, order of visit points based on geographical efficiency, and the duration of stay at each location. It will also include any essential activities or sights at each location and identify any points that are not feasible, such as visiting Mount Everest in the same trip, which is an unnecessary and impossible step within the given constraints.

Figure 6: Recipe Pattern Scenario: Travel Itinerary Planner using ChatGPT

Check out the full prompt pattern and the conversation with ChatGPT by clicking here.

Summary

In this article, we’ve delved into the intricacies of prompt engineering, unveiling how structured inputs can significantly enhance the productivity of both individuals and businesses when interacting with generative AI like ChatGPT. From the artful Persona Pattern, which tailors responses to specific user identities, to the meticulous Cognitive Verifier Pattern, which ensures precise information gathering β€” each pattern serves as a key to unlocking the vast capabilities of AI. We examined the transformative power of the Recipe Pattern, guiding users through complex processes with step-by-step clarity. These patterns are not just theoretical; they are practical tools for improving efficiency and decision-making in real-world scenarios.

Reach out to me at my LinkedIn or my website if you want to connect.

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓