How to Unlock the Art of AI Prompts

Tips from Duke experts and staff on crafting clear, effective chatbot instructions to work smarter

Image
Illustrations of a woman and a man typing on a computer asking it for AI help.
A slide from a PowerPoint presentations shows Albert Einstein next to a chalkboard where he has written "I heart nursing."
A slide from a PowerPoint presentation shows the illustration Microsoft Copilot made with Danett Cantey's prompting. Courtesy of Danett Cantey

She asked for images of ethnically and racially diverse nurses in various roles – but she knew to be specific. For one drawing, she asked for an African American female nurse caring for a Hispanic pediatric patient in a wheelchair. Copilot provided precisely what she needed.

“I'm starting to look for ways that it can help me to work a little more efficiently and not spend so much time on something,” she said. “I’m learning to be specific and just include all the detail you want.”

That’s exactly the recommendation of AI experts who advise on the best way to prompt chatbots for the most accurate and desired responses.

How to prompt AI

As recently as a year ago, Steve Toback had a seven-point process he recommended when crafting prompts – instructions or questions you use to tell AI chatbots such as Copilot what you want. Toback, who is Duke’s Office of Information Technology’s Media Architect and Senior Producer for Academic Media Production, regularly leads webinars on AI, including a September 2024 LearnIT@Lunch session.

“Writing prompts is really kind of an art and a science in one, and it requires trial and error,” Toback said.

But a mnemonic suggested by Microsoft more recently is what Toback points people toward now. It’s all about “PREP” when prompting: P stands for Persona, R for Role, E for Explicit, and the final P for Parameters.

“Just like in life, the better question you ask the better answer you get back,” Toback said. “And there's very specific ways that these chatbots want to be asked questions.”

Here are some of the best suggestions for prompting Copilot or ChatGPT.

A screenshot of the Microsoft Copilot display.
The display screen shown by Microsoft Copilot when prompting it for action. Screenshot of Microsoft Copilot

Persona: Tell AI who you want it to be

You first need to tell AI what kind of expert you need. Using the phrasing “Act as if …” is a good way to start. “Act as if you are an expert on microbiology,” or “Act as if you are a 16th century bard who has to write a poem for a king or your head will get chopped off if it is not humorous and funny.”

“The AI has infinite knowledge of infinity,” Toback said. “You’re telling it to focus that massive brain on how you want it to act. You’re giving it very specific parameters on how you want it to think, and it helps filter out all the noise.”

Role: Tell AI about the audience

Make sure you include the audience for whatever question or request you’re asking AI. Consider starting a sentence with “Explain as if I were …” “Explain if I were a middle schooler who has no knowledge of AI whatsoever.” Or “Explain as if I were an audience of medical professionals at a conference.”

Toback said AI generally encourages use of polite language more often when it’s told that its audience is underage.

Explicit: Be explicit and add emotion

mugshot of Danett Cantey
Danett Cantey

Just as Cantey was specific in what, precisely, she wanted in the illustrations she asked Copilot to create, it’s vital to ask for exactly what you want in detailed terms.

“I would like to do x, y and z, and this is very important,” is a framework to follow.

This is the stage where AI might come back with inaccurate information or incorrect details if nuanced requests aren’t made.

“I'm learning that whatever it spits out you’ve got to fact check it and make sure it’s real,” Cantey said.

Parameters: Give it bounds to work in

Include boundaries for the answer or response you want. For instance, ask for a certain word count or dimensions on an illustration.

And one final suggestion from Toback: Just experiment with AI to get more comfortable with all the ways it can help you.

“Just start typing things in, and then ask it: how can you help me?” Toback said.

That’s what Cantey did when she has needed help on creating simulations recently, and she’s been pleasantly surprised.

“We know it's not perfect, but I’ve been really blown away, because it can give you a really good start and foundation for some simple tasks,” she said.

To learn more about prompts, Microsoft provides additional guidance here.

Send story ideas, shout-outs and photographs through our story idea form or write working@duke.edu.

Follow Working@Duke on X (Twitter),Facebook and Instagram and subscribe on YouTube.