How to Write Good Prompts for ChatGPT
You want to write a text promoting a product launch. You use ChatGPT to formulate the text. But the outcome is not at all what you wanted — it’s bland, missing the point, and just plain boring. So with a sigh you decide to write the text yourself after all. Sound familiar?
Writing good prompts is a skill. That’s why companies are currently hiring prompt engineers to do exactly that. This offers a whole new career perspective for students of subjects such as linguistics or philosophy, since good prompt writing is based on the understanding of language and logic, as we will see.
What You Give is What You Get
Rule number one: What you get out mirrors what you put in. In other words, generic prompts produce generic answers.
Example:
Q: Give me the most recent info on artificial intelligence. Use 50 words.
A: As of 2022, AI advances include developments in natural language processing, machine learning, and autonomous driving. There’s growing emphasis on AI ethics, addressing bias, and transparency. AI also plays a significant role in COVID-19 management, from predictive modeling to accelerating vaccine development. It’s increasingly integrated into daily technology.
The answer ChatGPT provides us with is as generic as our question. This might be fine in some instances, but in most cases, it won’t be very useful for our text production.
Here’s a more refined approach:
Example:
Q: You are an academic and you are writing a scientific paper. Your target audience are specialists in the field. Write a definition of artificial intelligence based on recent academic sources only. Indicate your sources. Use 50 words.
A: Artificial Intelligence is a subset of computer science which focuses on creating intelligent systems capable of performing tasks that require human intelligence. These tasks include learning, reasoning, problem-solving, perception, language understanding (Russell & Norvig, 2020)[1].
Source: [1] Russell, S. J., & Norvig, P. (2020). Artificial intelligence: A modern approach. Malaysia; Pearson Education Limited.
The answer differs significantly from the one above in style and content. And only because we’ve changed the prompt a little bit!
Essential Elements of Good Prompts
What constitutes a good prompt? Good prompts start with a clear, concise and unambiguous instruction. This instruction is then supported by adding context and/or examples. Always indicate what kind of output should be created — a presentation, an e-mail to your colleagues, or a promotional text to business clients.
A good model to follow is Dave Birss’ CREATE concept:
- C for Character
Tell ChatGPT what character it should assume:
You are an experienced copywriter in an IT company. - R for Request
This is the actual instruction for ChatGPT:
Write a promotional text for the product XYZ for our website. The product has the following features …The target audience is … - E for Examples (optional)
If you have good examples, add them. ChatGPT will copy them in style and content. - A for Adjustments
Give ChatGPT further (stylistic) directions, either in your first prompt or in further prompts:
Focus on… / Use emotional adjectives / Use plain English / Use subheaders / Use bullet points - T for Type of output
Indicate the type of text you want: a poem, a dictionary entry, a love letter, … Also add the word length. - E for Extras. Add extra phrases to help get the right results.
For example:
- Explain your thinking: to follow ChatGPT’s logic.
- Ignore everything before this point: to start afresh.
- Ask me questions before you answer: to let the program decide where it needs more information.
- Answer only using reliable sources and cite those sources: especially for academic contexts, but the results are still not very reliable, which means that you should always check them.
- Respond “Unsure about answer” if you are not sure about the answer: to make ChatGPT indicate levels of insecurity in its answers. This helps to identify so-called hallucinations.
Also, always tell ChatGPT what you want it to do, and not what you don’t want it to do, because it sometimes overlooks the word ‘don’t’.
So, with CREATE, the following prompt:
Summarize this text.
Turns into something like:
You are an experienced A working for a B company. Summarize this text for a C publication. In your summary, focus on D. The target audience is E. Use X words. Use Y language.
For further inspiration, you can also look at the example above again.
Write prompts until you get the result. Generative AI tools don’t work like search engines. We tend to assume that the text we get at our first attempt is the final thing, but the contrary is the case: If you get a result that is not (quite) right, rephrase and use different techniques until ChatGPT creates a good text for you. Remember: It’s called ChatGPT for a reason: chat with it. If you don’t like the output, tell the program what to change.
Popular Prompt Techniques
There are many ways to reach your goals. Here is a summary of the (currently) most popular techniques.
Zero-shot prompt
The way most people use ChatGPT — writing a prompt without follow-up prompts. If you do this, you assume that the model second-guesses a lot. Usually, this is not very effective.
Few-shot prompt
With several consecutive prompts for one task, you achieve your goal in small steps. You also give it the context and ideally also examples. With this method, you’ll get better responses, because the model will be able to determine your desired tone of voice, structure, and so on. You might run into difficulties as soon as logic reasoning is required, though. In these cases, the approach described next is more fruitful.
Chain-of-thought prompt
Here, you give an example and explain the reasoning behind the answer in the example. In the same prompt, you give ChatGPT a similar task to solve in the same way (Wei et al.). An alternative is to add “think step by step” to the prompt, which means that you’ll be able to see where ChatGPT’s logical flaw is. You can then tweak your prompt again (Kojima et al.).
Final Thoughts
In this post, my focus was on the methods you can immediately use without any further understanding or preparation. For more complex ones such as Retrieval Augmented Generation, go to sites such as promptingguide.ai. Although I tested them with ChatGPT, these tips apply to other generative AI tools, too.
I hope it has become clear that you need to invest a bit of time to try out several few shot prompts until you get a text you can work with. Sometimes you will find that writing short texts yourself is much quicker indeed. Or you’ll opt for a hybrid approach, using the tool to optimize your text rather than letting it write something from scratch for you. Whatever you do, learning its advantages AND its limitations is essential.
Sources/Further Study
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (arxiv.org)
CREATE: Unleashing the Art of Crafting Irresistible AI Prompts | LinkedIn
How to research and write using generative AI tools (linkedin.com)
Language models are few-shot learners (openai.com)
Prompt Engineering Guide | Prompt Engineering Guide (promptingguide.ai)