Artificial intelligence (AI) technologies like ChatGPT are revolutionising the legal field, bringing about substantial efficiency and innovation.
ChatGPT, developed by OpenAI, helps streamline day-to-day tasks such as legal research and document drafting, boosting the productivity of legal professionals.
That said, ChatGPT is far from perfect.
ChatGPT can often give you an answer in the wrong format, refuse to answer your question or, worse, give you a confident-sounding fictitious answer.
These issues will get ironed out over time. Why wait?
You can already get a lot out of ChatGPT if you know how to use it.
Enter the world of prompt engineering.
Sounds technical, right? But it’s far from it.
Prompt engineering is all about structuring your question in a way that is easiest for ChatGPT to understand. A more formal definition:
Prompt engineering is the process of structuring text that can be interpreted and understood by a generative AI model.
A prompt is natural language text describing the task that an AI should perform.
By “natural language” here, we just mean “English”. i.e. no computer science degree required.
Lawyers must master the art of precise prompting to maximise the benefits of ChatGPT in legal contexts.
A clear, specific prompt is what gets you a useful response. These prompts should concisely outline the task, provide necessary context and clearly state the expected outcome.
This accuracy ensures the AI’s (i.e. ChatGPT) responses meet your specific legal needs, making it a more effective tool for legal tasks.
(as opposed to say, asking ChatGPT for a spaghetti recipe).
So we’re going to outline 10 advanced prompting techniques from the latest research in artificial intelligence.
These research-backed techniques will help you obtain more accurate answers to your legal questions. Let’s dive in.
If you’re looking for an easier way to get the most out of AI in your law firm, we developed a custom ChatGPT for lawyers called Legal Genie.
Legal Genie includes references to official sources like Acts of Parliament and case law, helping you access reliable legal information quickly and efficiently.
Prompting Best Practices
1. Be Direct
You may be tempted to be polite to ChatGPT, and feel free to be, but research has shown that it is not necessary to say please.
Specifically, research has shown there is no need to add phrases like “please”, “if you don’t mind”, “thank you”, “I would like to”, etc. They do not improve the output. They also add words, which slows ChatGPT down, so the net effect is negative.
That said, if it makes you feel less… ungracious… feel free to sprinkle some politeness in there. Just know that it is not necessary for improving the output, and may be slowing you down very slightly.
(Some people do it anyway, hoping that their courtesy will be rewarded by their future AI overloads).
Example Prompt
As an example, here’s a prompt that gets straight to the point, with no niceties.
2. Use A Persona
Broadly speaking, ChatGPT has been trained to “give the user the answer they’re looking for”.
But as you can imagine, that is quite a vague goal. There are a lot of unknowns about who you are, and the type of answer you’re looking for that ChatGPT doesn’t know and hence has to make educated estimates (i.e. guesses) based on what your question is.
There is a better approach: by guiding ChatGPT with a persona, you set the structure of the output and tell ChatGPT what a good answer looks like.
This principle is vital in professional settings where the understanding and background knowledge of the topic can vastly differ.
Professional AI applications often implement similar persona-driven approaches. For instance, property investment AI tools use context about investor experience levels to adjust the complexity of financial analysis and reporting.
By specifying the audience’s expertise level in your prompt, you guide ChatGPT to adjust the complexity of its response, ensuring it’s appropriate for the audience.
The answer comes back more accurate and easier to act on.
Example Prompt
Here’s how you might specify a persona in your prompt in the legal context. Put this at the start of your prompt, before you assign ChatGPT a task:
3. Sequential Prompting
Breaking a complex task into a series of simpler, sequential prompts gets you more detail and better answers.
This technique is especially useful in legal research, where a broad question may encompass various nuanced details and require an in-depth exploration.
By starting with a broad prompt and then drilling down into more specific follow-up questions, you can guide ChatGPT to provide more detailed and focused responses.
This method is faster to work through, and it keeps the answers on the question you actually asked.
Example Prompt Sequence
Here’s an example of how to break down a complex legal inquiry into a sequence of prompts for clearer, more detailed responses.
<answer from ChatGPT>
<answer from ChatGPT>
By giving ChatGPT more context, which it supplies itself, before you ask the final question, you get a better answer.
This is because, like humans, ChatGPT benefits from context before answering a question!
4. Affirmative Directives
Using affirmative language in your prompts, such as “do” or “describe”, as opposed to negative constructions, like “don’t”, makes your instructions easier for ChatGPT to understand.
At least part of this seems to be because the mere presence of the word, even when you are telling ChatGPT not to do it, increases the likelihood that ChatGPT will output that word.
An analogy would be that if I told you to “think of a grey elephant”, you could do it with ease.
Okay… now how about “don’t think of a pink elephant”? Much harder.
A legal example will help illustrate the point.
Example Prompt
Here’s how to use affirmative directive:
As opposed to using a negative directive:
The first is much easier for ChatGPT to understand.
5. Clarity Through Simplicity
When you need a deeper understanding or a simpler explanation of a complex topic, specific prompt formulations can guide ChatGPT to adjust the complexity of its explanations.
That helps most in legal contexts, where concepts are dense and jargon-heavy.
(the term “legalese” demonstrates that legal language doesn’t have the best track record for being easy to understand).
Simplifying these concepts helps lawyers who want a quick refresher and clients who are trying to understand their own situation.
The ability to toggle the complexity of ChatGPT’s responses through precise prompting is a powerful tool for legal education and client communication.
This can be great for when you’re:
- Making legal terms and documents easier for clients and the public to understand.
- Creating plain-language explainers for non-legal audiences and quick refreshers on legal principles for practitioners.
- Working through dense legal documents a step at a time until the meaning is clear.
Example Prompt
Here are various prompt examples to ask ChatGPT to simplify complex information:
- Explain <insert specific topic> in simple terms.
- Explain to me like I’m 11 years old.
- Explain to me as if I’m a beginner in <field>.
- Write the <essay/text/paragraph> using simple English like you’re explaining something to a 5-year-old.
6. Offer ChatGPT A Tip (Seriously)
This one sounds fake, but it is true: offering ChatGPT a tip has been shown to improve the quality of responses.
Although ChatGPT does not have the capability to understand or process incentives in a human way, including that language appears to weight your instructions more heavily, which increases the chance ChatGPT follows them.
Whatever the reason, this quick addition to your prompt is worth including in your longer prompts if you’d like to slightly increase the chances of ChatGPT getting your output just the way you want it.
Example Prompt
7. Example-Driven Prompting
Putting a worked example in your prompt is the fastest way to get the answer format you want.
Often, when we want something, we make a huge number of assumptions about how we want it formatted and displayed.
Unfortunately (or perhaps fortunately), ChatGPT is not yet at a point where it can read our minds. So, it will often guess how we want the answer to be formatted and will often get it wrong.
By providing examples of the type of answer you’re looking for, you help ChatGPT tailor its responses more closely to your needs, whether drafting legal documents, preparing for litigation or advising clients.
This approach is particularly effective when you’re seeking information that follows a specific format or when you want ChatGPT to model its response after a certain style of explanation.
Note that this approach is also known as “few-shot prompting” or “few-shot learning,” where each example is known as a “shot.”
For example, one example is a “one-shot” prompt, two examples are a “two-shot” prompt, etc.
Example Prompt
Here’s how to incorporate examples into your prompts to guide the structure of ChatGPT’s response:
8. Structured Formatting
Opening with clear instructions and laying the prompt out in labelled sections improves the answers you get back.
This approach is especially useful when dealing with complex legal inquiries or when you need information presented in a particular format.
Structured formatting removes ambiguity about what you are asking for, so the answer addresses the task rather than a guess at it.
This is achieved by using specific delimiters, such as ###Instruction###, as well as using one or more line breaks to separate instructions, examples, questions, context and input data.
Example Prompt
Here’s an example of using structured formatting to clarify your request and improve the response quality:
By formatting your prompt in this manner, you tell ChatGPT exactly what the task is, what the context is and what you want back.
The benefits from this type of prompting are particularly noticeable for longer, more complex legal prompts.
9. Use Action Phrases
Just like when giving directions to a human, using language such as “your task is” and “you must” directs ChatGPT’s attention to your question and marks particular requirements as requirements.
This matters most in long prompts, where the question can get lost among the context around it. Language such as “your task is” and “you must” helps:
- Direct attention to the particular question at hand.
- Ensure understanding that this is a requirement, not just a preference.
It works well when you have formatting requirements that ChatGPT keeps drifting away from.
Example Prompt
Here’s how to use mandatory action phrases in a prompt:
10. Highlighting Consequences
Earlier in technique 4, Affirmative Directives, we discussed the effectiveness of using direct, positive instructions with ChatGPT, like saying “do this” instead of “don’t do that”.
This approach helps make it easier for ChatGPT to understand and follow your instructions.
In the legal world, though, you sometimes need to rule something out explicitly.
In these situations, pointing out the consequences of not following instructions can be incredibly useful.
ChatGPT cannot be punished and does not understand consequences the way a person does. A stern warning about “penalisation” still makes it stick more closely to your constraint.
Example Prompt
Let’s say you’re drafting a prompt, and ChatGPT keeps responding with an output that uses dot points. A way to tackle this using this technique would be to add:
Conclusion
There may come a time when none of these prompt engineering techniques will be necessary, and ChatGPT will be able to understand what you’re looking for with little to no precise instructions.
But we’re still quite far away from that point, so until then, prompt engineering is what gets useful work out of large language models like ChatGPT.
If you’re looking for an easier way to get the most out of AI in your law firm, we developed a custom ChatGPT for lawyers called Legal Genie.
Legal Genie includes references to official sources like Acts of Parliament and case law, helping you access reliable legal information quickly and efficiently.