Prompt patterns are structured approaches for designing prompts to guide your interactions with an LLM and shape its generated output to solve a particular problem. They help create a more interactive and engaging experience with the LLM and aim to optimize your questions for better outcomes.
For example, one of the simplest prompt patterns is called the "Persona Pattern." With the Persona Pattern, the LLM "acts as" a given persona and provides outputs that persona would provide. It's more effective than trying to describe the result you want if you didn't give the LLM a persona, as it's an information-dense pattern and helps the LLM tap into its training related to the specific persona - especially when working with information within a specific domain. It can also be used to gather a variety of perspectives and knowledge about a particular situation.
To use the Persona Pattern, you simply ask the LLM to act as a specific persona and perform a specific task: "Act as persona X, and perform task Y."
Example prompt: "Act as an esteemed contracts lawyer with 30 years of experience. Analyze the following contract for inconsistencies and potential liabilities and suggest possible solutions to them." |
The following three patterns and examples were taken from Legal Innovator & Educator Liz Chase's "Prompt Pattern for Lawyers," with more to come as additional research on prompt patterns for legal research is developed.
The Alternative Approaches Pattern involves instructing the LLM to provide alternative methods or strategies to address a specific issue or accomplish a specific task. In the legal realm, it can help users explore different paths and perspectives for a problem, and consider diverse approaches to problem-solving within the legal domain.
To use the Alternative Approaches Pattern you should:
Example prompt:
|
Remember that the LLM will remember your original prompt, even further along in your conversation. You don't have to worry about repeating your instructions with each prompt you provide unless the LLM isn't giving you the desired outputs, or you wish to switch to a new topic/problem (which you should be starting a new conversation for anyway!).
The Cognitive Verifier Pattern instructs the LLM to generate additional questions so it can gain a better understanding of what you're asking it to do. It helps the LLM gain additional information and context, allowing the LLM to generate more accurate and informed answers. Within the legal domain, its value can be seen when working with scenarios where multiple factors need to be considered, or when additional information is needed to reach a well-support conclusion.
To use the Cognitive Verifier Pattern you should:
Example prompt 1:
|
Example prompt 2:
|
With the Flipped Interaction Pattern the traditional question-answer dynamic between the user and LLM is reversed. The LLM takes on the role of asking questions and receives answers provided by the user. This pattern is particularly useful in having the LLM guide the user through a given problem-solving process, or even when the user wants to be quizzed or tested on a topic. In this way, the LLM can be viewed as a "tutor" or learning aid of sorts, helping the user solidify their understanding of complex legal topics.
To use the Flipped Interaction Pattern, you need to give the LLM a goal to achieve. With a goal in mind, the LLM is able to better understand what you want it to achieve and tailor its questions appropriately. It's also a good idea to give the LLM a limit to the number of questions it asks at once, helping it create the most effective and relevant questions.
The Flipped Interaction Pattern can be a powerful tool to shape an LLM's output. As such, it's important you craft a good prompt to get the best results possible. The authors of How Flipping Interaction Can Help You Achieve Your Goals Faster suggest the following basic yet concise prompt structure:
"Ask me questions to achieve X. You should ask questions until [condition or goal is met, you tell it to stop, etc.]. Ask me questions [one at a time, two at a time, etc.]."
Example prompt: "Ask me questions about how a bill becomes law to help me better understand the process. You should ask questions until I tell you to stop, or until you believe we have exhausted the material. Ask questions one a time." |