Prompt Writing Best Practices
Purple Prompts
Summary
Writing good prompts for language models like ChatGPT is an art form and a still-evolving area of research. While there are some good practices to follow, we highly recommend experimenting with different ways to phrase your prompts to optimise the results you are getting.
Some general tips
- Imperative instructions: Instead of kindly asking for a favour in a conversationalist tone, giving clear and short instructions often produces better output. Instead of Can you please summarise this article? simply write Summarise the following article:
- Context: It can help the language model to know in what setting it is being executed. This can be a single sentence at the beginning of the prompt, like: Your job is to help an editor finish a new article. or You are responsible for proofreading and fact-checking online articles before they get published.
- Language: If you want the generated output to not be in English, but in a different language (e.g. German), you should write your prompts in that language as well. Adding a simple language hint at the beginning of the prompt, like (deutsch), is often enough.
- House rules: Rules that have to hold for every prompt in the Hub — tone of voice, spelling conventions, topics to avoid — do not belong in each individual prompt. Maintain them once centrally instead, see Hub-wide Ground Rules.
Preventing Hallucinations
A "hallucination" happens when the language model generates text that sounds reasonable and fitting, but which contains false claims and invented facts. This is an inherent challenge with all language models, as there is currently no feasible way of automatically fact-checking their output, and their task is only to produce text that sounds plausible. There are, however, some proven ways to reduce the chance of hallucinations.
Especially in the scenario of Rewriting Articles (e.g. summarisation), we can ask the model to stick to the source it was given and not invent any other facts. Some phrases that might work for this are Make sure that your summary is consistent with the text and does not contradict it. or Verify that all your claims are supported by the original text.
Output Format
For prompts that fill specific metadata, like Title, Excerpt, Yoast "SEO-Title", ACF fields, etc., the whole response of the language model will be redirected into that field. It is thus important to use the correct wording in the prompt to get the desired output format. Instead of Set the title field to a summary of the article, ask the AI to directly answer (only) with the desired value, like Give me a title that represents a summary of the article.
For any prompt that is used in modifying/rewriting the article, especially if the task only affects some specific content blocks, make sure to ask the AI to still answer with the whole updated article content - as here again, the whole AI response will be taken as-is to replace the current article content. So instead of asking Generate a catchy subheading for this article, try formulating it more like this: Update the article content with a subheading. Respond with the whole article content, even all unchanged blocks, but fill the existing 'subheading' block with a catchy phrasing.
Special case: WYSIWYG blocks
If the HUB is set up this way, there are some WYSIWYG blocks for making working in the editor more intuitive. This includes the "Purple Excerpt" block as well as "Purple ACF Block" blocks. They allow users to edit the article excerpt or ACF fields as if it were blocks in the editor. Beware, tough, that in the underlying data models these blocks are empty, and are only placeholders where the user can see and modify these values, while the Purple-Prompts AI still needs to operate on the original values directly.
So you should not, in your prompt, ask the AI to read the value of the excerpt block or copy the text from the xyz ACF block, since there is no value in these blocks. Instead, ask for these properties directly, like read the excerpt or copy the xyc ACF field.
Similarly, the AI also cannot write into these blocks. So instead of having a prompt of type "Rewrite Article" where you ask to write xyz into the excerpt/acf block, make a dedicated prompt with "Use As" set to "Generate Excerpt" or "Generate ACF field".