Skip to Main Content

University Libraries' Staff Guide to Generative AI: Primer on Prompting

How to Craft Good Prompts

What is a Prompt?

prompt is the original input provided to a Generative Artificial Intelligence (GenAI) tool in order to generate a response or perform a task. As the use of GenAI has spread, prompt engineering has emerged as a term for the many strategies and frameworks that can be employed when writing prompts. OpenAI, the maker of ChatGPT, provides suggestions on how to engineer effective prompts in their OpenAI Prompt Engineering Guide.

Microsoft Cloud. (2023, December 4). AI in a Minute: Prompt Engineering [Video]. YouTube. https://youtu.be/vGdyePbGNaE

Iterate, Iterate, Iterate

Prompt engineering is an iterative process, meaning that your first attempt may not give you the desired results, but you can revise and refine your prompt until the AI tool provides the information you need. UNC English professor Dan Anderson provides tips for how to accomplish this, along with examples, in his video, AI Prompting and Thinking

Generally, it's helpful to be as specific as possible when writing a prompt to avoid receiving inaccurate or irrelevant information. A common approach is specify in the prompt that the generative AI is to take on a certain role, such as that of a writer, educator, or researcher, then have it present the information in a specific form such as a summary, syllabus, etc. Harvard University Information Technology goes into detail about this technique in Getting started with prompts for text-based Generative AI tools.

The CLEAR Framework

The CLEAR Creator

Leo Lo, a librarian and professor at the University of New Mexico, has developed another popular strategy for prompt engineering known as the CLEAR Framework1. It encourages users of generative AI to construct prompts that are Concise, Logical, Explicit, Adaptive, and Reflective.

 

Five Components

  1. Concise: "brevity and clarity in prompts": Ensure the prompt is centered on a specific task and doesn't include unnecessary information.
  2. Logical: "structured and coherent prompts": The information provided to the GenAI tool should be given in a coherent order.
  3. Explicit: "clear output specifications": Be specific and avoid ambiguity.
  4. Adaptive: "flexibility and customization in prompts": Adjust the prompt if the desired response is not received the first time.
  5. Reflective: "continuous evaluation and improvement of prompts": Take a critical look at the prompts you've constructed and the type of information you received in return.  Consider how this insight can be used for future prompting.

 

1Lo, L.S. (2023). The CLEAR path: A framework for enhancing information literacy through prompt engineering. The Journal of Academic Librarianship49(4), 102720. https://doi.org/10.1016/j.acalib.2023.102720

Microsoft PREP Framework

During the UNC Libraries Microsoft Copilot for MS 365 training, Carlos Fernandez, Microsoft Director Specialist for Modern Workplace, presented the Keys to a Good Prompt using the PREP Framework.  

 

Four Components

  1. P: Explain who you are.  Include a persona for your prompt.
  2. R: Let the GenAI understand your audience for the prompt and the role they have within your prompt.
  3. E: Be explicit in your instructions and try to add emotion.
  4. P: Set the parameters of your answer.