Persona prompting

In a recent post on using ChatGPT, I covered four prompt patterns I’d used for a specific task. Today, I want to elaborate on one of them. The persona prompt pattern is enormously useful, and I’ll take a deeper look into how to use it.

What is it?

The persona pattern is named for what it does: it instructs ChatGPT to respond as a specific person or type of person. ChatGPT’s training data is vast. As a result, it can be difficult to get it to focus on what you want. The persona prompt channels ChatGPT to select the kinds of details it should focus on as it generates its output. Focusing the output also helps when you aren’t sure what type of output you want, but you do know the kind of person you might ask for those details. For example, you might not be sure what to describe at a murder scene, but you know that a homicide detective could tell you what’s important and what’s not.

Pattern Structure

The structure is simple: “Act as a {persona name},” replacing the curly bracket text with whatever you need. “Act as a homicide detective…” in the example above. Then you follow it with the body of the prompt. Here’s an example:

Act as a medical historian and outline the important events in 17th century Europe.

You’ll get information about the Great Plague of London, the development of microscopy, and advancement in understanding human anatomy, among other topics. Omitting the persona produces output that describes events pertaining to wars, politics, and arts in addition to mentioning the effects of the Great Plague.

You can also append a prompt with this structure. For example:

The protagonist in my novel is a gambling addict. What are some things she might do to hide her problem from her family? Respond as a behavioral psychologist.

The last statement executes the persona pattern.

Variation: Outputs

A variation on the Persona pattern can help you narrow your scope, especially if you’re not sure what you want. The variation looks like this: “Provide outputs that {persona} would create.” Here’s an example:

My character wants to help a struggling student improve her grades. Provide outputs that a teacher would suggest.

I’m not a teacher, so I might use this prompt to know what kinds of assignments, exercises, or other tools a teacher might provide to the student. Then I could focus on the ones that support your story.

Uses

You can use the persona pattern to support your writing in many ways. Here are some things I’ve done with it:

  • Research assistant. While working out what a fictional Florida city might look like, I didn’t know how to start. I prompted ChatGPT to answer as an Urban Anthropologist and tell me factors I ought to consider.
  • Sounding board. “I’m having trouble coming up with a red herring for a mystery novel. Ask me questions about my plot from the perspective of a mystery reader until you can suggest some options for me.” That combines the persona with another kind prompt pattern, flipped interaction. ChatGPT probed what I already had in the way of plot twists before suggesting options that got my thinking started again.
  • Character development. I’ve provided the LLM with some details of the character’s background and psychology and then asked it to respond to questions as that character. That has helped me generate new ideas to deepen backgrounds, suggest motivations, and dilemmas the character might face.

You can combine multiple personas to examine a question from different perspectives. In the city-building example, I didn’t stop at Urban Anthropology. I also asked about the city from the perspective of the 19th century robber baron who founded it, a 1970s civil rights activist, and a teen who lives there today. Those outputs gave me fresh ideas to pursue.

These three ideas only scratch the surface of what you can do with the persona prompt pattern. Try it out, and please leave a comment telling me how it worked out for you.

Cheat GPT

“But isn’t that cheating?” a writer friend asked when I mentioned that I’m learning to incorporate ChatGPT into my writing workflow. So we’re not friends anymore.

No, no, that’s not true. We had a fascinating discussion about it. I won’t try to reconstruct it, but I will dig into why I’ve come to embrace a tool that I, too, was skeptical about when it burst onto the scene not long ago.

And I was skeptical. Very. My initial experiments with ChatGPT produced poor results. Media portrayals of how it worked were shallow at best and often wrong. That, and what I saw people doing with it, led me to think of it as a plagiarism machine. After I explored its capabilities a little more I changed my mind. While it can be used unethically, that doesn’t change the value of the tool, and I don’t think it’s “cheating” to work with it.

CNC Routers and Woodworking

Bear with me on a digression. One of my hobbies is woodworking. That community has a lot of people who believe that using power tools isn’t “real” woodworking. It’s not butch enough if you flip a switch; you must do everything with hand tools. Of course, if you drill into that opinion (YSWIDT) you discover that they can’t back it up with much more than “because it makes it too easy.” Weird flex, my dude. (It is almost always a dude.) Do you fell your own timber, then mill it from the trunk, and so on? What does “too easy” mean?

But even people who accept power tools often balk at one in particular: the CNC router. A CNC (Computer Numerical Control) router uses computer code to cut complex shapes into and out of wood. Using a CNC router allows woodworkers to create amazing designs and shapes that would be difficult if not impossible to create by hand. An easy way to start an argument in the woodworking community is to talk smack about CNC machines, either pro or con. And the most common criticism is that using one is “cheating.”

