Communicating with AI models has become an everyday skill. Whether you're using ChatGPT
nevertheless Claude
, effective instructions can significantly improve the quality of content generation. ai startups Anthropic
A prompt engineering guide was recently released with strategies that apply to almost every major chatbot on the market.
At the heart of this guide is the idea of thinking of AI as a talented new colleague who knows nothing about your specific requirements. The clearer and more contextualized the communication, the better the AI will perform. Here are five key instruction tips to help you get the answers you really want from the AI.
Tip 1: Instructions must be clear
Vague instructions will only get vague answers. When asking AI questions, you need to provide clear, specific instructions, which can drastically reduce ineffective communication.
Effective instructions should contain background information about the task, such as the purpose of the end result, the audience it is intended for, and your preferred format or style. When the requirements are complex, using bulleted or numbered lists ensures that the AI completes the task in the expected order and manner.
Contrast the following two writing styles:
- Less effective writing style::
"Don't use redacted numbers."
- A more effective way to write::
"The next content generated will be used for voice reading, so please do not use redacted numbers as the text-to-speech service cannot accurately recognize its pronunciation."
The second version allows the AI to understand the logic behind the commands by explaining the "why" so that it can perform the task better.
Tip 2: Provide reference examples
Providing examples is an effective way to improve the accuracy and consistency of AI output. This technique, known as "few-shot prompting," allows AI to learn and imitate by showing specific input and output formats.
Other concepts related to "sample tips" include:
- Zero-shot Prompting: Provides no examples and relies entirely on pre-trained knowledge of AI models to answer questions directly. Suitable for simple, common sense tasks.
- One-shot Prompting: Provide an example for helping AI understand tasks that require more specific guidance or are prone to ambiguity.
- Few-shot Prompting: Provides two or three well-designed examples for complex tasks that require the establishment of a specific pattern, such as asking the AI to write in a particular style or to extract information in a fixed format.
To get the most out of the example, it is recommended to use XML tags (such as <example>
cap (a poem) </example>
) wraps the example content clearly and helps the AI distinguish between instructions and references.
Tip #3: Give the AI time to "think"!
When faced with complex tasks that require reasoning, analyzing, or problem solving, asking for the final answer can cause the AI to make mistakes. In this case, it should be guided through a step-by-step analysis.
The technology, known as the Chain of Thought (CoT), is being developed in 2022 by the Google Brain
Researchers at the University of California, Berkeley, have proposed a new way to improve the accuracy of large language models. They found that requiring large language models to "think step-by-step" and demonstrate the reasoning process before giving a final answer significantly improved their accuracy on logical, mathematical, and multi-step reasoning tasks.
Below are tips for applying the Chain of Thought at three different levels:
- Basic tips::
Compose an email asking for assistance from a donor. Think step-by-step before putting pen to paper.
- Guided Thinking::
Write an email... Before you put pen to paper, think about 1. analyzing what messages resonate with your donor based on his history. 2. combining those messages, think about what aspects of our program this year might appeal to him. 3. finally, based on your analysis, write the email.
- Structured Thinking (recommended)::
exist
<thinking>
Complete the following reflections within the tabs: 1. analyze the donor's history... 2. think about the attraction of the project.... Then, within the<email>
Within the tab, compose a personalized email that incorporates your analysis.
Structured Thinking completely separates the AI's reasoning process from the final answer, making it easy for users to check its logic while keeping the output tidy.
The guide published by Anthropic emphasizes that effective cueing techniques work for mainstream AI models such as Claude, ChatGPT, and others.
Tip 4: Assigning a Role to the AI
Assigning a specific role to AI, such as "a Fortune 500 company's chief legal officer with two decades of experience" or "an advertising expert who specializes in writing viral marketing copy," is a shortcut to improving its performance.
This Role Prompting technology transforms AI from a generalist assistant to a domain-specific expert. Role Prompting is particularly effective when dealing with specialized tasks such as legal analysis or financial modeling.
For example, when AI is asked to analyze a software license agreement:
- AI without characters: It may only give a broad answer that the agreement "doesn't seem to be a big problem".
- AI given the role of "Senior Law Clerk": In turn, they are quick to spot hidden risk clauses in agreements and point out that these clauses could potentially cost the company millions of dollars.
By setting roles, it is also easy to standardize the AI's tone of voice and style of wording so that its output is more in line with expectations.
Tip #5: Allow the AI to answer "I don't know."
AI models can sometimes "talk serious nonsense", a phenomenon known as "Hallucination". The easiest and most effective way to minimize this is to explicitly allow it to answer "I don't know" when it is unsure in its instructions.
This may seem like a simple tweak, but it significantly reduces the likelihood that the AI will make up information in order to fill in the answer.
In addition, the following measures can be taken to further minimize the risk of hallucinations when dealing with document-specific Q&A-based tasks:
- Cite first, answer later.: The AI is required to accurately quote the relevant passage from the provided documentation before answering the question.
- Marking the source of a citation: Require the AI to mark each statement in the generated content with the source number or provenance it cites.
- Mandatory self-verification: Instructs the AI to recheck each thesis statement after generating a response. If no supporting citations can be found, the exposition must be withdrawn.
It is important to emphasize that while these technologies are effective in reducing risk, they do not eliminate it completely. Manual verification of key information remains an indispensable step for content involving important decisions.