Context is the information that helps the model understand the task, the goal, and the expectations of the user.
It includes instructions, examples, keywords, formatting, tone, and more.
Let's take a look at an example.
'Bad example'
Write a summary for the following court case below. || (Don't include in Prompt) - {Attached Donoghue v Stevenson}
Output
Case Summary: Donoghue v. Stevenson [1932] UKHL 100
Facts:
On August 26, 1928, Mrs. Donoghue consumed ginger beer purchased by a friend from a retailer. The beer was manufactured by Mr. Stevenson. After drinking part of the ginger beer, Mrs. Donoghue discovered the decomposed remains of a snail in the bottle. She subsequently suffered shock and severe gastroenteritis. Mrs. Donoghue filed a lawsuit against Mr. Stevenson, alleging negligence.
Issue:
The core legal question was whether the manufacturer of a product owed a duty of care to the ultimate consumer, even when there was no direct contractual relationship between them.
Judgment:
The House of Lords ruled in favor of Mrs. Donoghue, establishing the principle that a manufacturer owes a duty of care to the ultimate consumer. This duty requires taking reasonable care to ensure the product is free from defects likely to cause harm.
Reasoning:
The court held that manufacturers have a responsibility to consumers who they can reasonably foresee will use their products. The decision emphasized that negligence can occur even without a direct contractual relationship, extending liability to the manufacturer for harm caused by defects in their products.
Significance:
This landmark case established the modern concept of negligence, forming the basis for the duty of care in tort law. It laid the groundwork for consumer protection and product liability, affirming that manufacturers must ensure their products do not pose a risk to consumers.
Key Points:
. The case is foundational for the tort of negligence, establishing the "neighbor principle."
. A duty of care exists between manufacturers and consumers, even in the absence of a direct contract.
. Manufacturers must take reasonable care to prevent harm caused by defects in their products.
'Good example'
Summarise the court case below in 3 sentences or less.
Include the names of the parties, the main issue, and the outcome.
Do not include any opinions or irrelevant details.
|| (Don't include in Prompt) - {Attached Donoghue v Stevenson}
Output
In Donoghue v Stevenson (1932), the plaintiff, May Donoghue, sued the defendant,
David Stevenson, after finding a decomposed snail in a bottle of ginger beer
manufactured by Stevenson, which caused her illness. The main legal issue was
whether the manufacturer owed a duty of care to the consumer despite the absence
of a contractual relationship. The House of Lords held that the manufacturer did owe
a duty of care to the consumer, thereby establishing the modern concept of negligence
and the "neighbour principle."
Our revised prompt includes context that instructs the model:
The type of text to generate - A summary
The length - 3 sentences or less
The relevant information - Names, issue, outcome
To avoid - Opinions, irrelevant details
This helps the model focus on the task and produce a relevant and concise summary.
Tip #2 Provide Examples
A popular technique is to provide the AI model examples demonstrating the desired input-output format or behaviour to the model.
The idea is simple:
Provide the model with a few examples
The model uses these as a reference when producing its result.
This strategy becomes very effective when the examples you provide are real-world scenarios.
Think of it as you quickly training the AI model how to perform a specific task.
Let's say you want to provide the model with a legal document and have it provide answers to questions you may have regarding that particular document.
Here is how you can craft a prompt to do so:
Our example will be related to the Consumer Rights Act 2015.
Example: The Consumer Rights Act
Attach the Consumer Rights Act to ChatGPT
Prompt Example:
What is the significance of the term 'satisfactory quality'?
Answer: The term 'satisfactory quality' refers to a standard that goods must meet as outlined in the Consumer Rights Act 2015.
Goods must be of a standard that a reasonable person would regard as satisfactory.
What remedies are available if a product is faulty?
Answer: Repair, replacement, or a refund.
What is the time limit for rejecting goods that do not meet the 'satisfactory quality' standard?
Answer: 30 days from the date of purchase.
What is the definition of 'goods' under this Act?
Answer:
Output
Includes all physical items, but it excludes items such as water, gas, and electricity when they are not put up for sale in a limited volume or set quantity.
Tip #3 Use Strong Verbs
One of the ways to improve your ChatGPT prompts is to use strong verbs.
Strong verbs are more specific, clear, and concise.
They can also help prevent vague, passive, or redundant responses from the AI.
Here are some examples of how you can use strong verbs in your prompts:
Instead of "Write a summary of the case", use "Summarise the case".
Instead of "Make a list of the key points", use "List the key points".
Instead of "Create a document that outlines the legal arguments", use "Outline the legal arguments in a downloadable word document".
Instead of "Explain the benefits and risks of each option", use "Compare the benefits and risks of each option".
Tip #4 Prevent Hallucination
To recap, LLM hallucination occurs when a language model generates text that is fluent but factually incorrect or inconsistent.
This can happen when the model is given a request that it does not have enough information or knowledge to answer.
There are a few ways to prevent hallucination. The simplest approach involves making a very small change to your prompt.
Here is what that change might look like:
Answer the following question based on the information provided. If you do not know the answer, respond by saying "I do not know."
Including a simple statement in the instruction or context portion of your prompt can save you from a world of trouble.
By telling the model to not fulfil the request if it does not know the answer or have the relevant info, we can reduce the risk of LLM hallucination and improve the quality and reliability of the generated text.
Tip #5 Include Jurisdiction
When drafting prompts related to legal documents or advice, including legal citations can enhance the specificity and reliability of the output.
Bad Example
Draft a non-disclosure agreement for a software company in the UK.
Good Example
Draft a non-disclosure agreement for a software company based in London, UK.
Ensure that the agreement complies with the Data Protection Act 2018 and references
relevant sections where necessary. Include clauses on data handling, confidentiality,
and penalties for breaches. Format this like a UK NDA. Output this is an downloadable
PDF document.
By specifying the relevant legal framework (Data Protection Act 2018) and key clauses, the model can generate a more accurate and compliant document.