That’s a load of crap. When you use a CNC machine, it’s only doing what you tell it to. It’s still executing on the decisions you make and the design you give it. It expands the range of what you can create. And by “you,” I mean “not me,” because I don’t have space for one in my shop. But I’d get one if I could.

ChatGPT is a Power Tool

Using ChatGPT is more complicated than using a CNC. You can’t put a slab of wood onto a CNC, turn it on, and expect something to emerge. Whereas with ChatGPT, you can certainly give it a shallow prompt and it will generate output that looks like something a human might have written. It looks like something that a particularly ignorant first-year high school student might have written, but it’s something. But ChatGPT is tool that can help you create something with greater detail and depth than you could without it, so in that way it’s similar.

Using ChatGPT looks like cheating because it seems like you’re getting something for nothing. And it’s fair to say that some people are using it that way. I don’t even have to cite any examples; you’ll probably see an article in the news *today* about how someone tried to pull a fast one with ChatGPT and it blew up in their face. Because ChatGPT is so much more robust at simulating human thought, it’s easy for people who are lazy, unethical, or both, to use it poorly.

It’s only “cheating” if you use it to cheat–such as trying to pass off its writing as your own. But that’s simple plagiarism, and it’s wrong whether you’re buying a term paper from a human writer and turning it in with your name on it or having a computer create the paper. Using ChatGPT as a sounding board, or a way to challenge your thinking, or to enhance what you would do on your own without it? None of those examples is “cheating,” unless you want to be like the weirdos who look down on people who use table saws.

Learning to use Large Language Models (LLMs) like ChatGPT will change the way you work. Word processors did, too. So did the invention of the disposable ink pen, and the fountain pen, and so on. The tool is an extension of the user. Learning to use ChatGPT doesn’t make you less of a writer; it only makes you a different kind of writer. It isn’t cheating. It’s adapting.

Are you using ChatGPT? What difficulties are you encountering with it? Leave questions in the comments, and I’ll try to answer them in future posts.

How I’m using ChatGPT, and how you can use it, too

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.

Does ChatGPT dream of electric lawyers?

Ken White, AKA “Popehat,” posted a screen shot on Bluesky last night of a ChatGPT conversation.

His prompt: What does Ken White think about RICO?

ChatGPT’s response:

“As of my last knowledge update in January 2022, Ken White… has not expressed a singular or uniform opinion…” followed by some general summary of varying opinions about RICO, and finishing with “To get the most accurate and up-to-date information on Ken White’s views on RICO…I recommend checking his recent writings…”

White’s comment was, “Still some bugs to work out.”

A screenshot of Ken White's Bluesky post, He has posted a screenshot of the conversation summarized above, with the comment, "Still some bugs to work out."

White is a lawyer with a very public and long record of commentary on RICO. It’s not surprising that he’d view the response as buggy. I had a similar reaction when I first experimented with ChatGPT. I asked it what it knew about me as a writer. It provided a list of my published works. None were real. I thought, how useless is this thing if it just makes things up?

That understandable reaction highlights a few common, interconnected misconceptions about ChatGPT:

  • That it is a search engine,
  • With access to all information (or at least on the Internet),
  • Therefore, its so-called hallucinations (AKA “making stuff up”) proves that it doesn’t work.

None of those misconceptions are true.

ChatGPT is not a search engine. It is not a tool for retrieving information, although sometimes it will work for that purpose. You may have seen an explanation that it generates its text via probabilities of words occurring near each other. There is much more to it, but that explanation is good enough for our purposes right now. When you prompt ChatGPT, it doesn’t retrieve information. It determines the most likely first word or phrase in a response, then the next word or phrase, and so on.

The quality of that output depends on the quality of its training data. The training data shapes its responses. Getting 100% reliable information is never going to happen because its training data isn’t 100% true.

OpenAI has been coy about the exact content of the training data, so there’s no way to know for sure what the tool has digested. But we do know that fiction is included. That’s thanks to some Google researchers who tricked it into divulging some of its training data. They found blocks of published novels in the output. So fiction can creep into responses.

Beyond that, some of its data consists of false information. When I ask it questions about Scrum, its responses draw on the Scrum Guide. They also draw on articles written by people who didn’t know what they were talking about. The Guide says that a Sprint is no more than one month. A lot of people have written that it is “two to four weeks.” ChatGPT doesn’t know that the latter statement is false, only that it has seen it made frequently.

Garbage In, Garbage Out

Furthermore, ChatGPT hasn’t been trained on all data, everywhere. It hasn’t even been trained on everything that’s available on the Internet. To return to Ken White’s example—was ChatGPT trained on all of his writing? On some? On none? We can only guess. Given the response, it’s probably a very small amount of “some.”

