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.
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.
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.
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.
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.
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.
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.
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