Conversational Prompting
When writing an AI prompt, there are four essential elements that you should include:
- Goal: What you’re trying to accomplish
- Context: Background for the situation
- Output Format: How you want the response structured
- Boundaries: What you don’t want
By leading with what the output should look like and leaving out unnecessary background information, you can increase the efficacy of the AI at responding to your prompt. Be as specific, descriptive, and detailed as possible with your desired output, including by providing examples of what the output should look like. AI models respond best to clear, explicit instructions.
The AI does not require long, step-by-step instructions on what to do. Instead, describe what a good outcome looks like and allow the AI to determine the steps to get there itself. You can provide a few hard limits and break complicated outcomes down, but too much information creates background noise for the AI and makes it more difficult for it to produce quality responses. Be specific with the information and sources you include, and don’t include extra information just to include it. You should have a reason for each piece of context you give the AI.
There are several steps you can take to reduce hallucinations. First, you can put in your prompt that if the AI does not know the answer to a question, it should say it does not know instead of trying to guess. Many hallucinations originate from the AI attempting to answer questions that it does not actually have the information to answer. You can also ask the AI to provide evidence for each statement so that you can check the sources yourself.
If you are unsure of how to best construct your prompt, you can ask the AI to help you. It will be able to provide guidance on writing your prompt in a way it will be able to understand.
Resources
- OpenAI: Best practices for prompt engineering with the OpenAI API
- Claude Platform Docs: Prompting best practices
- OpenAI Academy: Prompting
- Tribe Academy: Claude Prompting Guide
Image Prompting
Prompting AI to create images is a specialized process that requires slightly different instructions than regular conversational prompting. We recommend writing your image prompts in a consistent format, with labeled sections that move from the background to the foreground of the image. These sections can include background/scene, subject, key details, constraints, and the intended use of the image.
When image prompting, the more details you can provide about your image, the better the result will be. You should provide as much detail as possible about the scene, lighting, people, text, angle, etc. to achieve the best results. You should also be specific about the result you want. You can use words like “photorealistic”, “infographic”, or “UI mockup” directly in the prompt in order to precisely target what you’re looking for in the image.
If you want to produce an image with text in it, there are additional guidelines to follow in order to reduce typos, errors, and formatting problems with the text. Following the general image prompting guidelines, you will get the best results by providing specific instructions about the font style, size, color, and placement of the text. It is also recommended that you keep text short, put text in quotes or all caps in your prompt, and spell out brand names or uncommon words letter-by-letter (e.g., “S-T-R-I-P-E”).