ChatGPT responses remind me of an extemporaneous speaking competition I participated in during high school. You’d be given a random object (one was an internal part of a vacuum cleaner) and a few minutes to gather your thoughts. Then you had to give a five-minute speech about some doodad you probably knew nothing about. The contest was judged on style, presence, and audience engagement. If the criteria had been, “Did the presenter give me accurate/useful information about the object,” no one could have won.

You can elicit valuable output from ChatGPT. It requires going beyond information retrieval and learning something about the art of prompt engineering. But that’s a topic for another time.

ChatGPT has limitations and drawbacks, and there are serious ethical considerations about what its training data contains. I’m not qualified to address that topic. But based on what I’ve learned so far, I know that it’s pointless to criticize ChatGPT because it fails at a task it isn’t designed to do.

Dr. Chatbot or: How I Learned to Stop Worrying and Love the LLM

Last spring, a friend recommended that I learn prompt engineering for ChatGPT. He said it was going to be bigger and more important than anyone realized. I was skeptical, given the various apocalyptic pronouncements I was seeing in the news. But he’d never steered me wrong before. (He warned me not to trust LastPass long before news came out about their first breach, for example.) I watched a couple of YouTube videos on the subject and played around with the tool. I even signed up for a paid subscription so I could access ChatGPT 4 and its associated features.

My results were hit-or-miss. Asked to help me design a workshop, ChatGPT produced an impressive outline and cited a dozen sources I should use to improve my knowledge of the topic. All the sources checked out as real. Asked the same question on a different topic, it gave me vague information about how a workshop should flow. I experimented with having it help explore character creation for a novel; the result was so cliché that I’d have been embarrassed to use any of it. I decided that Large Language Models were an interesting toy that didn’t live up to the hype, cancelled my OpenAI subscription, and turned my focus to other things.

In October, I noticed that one of my colleagues was doing interesting things with AI. After talking to her about what she was doing, I thought I should investigate the subject. When I asked my friend where I should start, he said, “I told you. Prompt Engineering. I can’t stress enough how important it is.”

Clearly, YouTube videos weren’t going to cut it. I also had tried asking ChatGPT itself about the subject, with similarly mixed results to my earlier experiments. I decided to take a class. I found a three-course specialization on Coursera and dove in. I’m so glad I did. I gained a solid understanding of what LLMs do and an appreciation of how they can enhance human creativity and ingenuity.

Beyond the insights about how LLMs work and what they can be used for, I realized that working with ChatGPT is fun. As far back as Junior High School, when I learned FORTRAN and then BASIC, I’ve enjoyed exploring what I can make a computer do and using them to solve problems. When I got into Scrum and agile coaching, I got away from those roots. Don’t get me wrong—I regret nothing about becoming a Scrum Master and a consultant in the agile space. But I’d forgot how fun it is to ask myself, “What can I make this machine do?”

Now that I’ve finished the specialization, what’s next? I’ll keep learning. There is so much more to know! I’m taking a break from studies through the end of the year, but in January I plan to enroll in a course on Python programming. That will allow me to regain my engineering chops. And, because Python is so useful in working with ChatGPT, I’ll continue to explore the world of generative AI.

Join the content generation

A nifty extra to WordPress’s writing prompt feature is the ability to see how others have answered the same prompts. During last week’s daily blogging experiment, I discovered some thoughtful and thought-provoking responses. I also discovered ones that I’m sure were vomited forth from ChatGPT.

How do I know? The titles were the first giveaway. I mentioned on Friday that I suck at titles. After I wrote my response to “Who are your favorite artists,” I was stumped for a title. I pasted in my essay and asked ChatGPT for some suggestions. Here are a few it came up with:

  • Art Ignorance: Why I Can’t Choose a Favorite Artist Yet
  • The Vanilla-Chocolate Dilemma: On Having a ‘Favorite’ Artist
  • Exploring the Limits of Taste: Why I Don’t Have a Favorite Artist

These are objectively terrible. Even my worst titles have more life than those. But while scrolling through the other responses, I saw many titles with the same structure. “Blah blah: Yadda yadda yadda.”

So what, right? I can’t be the only person who has trouble with titles, and not everyone will be as put off by ChatGPT’s results. But many of the posts were obviously not written by humans, either. I’ve done a lot of work with ChatGPT, and I recognize its style. Long, bloated sentences. Overuse of superlatives. Filler phrases like, “In today’s modern world.” And the last paragraph often starts with “In conclusion” or “In summary.” ChatGPT’s output reads like you chopped up a million freshman essays, blended them into an unimaginative slurry and put it on tap. Yuck.

It’s not writing. It’s what marketing gurus call “content generation,” which is a horrifying phrase all by itself. It’s the linguistic equivalent of a long, concrete-block hallway illuminated by naked florescent bulbs. Nothing good lies at the end of it.

I read to broaden my horizons with fresh perspectives and insights drawn from personal experience. AI-generated “content” is never going to give me that.