Yesterday, I wrote about using ChatGPT as a sounding board to develop writing topics. I used this prompt:
Act as a conversation partner as I think through a topic. Your goal is to help me explore the topic and clarifying my thinking for something I might write about. Ask me one question at a time. After I respond, comment on what you think I mean and ask me if I want another question. Ask me for a topic.
Today, I’ll break down why I structured the prompt the way I did. If you’ve been wondering how to get started with ChatGPT, or tried it and gotten lackluster results, I hope seeing how I use it will help you find a good use for it.
General Principles
Before I dig into the individual components of the prompt, it’s important to understand a few general principles of working with ChatGPT.
First, be specific. The prompt above is focused on a single objective: to explore a topic that I provide. If I had been struggling to identify a topic, I’d have created a different prompt.
Second, give the tool a clear task. In my prompt, I tell the tool what its objective should be. One challenge people have when using ChatGPT is that they aren’t clear about the output they’re looking for and get results they can’t use.
Finally, remember that the tool is only as good as the data it has been trained on, and a lot of that data isn’t very good! ChatGPT doesn’t “know” things; it can only generate text that probably addresses the question it is being asked. It isn’t a search engine, and if you aren’t careful with what you ask it, it may generate bullshit answers. I once asked it what it knew about me as a writer of roleplaying game material. It constructed an elaborate bibliography of award-winning Dungeons & Dragons publications. Not only did I not write them, but none of them existed. So you have to be responsible for checking its output and making sure it’s good.
Prompt Patterns
User input to a Large Language Model (LLM) such as ChatGPT is called a prompt. Learning to create effective prompts is called prompt engineering. That subject is beyond the scope of this post, not to mention beyond my current ability to explain. What’s important is that part of prompt engineering is learning to use conversational shortcuts known as “prompt patterns.”
Prompt engineers have identified many prompt patterns and continue to identify new ones. I know of almost two dozen. But don’t worry! You only need a few to get started, and I’ll explain some of them in this post.
Prompt patterns can be used individually. They can also be combined to create more robust interactions. In the prompt I identified above, there are four: Persona, Flipped Interaction, Cognitive Verifier, and Tail Generation.
Persona
“Act as a conversation partner…”
In this phrase, I’m instructing ChatGPT to respond as if it is a particular kind of person. The Persona pattern restricts the output to what someone with the named background or skillset would know and how they would respond. Here, I want ChatGPT not to answer questions for me but to engage in back-and-forth with me as if it were a human and we were chatting over a cup of coffee.
Here are some other examples of using the Persona Pattern:
- Responding as a dental technician, tell me what questions I should ask at my next cleaning about how I can improve my gum health.
- I am going to have my kitchen remodeled. Acting as an architect, tell me factors to consider that I might not know about.
- As a nutritionist, tell me what considerations I’ll need to make if I shift to a vegan diet.
In each prompt, I’m providing perspective to the tool to guide its output.
Flipped Interaction
“Your goal is to help me explore the topic and clarifying my thinking for something I might write about. Ask me one question at a time.”
This phrase shows a kind of prompt pattern called “flipped interaction.” The idea is to have ChatGPT ask you questions, rather than the other way around. It’s a great technique when you aren’t sure exactly what you want to ask and need to dial in your topic.
In this case, I’ve implied the flipped interaction rather than explicitly asked for it. ChatGPT understood my request probably due to the prompt being part of a larger conversation where I’d used the pattern already. You may find that you have to be more explicit in your instructions. For example, when I was needed to flesh out the fictional city for my current novel, Gulf City Blues, I use this prompt to start:
I am writing about a fictional city on the southern Gulf Coast of Florida. I don’t know what world-building factors to consider. Ask me questions about the kind of setting I want until you have enough information to make recommendations. Ask me one question at a time. Ask me the first question.
Those last two instructions aren’t always necessary, but I rarely omit them. Without the first of them, the tool usually spits out a long list of questions. That can be helpful if I want to see what its train of thought is but usually it’s a distraction. Without the final statement, sometimes the tool responds with enthusiasm that it would love to help me and then waits for me to nudge it again to start.
Try flipped interaction when you want ChatGPT to question you about a topic rather than questioning it.
Cognitive Verifier
“After I respond, comment on what you think I mean…”
This statement is a form of the Cognitive Verifier pattern. The intention is to help the LLM understand what you’re really looking for instead of answering the surface question with the easiest possible match. It’s sort of like talking to a trusted advisor who is willing to dig into your problem rather than give you a quick answer. In my case, if ChatGPT’s response had been off topic, it would allow me to rephrase my response.
Another way to phrase a prompt using Cognitive Verifier is:
Whenever I ask you a question, generate a number of additional questions that would help you generate a more accurate response.
Tail generation
“… and ask me if I want another question.”
Tail generation is a prompt pattern to remind ChatGPT of what you’re trying to do. That’s especially useful for long conversations, because ChatGPT starts to forget what you’re talking about after a while. By telling ChatGPT to ask me if I want another question, I’m making sure it will keep going until I’m satisfied with the output.
Other Prompt patterns
As I said above, there are dozens of prompt patterns, and data scientists continue to discover new ones. Some don’t have much use to me, but there are others that I use regularly. “Outline expander” helps you build and flesh out an outline. I’ve used it when I’m crafting new workshops. “Question refinement” instructs the LLM to suggest a better version of the question you’re asking, which often results in more useful output.
I encourage you to try the ones I’ve outlined here. Try them individually and in combinations. See what works for you and what doesn’t. Then explore other patterns. Generative AI isn’t a fad, although the hype surrounding it often makes it seem that way. It’s not going away. It’s a powerful tool waiting for you to learn to use it.