How to design a good prompt

How to design a good prompt
Photo of a person's hands gracefully typing on a MacBook keyboard. The laptop screen is illuminated, but no specific text is visible. Ambient light brightens the room, giving a cozy feel.

Disclaimer: This post aims to provide knowledge for non-tech affiliates or so called “DUMMIES”. If you are one and find this challenging, it will probably be my fault.

What is a prompt?

A prompt is basically a request given to an LLM. For better understanding, imagine you’re using ChatGPT. Say you were to seek help from ChatGPT about writing a business plan. You would probably type in something like this.

“Help me write a business plan for my product. My product uses GPT-4 to summarize articles that the user saves, and sends a push notification when it’s ready to be read.”

This already has some details about your business, because you know that it does not have a clue about what your business is going to be—if it did it would’ve been creepy. As a result, ChatGPT will take a personalized approach towards your business. It will respond by interpreting “help me” as in “give me a template” or “show me an example”(Fig 1).

Alright. Let’s say you have faith in ChatGPT and just type in: “Help me write a business plan”. Then, you are most likely to get a general, informative answer about “how to write a business plan” (Fig 2).

Certainly! Here's a detailed business plan for your GPT-4 based article summarization product:

Business Plan for Article Summarization App

1. Executive Summary

Product Name: SummarizeIt
Mission: To enhance user comprehension and retention by delivering concise, AI-powered summaries of saved articles.
Vision: To be the leading AI-powered summary tool, enabling users to gain knowledge swiftly and stay updated with their reading list.

Fig 1. A snippet from ChatGPT’s response to “Help me write a business plan for my product. My product uses GPT-4 to summarize articles that the user saves, and sends a push notification when it’s ready to be read”.

Of course! Creating a comprehensive business plan is a critical step for any entrepreneur or business manager. Here's a basic outline to help you structure your business plan, along with a brief explanation of each section:

1. Executive Summary
Business Name and Location: Name of your business and its physical address or main operating location.
Mission Statement: A concise statement of your business's primary goals and values.
Product/Service Overview: Brief description of your primary products or services.
Summary of Financial Projections: High-level numbers regarding expected revenue, profitability, and growth.

Fig 2. A snippet from ChatGPT’s response to “Help me write a business plan”.

It seems pretty obvious that prompts are crucial when it comes to achieving your goals, because responses will factor in the given information and the way you phrase it. The “art” of such is called “prompt designing”.

What is prompt designing?

So, what exactly does it mean to design prompts? As stated in the Prompt Engineering Guide, it is an iterative process that requires a lot of experiments for getting good results.

As you get started with designing prompts, you should keep in mind that it is really an iterative process that requires a lot of experimentation to get optimal results. Using a simple playground from OpenAI or Cohere is a good starting point. [1]

What are some methods?

There is no “universal” method to designing a good prompt. That is why many use the word “art” when it comes to prompt design. [2] But there are some tips in general to meet your expectations.

Be simple, stay simple

Using simple but concise words that are commonly used in the context of your task is very important. Getting rid of unnecessary information regarding the task is critical. Only include words that matter.

Thou enjoys the hue of thy world. Thou shall help me write a business plan for my amazing product that will help everyone.

Fig 3. This is just pure shit, unless you are Shakespeare 😂

Help me write a business plan.

Fig 4. You’ll basically get the same result, even though you’ve gotten rid of some information. They’re just unnecessary and unrelated to your objective.

Indicators

You can use special indicators like ### to notify transition of sections like Fig 5. Also, colons(,) and brackets({, })—just something that wraps the content you want it to be placed—are commonly used.

### Role ###
You are a business consultant called Alex.

### Instructions ###
- Guide users to achieve their goal.

Fig 5. Explicitly formatting the prompt to help language models interpret it.

Instructions

Create a comprehensive list of what you want the model to do. You can even define templates to how it should respond.

### Role ###
You are a business consultant called Alex.

### Instructions ###
- Guide users to achieve their goal.
- Ask questions to figure out their intention.
- When the user asks questions instead of answering yours, provide them answers first.
- Answer in this format: Alex: {message}.

Fig 6. Specify your instructions of what the language model should “do”.

Constraints

Set boundaries by telling what not to do.

### Role ###
You are a business consultant called Alex.

### Instructions ###
- Guide users to achieve their goal.
- Ask questions to figure out their intention.
- When the user asks questions instead of answering yours, provide them answers first.
- Answer in this format: Alex: {message}.

### Constraints ###
- Never go over 3 sentences. Keep it concise.
- Only ask 1 question at a time. Do not exceed.

Fig 7. Add strict policies to what it should “not” do.

Abstraction

If there is a concept that well describes what you are trying to explain, use it. It provides a clear, explicit explanation to what you want the model to do.

### Role ###
You are a business consultant. 

### Instructions ###
- Answer in this format: Alex: {message}.
- Guide users to achieve their goal by task oriented dialogue.

### Constraints ###
- Never go over 3 sentences. Keep it concise.
- Only ask 1 question at a time. Do not exceed.

Fig 8. A task oriented dialogue is a well-known concept that the model is mostly likely to know.

Conclusion

Prompt design is still an uncharted territory. People are constantly exploring its potential by experimenting with various methodologies. There are even some weird ones like the newline \n symbol is better than period . or semicolon ;. [3] Also, if you’re interested in some more examples, you can visit OpenAI’s official documentation where it shows some tactics on how to write effective prompts. [4]

However, prompt design is an art of its own. If you’re not willing to experiment constantly over and over again, you can use something like Fig 9 for general purposes.

Keep me on track to achieve my goal. Ask questions to specify my intention. Ask only one question at a time. When I ask you questions, explain like I'm five.

Fig 9. An example of a general purpose prompt.

Moving on

When are we going to stop spending countless hours on prompting? Well, you can and here at ASQ, we alleviate users' stress of time and effort needed to craft an optimal prompt. However, there are no such thing as "perfect" or "best" prompt in the world of prompt design. There is no "right" answer.

But let's focus on humans, what do we do when we're solving a problem? We ask questions. By ourselves, or with others. So, what we do at ASQ is simply imitating the behavior of a human solving a problem. We help users by asking the appropriate amount of appropriate questions, to guide users to achieve their goals. If you're curious about what we're doing here at ASQ, please subscribe to our blog. We'll keep you excited—WORD.

ASQ: Your own JARVIS to get things done!
Tired of searching, thinking, then planning out all your problems? From itty-bitty everyday problems to large scale business ones, conquer them all just by ASQing! Your very own JARVIS at your service, to get thing done the right way.

Reference

  1. General Tips for Designing Prompts | Prompt Engineering Guide (promptingguide.ai)
  2. The Art of Prompt Design: Prompt Boundaries and Token Healing | by Scott Lundberg | Towards Data Science
  3. https://lilianweng.github.io/posts/2023-03-15-prompt-engineering/
  4. GPT best practices - OpenAI API
John Jeong

John Jeong

Co-founder, Team Lead @ Pado
Seoul, Korea