Prompt Engineering 101

Prompt Engineering 101

Prompt Basics for Generative AI

Based on best practices from Open.AI, my own testing, and review of AI prompting research, here are some basics about prompt engineering:

“Genius in a Room” Mental Model

Open.AI Jessica Shieh’s “genius in a room” mental model is a great place to start:

Imagine you live next door to a genius (or at least a very smart friend who reads a ton, up until 2021) and the only way you can communicate with him/her is to slide a piece of paper under the door and ask for a reply.

This genius in the room does not have any context on you nor the problems you trying to solve.

He/She can’t see your face, doesn’t know where you are, cannot read your emotions, doesn’t have the unique knowledge you have and has no idea what you are trying to do.

The genius only accepts questions when they are written on a piece of paper and slipped underneath the door.

Given that, how would you write your prompts differently?

With this “genius in the room” mental model, you now know – context is key.

Providing the right context can have a huge impact on the quality of the output as you perceived it.

Some best practices:

  • Explain the problem you want the model to solve
  • Articulate the output you want – in what format (” answer in a bulleted list”), in what tone/style (“answer the question as a patient math teacher…”)
  • Provide the unique knowledge needed for the task”

Mega-Prompt

Another model is the “mega prompt” which consists of three parts:

  1. a specific role or scenario
  2. examples for the AI to follow
  3. the parameters for how you want to receive the AI output

Prompt Libraries

Here are some prompt libraries to help you get started: