ChatGPT is the generative artificial intelligence (AI) tool that’s taken the world by storm. While there’s always the possibility it will simply make stuff up, 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.
In this article, I’ll show you how to write prompts that encourage the large language model (LLM) that powers ChatGPT to provide the best possible answers.
One of the more interesting things I had to get used to when working with ChatGPT is that you don’t program it; you talk to it. As a formally trained programmer, I’ve had to abandon many habits when engaging with AI. Talking to it (and with it) requires a mindset shift.
When I say talk to it like a person, I mean talk to it like you would a coworker or team member. If that’s hard to do, give it a name. Alexa is taken, so maybe think of it as Bob. This naming helps because when you talk to Bob, you might include conversational details and anecdotes that give your story texture.
Also: How to use ChatGPT to write code
When you’re talking to a person, it would be natural for them to miss your point initially and require clarification or veer away from the topic at hand and need to be wrangled back. You might need to fill in the backstory for them or restate complex questions based on the answers they give you.
This is called interactive prompting. Don’t be afraid to ask ChatGPT multi-step questions: ask, get a response, and based on that response, ask another question. I’ve done this myself, sometimes 10 or 20 times in a row, and gotten very powerful results. Think of this as having a conversation with 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 (for the record, I do not run, dance, or jump — this is merely an example). You could ask ChatGPT:
How can I prepare for a marathon?
However, you’ll get a far more nuanced answer if you add that you’re training for your first marathon. Try this instead:
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?
By giving the AI more information, you’re helping it return a more focused answer.
Here are two more examples of questions that provide context:
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?
Also: The most popular programming languages in 2024 (and what that even means)
The story takes place in 2339, in Boston. The entire story takes place inside a Victorian-style bookstore that wouldn’t be out of place in Diagon Alley. Inside the store are the following characters, all human:
The proprietor: make this person interesting and a bit unusual, give them a name and at least one skill or characteristic that influences their backstory and possibly influences the entire short story.
Another customer is Evangeline, a regular customer in the store, in her mid-40s. Yet another customer is Archibald, a man who could be anywhere from 40 to 70 years old. He has a mysterious air about himself and seems both somewhat grandiose and secretive. There is something about Archibald that makes the others uncomfortable.
3. Tell the AI to assume an identity or profession
4. Keep ChatGPT on track
5. Tell the AI to re-read the prompt.
6. Don’t be afraid to play and experiment