Anatomy of a Good Prompt

I'm learning bit-by-bit that there are certain elements that make for a better prompt. This is my attempt at capturing what those are from my current viewpoint. My first attempt at prompting was to make meaning of my morning pages. Since then, I've learned a little more through some work stuff. OpenAI has a best practices guide and I'm sure there are others out there.

Define your chatbot's persona

What are they good at? What prior experience do they have? How do they process information? How do they respond to questions and statements? Basically, the ideal version of the person you'd want to have the conversation with. I was going to say the more specific, the better. But, I'm unsure of that at this point. Sometimes I'm quite vague and it seems to work well. Sometimes it requires being a little more specific to get at the information I'm after.

Context

What information can you provide up front that will help inform the conversation? Just like talking to another person who is an expert in something, they can probably recall specific information regarding their field of expertise easier than others. And they have that information at hand if they need to reference it.

It can also be helpful to provide a higher level overview of how the current conversation fits into a larger process. This makes it clear what arena you're playing in and defines a constraint (more below) as to which area to focus on.

Constraints

Let's use the design analogy. Constraints provide a clear description of the playing field when coming up with a solution to a problem. What information can we include in our decision making process? How does the information need to be structured? What is considered out of scope for this particular conversation or task? There are many articles that touch on this but one that comes to mind is Basecamp's out of bounds section in their book, Shape Up

Definitions

Sometimes it can be helpful to be explicit about the definitions of principles, terminology or other key ideas related to your conversation. Instead of assuming the llm will pull the correct definition, being explicit guarantees you're on the same page regarding how something is defined. You can even use the definition provided by the llm from a previous conversation.

Intent

This has been covered in detail in most prompting guides. Be specific about what kind of information you want back, and how you want it returned to you. Is it structured or unstructured? Should it be markdown or plain text? That's the styling part of it. I often find I'll write down an initial instruction and then over time add more bullet points. I prefer to keep my instructions to individual statements rather than compound sentences.