As large, powerful generative AI models like GPT-4 and DALL-E have become better and more available, a niche element of AI has similarly grown in prominence: prompt engineering, the art/science of getting AI to make what you want.
GPT-4 has already been shown to have a wide range of creative uses, from conjuring a website sketched on a napkin to optimizing dating profiles. Getting exactly what you want from the AI takes a bit of finesse, however. Prompt engineering is a bit like casting a spell, Anna Bernstein, a prompt engineer for Copy.ai, explained to Insider. If you get one thing a little wrong, and the result may be a little wrong.
But if you get the prompt right, you just may be able to coax the AI into making whatever is in your head a reality — or something even better.
Luckily for the majority of us, prompt engineering isn’t a purely technical skill; Bernstein is a poet and had a background in freelance writing before becoming an AI whisperer. While prompt engineering has more than a bit of the ol’ trial-and-error to it, there are certain things to keep in mind that can give you the best shot at getting what you want.
Prompt engineering for ChatGPT and other text-generating AI: Because it’s a chatbot — I mean, it’s right there in the name — you may at first be inclined to ask things of ChatGPT conversationally.
But that’s the wrong way to go about it, says University of Sydney Business School lecturer Marcel Scharth, who studies machine learning.
“Instead, adopt the mindset that you’re programming the machine to perform a writing task for you,” Scharth wrote in The Conversation. “Create a content brief similar to what you might give a hired professional writer. The key is to provide as much context as possible and use specific and detailed language.”
That context could include spelling out the points you want made, the format, style, and intended audience, what perspective you want it written from (e.g. first-person), and specific guidance like “no jargon.”
Longer pieces can be broken down into sections, with new instructions given to ChatGPT each time.
When it comes to crafting those instructions, the language you use matters, Bernstein said. Using a verb that makes your intentions clear is key, Bernstein told Insider; “condense this” would be a better prompt than “write it shorter.” ChatGPT is also good at recognizing intent, so introducing what you want it to do right off the bat can help finesse a better result.
Pinning down the right wording and approach can take trial and error; keep in mind prompt engineering is a bit of an art.
“Don’t give up on a concept just because your first prompt didn’t get the result you wanted,” Bernstein said. “Often, finding the right word or phrasing can unlock what you’re doing.”
Prompt engineering for Midjourney: According to Scharth, image-generating AIs don’t need elaborate and detailed prompts to get good results — sometimes a basic prompt followed by the right stylistic keyword, like a bowl of fruit, hyperrealistic or the word ChatGPT, in the style of Ed Ruscha will suffice.
“After I have a rough idea of what I want to accomplish, I try to narrow things down to people, places and things – the core actors or main drivers in the scene I’m trying to construct,” Justin Reckling, who creates prompts for purchase on PromptBase, told The Verge.
While prompt engineering has more than a bit of the ol’ trial-and-error to it, there are certain things to keep in mind that can give you a better shot.
Reckling then uses the AI to create a few basic versions of his prompt, which he can then refine until getting what he likes. “You start with the big important strokes and then work in the finer details,” Reckling said.
Midjourney has specific prompts which can alter aspects of the image, Scharth wrote. Using “—ar” and then a value will set the aspect ratio, “—no” will omit objects you tell it to, and “—stylize” ups the artistic ante but sacrifices following the instructions exactly. The command “—c” produces more uncanny results, using a 0 to 100 scale; the closer to 100, the wilder the AI gets.
Check out the library: Finally, if you just can’t be bothered to do it on your own or are struggling to get what you want, there are multiple prompt libraries and marketplaces popping up online, like the aforementioned PromptBase, the GPT prompt-producing plugin Arvin, and this collection of over 500 ChatGPT prompts broken into categories, which includes translations into Spanish.
Libraries that look to assist in prompt engineering while helping to establish patterns and codes exist to help you out as well, like Microsoft’s prompt engine.
We’d love to hear from you! If you have a comment about this article or if you have a tip for a future Freethink story, please email us at [email protected].