Anatomy of a Good Prompt: The Basics of Prompt Design

Prompt Design
Prompt Tips
June 8, 2023

Writing a good prompt is easy, but not immediately intuitive.

And the difference between a good prompt and a mediocre prompt is HUGE.

Here are five tips to internalize for writing better ChatGPT and GPT-4 prompts.

What is Prompt Design?

Prompt design is the art of writing instructions for a generative AI model (like GPT-4, ChatGPT, Google Bard, etc.) that produce the results you intended.

This is often called Prompt Engineering, but here are at Pickaxe we prefer the term prompt design because it's not an exact science. It's an art.

The same instruction written two different ways can get very different results. Writing a good prompt comes down to structure, examples, and being specific.

1. Separate Instruction & Context

There is a difference between the instruction “do x” and the context “do it using Y”. Don’t combine the two. When writing a prompt, you should separate instruction (what you’re telling it do) and context (the details & circumstances). Try writing the instruction as a sentence and the context as data.

❌ A First-time user might write a prompt like:

✅ But a prompt designer would write:

Separating the instruction and the context makes the prompt much cleaner.

Additionally, it’s easier to change later. If you want to add more context such as neighborhood or renovation history, it’s very easy to add them with muddying your prompt.

2. Specify details you want

If you want something specific, tell the machine. Otherwise it won’t know.

This may seem obvious, but somehow it’s not.

Let’s say you want a tweet about the superbowl. Think about what type of Tweet you want. Call out the recognizable traits of what ‘a tweet’ means in your head. Because the machine's idea of a tweet may be much broader than yours.

❌ First-time user:

✅ Prompt Designer:

3. Use examples to guide style

Not getting an output you like?

Feed the machine samples of what you like. You can guide the output by feeding it examples. The machine is smart. It will pick up on patterns.

❌ First-time user:

✅ Prompt Designer:

Don’t forget, you can further improve the above prompt by using techniques around structure/context and specificity.

Keep improving your prompt until you get results you like.

4. Use examples to guide formatting

If you want your output particularly formatted, use examples to teach the machine.

❌ First-time user:

✅ Prompt Designer:

5. Use ALL CAPS to designate labels

Sometimes you want to label parts of your prompt.

For example, you might want to label DESIRED FORMAT, or EXAMPLES, or CATEGORIES. It’s helpful to mark these in a special way so the machine understands you’re labeling something.

Using all caps work, so do other unique markers like ##Double Hashtags## or //code commenting//.

❌ First-time user:

✅ Prompt Designer:

6. (BONUS) The last few words matter!

Remember, LLMs function as auto-complete engines. While it’s important to separate instruction and context, the last few words really influence what comes next. Never forget this!

If you’ve written a good prompt but still aren’t getting what you want, consider stacking the deck.

Pack some extra explicit instruction at the very end.

Here's an example of a satirical twitter chatbot intended to write funny, mean tweets in response to new headlines.

🫤 Here was the first draft of the chatbot prompt:

✅ Here it is a little more caustic:

Those final three words in the capitalized direction make a big difference.

And, remember LLMs function like auto-complete! They’re trying to guess the next word. You can lead it into certain answers.

Even your own mental auto-complete model knows where a letter that starts “Unfortunately,” is headed…

Experiment! The model holds mysteries…

Above all, test your prompts! Test them over and over until you’re getting results you like.

Try stuff out. We are dealing with LLMs, Large Language Models. You are communicating with these machines through natural language, not code. Just like humans, there is a variety of methods for communicating clearly. Some people are very structured and dry, others are very expressive and figurative. You might find you like using examples. There are no absolute rules like programming.

A great way to experiment is with prompt frames — places where you create a prompt, punch holes in it, and run the same prompt with slightly different inputs. Pickaxe prompt builder lets you create prompt frames and play with them endless.

Building a "prompt frame" in Pickaxe
Testing different inputs in a pickaxe

The only advice left is to start writing and testing your prompts.

Go forth, young prompt designer!