Crafting Prompts for GenAI
A well-crafted prompt can help you get the output you want from a GenAI model, and help reduce the chance of false results and false information, also known as hallucinations. There are a number of frameworks that can help guide you through creating and refining a prompt. One such framework is the CLEAR framework, developed by librarian Leo S. Lo from the University of New Mexico.
The acronym CLEAR stands for Concise, Logical, Explicit, Adaptive, and Reflective-- five concepts that can help maximize the potential for a successful AI generated content. The Concise, Logical and Explicit elements help you engineer an initial prompt, while the Adaptive and Reflective elements reflect the fact that almost all forms of information seeking are iterative-- meaning you try something, figure out what is working and what is not working, and try to make improvements.
Concise: use only essential words. You do not want the AI tool to have to analyze unnecessary words.
- Needs Improvement Example: I would like to know if something like foam rolling is good for my muscles after I exercise.
- Good Example: Benefits of post-exercise foam rolling
Logical: be intentional about the order of ideas in your prompt. A logical structured prompt helps the AI model understand the context and relationships between various concepts.
- Needs Improvement Example: Is it important to swim?
- Good Example: Health benefits of swimming? OR Does knowing how to swim make you safer?
Explicit: provide precise instructions about the format, content, or scope of your desired output.
- Needs Improvement Example: Create a vegetarian diet plan for me
- Good Example: Create a 7 day plant-based diet that includes at least 80 grams of protein per day
Adaptive: After you've run your initial prompt, you might find ways to improve it. AI prompts are no different! After your initial prompt, review the content for additional keywords, context you can add, or additional information about parameters.
- Initial Prompt: Does high impact exercise improve bone health?
- Based on this prompt, we learn that high impact exercise does benefit bone health, but the benefits depend on frequency, intensity, and duration of exercise.
- Adaptive prompt: How frequent and at what intensity do you need to engage in high impact exercise to improve bone health
Reflective: Think critically about the AI tool's answer. Based on what you know of the topic, does it make sense? Does it seem grounded in reality, or is it possible the AI tool has hallucinated? You may also want to reflect on perspectives or experiences that are missing from the response.
- Initial Prompt: Is there evidence that shows doulas make childbirth safer for women?
- Reflective Prompt: Is there evidence that shows doulas make childbirth safer for women of color?
Content adapted from Lo, L. (2023) and from Georgetown University's Artificial Intelligence (Generative) Resources
Read the full CLEAR article
- The CLEAR path: A framework for enhancing information literacy through prompt engineeringThis article introduces the CLEAR Framework for Prompt Engineering, designed to optimize interactions with AI language models like ChatGPT. The framework encompasses five core principles—Concise, Logical, Explicit, Adaptive, and Reflective—that facilitate more effective AI-generated content evaluation and creation. Additionally, the article discusses technical aspects of prompts, such as tokens, temperature, and top-p settings. By integrating the CLEAR Framework into information literacy instruction, academic librarians can empower students with critical thinking skills for the ChatGPT era and adapt to the rapidly evolving AI landscape in higher education.
Prompt Engineering Resources
Additional Articles
- Effective Prompts for AI: The EssentialsMIT STS Teaching and Learning Technologies has created a webpage with examples of how to craft effective prompts for AI.
Books
- Prompt Engineering for Generative AI byCall Number: QA76.9.N38ISBN: 9781098153434Publication Date: 2024-06-25Large language models (LLMs) and diffusion models such as ChatGPT and Stable Diffusion have unprecedented potential. Because they have been trained on all the public text and images on the internet, they can make useful contributions to a wide variety of tasks. And with the barrier to entry greatly reduced today, practically any developer can harness LLMs and diffusion models to tackle problems previously unsuitable for automation. With this book, you'll gain a solid foundation in generative AI, including how to apply these models in practice. When first integrating LLMs and diffusion models into their workflows, most developers struggle to coax reliable enough results from them to use in automated systems. Authors James Phoenix and Mike Taylor show you how a set of principles called prompt engineering can enable you to work effectively with AI. Learn how to empower AI to work for you. This book explains: The structure of the interaction chain of your program's AI model and the fine-grained steps in between How AI model requests arise from transforming the application problem into a document completion problem in the model training domain The influence of LLM and diffusion model architecture--and how to best interact with it How these principles apply in practice in the domains of natural language processing, text and image generation, and code