ChatGPT: How to Create Effective Prompts
GIGO. It’s an acronym dating back to 1957 when the US Army’s William Mellin explained to a newspaper reporter that computers were limited by their input. It means “Garbage In, Garbage Out” and it applies as much to today’s incredible generative AI tools as it did back in 1957 to those clunky, old tube-based computing devices.
In the case of an AI like ChatGPT, there’s a lot of opportunity for both garbage in and garbage out. Keep in mind that we really don’t have any idea what’s been fed into it as part of its training. We know that its perception of facts is so fluid, it’s practically qualified to be an American politician. In fact, OpenAI (the makers of ChatGPT) co-founder John Schulman says, “Our biggest concern was around factuality because the model likes to fabricate things.”
Keep that in mind, because no matter how good your prompts are, there’s always the possibility that the AI will simply make stuff up. That said, there’s a lot you can do when crafting prompts to ensure the best possible outcome. That’s what we’ll be exploring in this how-to.
To avoid the GIGO factor, your best bet is to write prompts that encourage the LLM (large language model) within ChatGPT to provide the best possible answers. Writing effective prompts has become its own highly-paid discipline, “prompt engineering.” ZDNET’s Sabrina Ortiz wrote an article entitled, “Do you like asking ChatGPT questions? You could get paid (a lot) for it,” that explored this new employment category.
When working with ChatGPT, you don’t program it, you talk with it. As a formally trained programmer, I’ve had to leave a lot of habits by the wayside when engaging with AI. Talking to it (and with it) requires a mindset shift. Talk to it like a person, like you would a co-worker or team member. If that’s hard to do, give it a name. This helps because when you talk to Bob, you might include conversational details, little anecdotes that give your story texture, a variety of possibilities, and more.
When talking to a person, it would be natural to expect someone to miss your point initially and require clarification. It would be natural for someone you’re talking to to veer away from the topic at hand and need to be wrangled back on topic. It would be natural to fill in the backstory and ask complex questions, and it would also be natural to have to dig in, restating some of those questions based on the answers you got back. All of this is how you should talk to ChatGPT.
Writing a ChatGPT prompt is more than just asking a one-sentence question. It often involves providing relevant background information to set the context of the query.
Let’s say that you want to prepare for a marathon. You could ask ChatGPT: How can I prepare for a marathon? But you’ll get a far more nuanced question if, instead, you tell it that you’re training for your first marathon. The answers you get will be more focused on your needs, as in: I am a beginner runner and have never run a marathon before, but I want to complete one in six months. How can I prepare for a marathon?
Do you see how you’re giving the AI much more information with which to provide you with a more focused and helpful answer? For the record, I do not run, dance, or jump. So this is merely an example. There’s no way I’m going to run a marathon (unless I’m doing it with a V-Twin motor under my seat).
Here are two more examples of questions that provide context:
1. I am planning to travel to Spain in a few months and would like to learn some basic Spanish to help me communicate with local residents. I am looking for online resources that are suitable for beginners and provide a structured and comprehensive approach to learning the language. Can you recommend some online resources for learning Spanish as a beginner?
In this case, rather than just asking about learning resources, the context helps focus the AI on learning how to communicate on the ground with local residents.
2. I am a business owner interested in exploring how blockchain technology can be used to improve supply chain efficiency and transparency. I am looking for a clear and concise explanation of the technology and examples of how it has been used in the context of supply chain management. Can you explain the concept of blockchain technology and its potential applications in supply chain management?
In this example, rather than just asking for information on blockchain and how it works, the focus is specifically on blockchain for supply chain efficiency and how it might be used in a real-world scenario.
Constructing a detailed prompt involves limiting the answer to 500 words because ChatGPT seems to break somewhere between 500 and 700 words, leaving the stories in mid-sentence and not resuming properly when asked to continue. Here’s an example of a detailed prompt:
I’m looking for a story about a scientist who creates a machine that can predict the future with 100% accuracy. The scientist is a recluse who has always been obsessed with the idea of knowing what’s going to happen before it happens. He spends years working in secret on his machine, and when he finally unveils it to the world, it causes chaos and upheaval. Governments and corporations are desperate to get their hands on the machine, and the scientist is forced to go into hiding to protect himself and his creation. Can you write a story that explores the consequences of knowing the future and the lengths people will go to in order to gain that knowledge?
This prompt provides a detailed scenario that encourages ChatGPT to create a story with a specific theme and plot. The more specific and detailed the prompt, the better the chances of getting a satisfactory answer.
In conclusion, crafting effective prompts for ChatGPT involves providing relevant background information to set the context of the query. Talk to ChatGPT like a person, give it a name if that helps, and provide conversational details. The more specific and detailed the prompt, the better the chances of getting a satisfactory answer. Writing effective prompts has become its own highly-paid discipline, “prompt engineering”.