Prompt engineering is the process of guiding generative models to best produce your desired outputs. To be honest, not enough is yet known about it to really be called “engineering,” so sometimes we just say “prompting.” This is a list of information and resources to get you confidently developing prompts which consistently and reliably deliver you the written content you are looking for.
Stable prompt → the holy grail:
Our end goal is to create something called a stable prompt, which is a prompt which reliably delivers you the content you want even if you modify certain key words within the prompt. If you are repeating a task in which you are using prompts to achieve a single goal with some variation, then it will be worthwhile to invest effort into creating a stable prompt. Unlike a disposable or a one-time prompt, a stable prompt is something you can re-use over and over and get a reliable output. These prompts should be stable enough that you can modify a few key words, and it will still deploy content of equal quality and do so reliably. Creating a stable prompt specifically for your needs is what prompt engineering is all about.
Preparing for Prompt Engineering
- Do a cost-benefit analysis: Before you even start composing your prompt, you need to ask yourself: do you already know exactly what you want to write?
- If yes: Skip the AI. If you know exactly what you want to write, AI is not the right tool for you. The likelihood of it accidentally writing the thing that you want is very low.
- If no: Putting in the effort of composing the prompt is useful if you’re brainstorming ideas, or you know the general direction of what you want to write but not the details. Or if you have two thirds of something done, and need to consider options on how to culminate it all. Or if you have something that you've written and you wanna reformat it. All of these are great use cases for AI, and are worth the effort of designing a prompt.
- Give maximum specificity to your goals: The majority of work in developing your prompt is clearly stating your intention. Ask yourself if it is crystal clear to you on what you are trying to achieve when developing your prompt.
- Use available resources: Can you use pre-existing text from elsewhere? Reusing suitable content can be helpful and time-saving. If you have any kind of language that you already have prepared elsewhere, ready to copy into the prompt, that’s a great way to save you a lot of time. You would utilize this content by giving the instructions, and then telling the AI “replicate the style in the quoted excerpt below”.
Specifiers to mention in your prompt:
While writing up your prompt, try specifying the following characteristics to guide the AI into creating what you want (these work for instruct models only, not completion models):
- Tone - formal, casual, informative, persuasive, etc.
- Format - essay, bullet points outline, dialogue, etc.
- Speak as - expert, critic, enthusiast, etc.
- Objective - inform, persuade, entertain, etc.
- Context - describe the wider context. For example:
- Instead of writing: "Write 10 ideas about sharing lab space in universities."
- Write: "I am working in an engineering department within a university that has recently become an R2 research university. The amount of lab space is fixed, but the number of total faculty, as well as the faculty responsible for research, is increasing. List 10 ideas on how we can we solve this problem of limited lab space, while still ensuring safety, research quality, equipment access and faculty autonomy?"
- Keywords - list keywords or phrases you want to include.
- Examples - offer examples in the prompt, starting with the statement "here is an example."
- Audience - specify the target audience to which the content is tailored.
- Analogies - you can specifically request for analogies (this can be achieved with a chain of prompts)
- Call to action - you can specifically request for the model to end with a call to cation.