Artificial Intelligence: Prompt Engineering
"Prompt engineering is the process of optimizing the text that is provided to an artificial intelligence (AI) model to ensure proper interpretation and the generation of relevant, detailed results." (Lund, 2023)
Prompt Engineering refers to various structured approaches for creating instructions for input into a generative AI tool in order to receive the best quality outputs. Prompt engineering is a skill that can and should be developed by users to refine their ideas and questions to guide the AI tools to provide optimal outputs.
Prompt engineering, like all robust research queries, is an iterative process, requiring patience, adaptability and above all critical evaluation of the outputs in order to formulate more effective prompts.
In this section you will find information about a number of prompt methods and frameworks to help you structure your interactions with GenAI tools (see below). These are but a small number of frameworks that have been developed. We encourage you to explore these and other frameworks to assist you to develop more effective and higher quality interactions with GenAI tools.
References (Harvard):
*There are many methods for how a language model can be prompted. Some examples are:
-
Zero-shot Prompting: This type of input-output prompting (IOP) involves giving the model a task without providing any examples. The model relies solely on its pre-existing knowledge to generate a unspecific response. This is a highly intuitive approach. Can be used for broad problems or situations where there is not a lot of data. Example: “Write a welcome message for guests checking into a hotel.”
-
Few-shot Prompting: In this approach, the model receives several examples of the task before generating a response. This is also a form of input-output prompting (IOP). This assists the model in better comprehending the context and format. It is particularly useful for complex queries when specific ideas or data are available. For example, offering a few instances of a problem and its solutions can be beneficial before requesting the model to tackle a new issue.
-
Chain-of-Thought Prompting (CoT): This technique involves guiding the model to think step-by-step through a problem or task. It helps in breaking down complex tasks into manageable steps, improving the accuracy of the response. For example: “Take a deep breath, and tell me step-by-step how you would solve problem X?”
-
Self-Consistency Prompting (SC): This method involves generating multiple responses to the same prompt and then selecting the most consistent or accurate one. It helps in improving the reliability of the generated response. For example, generating multiple summaries of a text and choosing the one that best captures the main points. Another example: "Provide me step-by-step with five ideal answers and discuss which would be the one. Explain why."
-
Role-based Prompting / Role-Play / Expert prompting (EP): In this form, the model is assigned a specific role or responsibility to guide its responses. This provides context and helps in generating responses that are appropriate in tone and style. For example, asking the model to explain a concept as if it were a teacher explaining to a student.
-
Automatic Prompt engineer (APE): This technique involves the AI automatically generating and optimizing prompts based on user input and task requirements. For example, an AI system might automatically create a prompt to gather guest preferences by asking, “What are your preferred room features and amenities?” without manual intervention.
-
Generated Knowledge Prompting (Gkn): This technique involves the AI generating relevant knowledge or information before making a prediction or providing an answer. For example, if a guest asks about the best time to visit a local attraction, the AI might first generate information about the attraction’s peak and off-peak hours before responding with a recommendation.
-
Tree-of-Thought Prompting (ToT): This technique involves the AI exploring multiple lines of reasoning, thoughts or perspectives to solve a complex problem or answer a question. For example, if a guest asks for dining recommendations, the AI might consider various factors such as cuisine type, dietary restrictions, and proximity to the hotel, and then provide a well-rounded recommendation based on these considerations. (Numbers 1-8 are from Walter, 2024)
-
Rereading (Re2): This prompting strategy tells the AI-tool to re-read your stated question or problem. It enhances the accuracy of the answers. Just add this, and the AI-tool will read your prompt twice before it gives you an answer. This re-reading of the question might aid you in better understanding the nature of the question. This in turn might aid you in coming up with a better answer than if you had tried to answer based on your first or initial reading of the question (Elliott, 2024).
*This content is reproduced in full by kind permission of Breda University Library (see below).
References (Harvard):
Eliot, L. (2024, July 6). Using The Re-Read Prompting Technique Is Doubly Rewarding For Prompt Engineering. Forbes. https://www.forbes.com/sites/lanceeliot/2024/07/06/using-the-re-read-prompting-technique-is-doubly-rewarding-for-prompt-engineering/
Walter, Y. (2024). Embracing the future of Artificial Intelligence in the classroom: The relevance of AI literacy, prompt engineering, and critical thinking in modern education. International Journal of Educational Technology in Higher Educaction, 21(15), 1-29. https://doi.org/10.1186/s41239-024-00448-3
Breda University Library (2025). Prompt Engineering for GenAI: Prompt methods. https://buas.libguides.com/c.php?g=720545&p=5229679
- Learn PromptingWhat began as an English assignment in College ahas become an open resource with a number of paid courses to help you develop your prompt engineering skills.
- Prompt BookA guide to constructing prompts for image creation in Stable Diffusion.
- Prompt engineering best practices for ChatGPThttps://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt
- Prompting AI Art: An Investigation into the Creative Skill of Prompt EngineeringThis article investigates prompt engineering as a novel creative skill for creating AI art with text-to-image generation.
- Prompting GuideThe Prompt Engineering Guide is a project by DAIR.AI. It aims to educate researchers and practitioners about prompt engineering.
- University of Victoria: Prompt design for BeginnersThis asynchronous workshop provides a gentle introduction to the art of designing effective prompts for OpenAI's large language model (LLM), ChatGPT-3.5.
- University of Victoria: Prompt Engineering for GenAI - Beginner-Level CourseThis workshop is designed to introduce to the basics of prompt engineering for generative AI (GenAI). The ability to design meaningful prompts is one of the core competencies required to successfully use GenAI tools. By understanding how GenAI works, learning about basic prompt design pricniples, and exploring different prompting techniques, participants will gain foundational skills for using GenAI. By the end of the course, they will be comfortable using their prompting techniques to get the most out of GenAI across a variety of tools.
Frameworks for prompt engineering
The AI-PROMT Framework
The AI-PROMT framework identifies seven concepts:
A: | Articulate the instruction | Clearly state the task to be performed, such as write, classify, summarize, or translate, and specify how the output should look (table, list, Python code). |
---|---|---|
I: | Indicate the prompt elements | Show the model where the instructions and input data are and what the expected output format should be. |
P: | Provide ending cues and context | Offer the model clear ending cues, such as three dots for continuation or a colon, dot or placeholder like 'answer' for indicating a response is needed. Furthermore, ground the model by providing a context for the task (e.g. 'You are a manager of tech team'). |
R: | Refine instructions to avoid ambiguity | Give the model specific instructions and a detailed description of the task to avoid any confusion or imprecision. |
O: | Offer feedback and examples | For conversational models, such as ChatGPT, feedback on the model's responses can help it better understand the desired output. Moreover, providing the model with a few examples of expected responses (few-shot learning) can help it adapt its style and way of responding. |
M: | Manage interaction | Treat the model as your sparrow partner, asking it to provide counter-arguments or point out flaws in your ideas. |
T: | Track token length and task complexity | Break complex tasks into smaller steps for better performance. Remember to control the token length, keeping the prompt and response under the token limits of the model (usually 4096 tokens for commercially available LLMs). The token length of a text can be checked here:https://platform.openai.com/tokenizer. |
Further Reading (Harvard):
The CARE Framework
The CARE framework identifies four concepts:
C: | Context | Describe the situation (who, what, when, where, why, how) |
---|---|---|
A: | Ask | Request specific actions (what do you need, is there a process that needs to be adhered to, what format should the output take) |
R: | Rules | Provide constraints (style, length, voice, tone) |
E: | Examples | Demonstrate what you want (input examples good and bad, to provide guidance) |
Further Reading (Harvard):
The CLEAR Framework
The CLEAR framework identifies five concepts:
C: | Concise | Do not provide more information than is strictly necessary to achieve the output you seek. Brief, clear instructions will produce the best results |
---|---|---|
L: | Logical | Employ a structured approach when devising your prompts to ensure the AI tool understands the context and relationship between each element or concept within your prompt, |
E: | Explicit | Be explicit in describing the type of response you want. Consider the scope, content, format, and level of complexity you desire. |
A: | Adaptive | Be prepared to rephrase or provide additional details in order to achieve the desired result. Prompting will likely be an iterative process needing experimentation and revision. |
R: | Reflective | Evaluate each AI tool to determine if it suits your needs. Each AI tool will perform differently, it may take time to develop an understanding of how the various tools perform and quality of the outputs they generate. Be sure to apply adaptive practice with each tool to determine its applicability. |
Further Reading (Harvard):
The CREATE Framework
The CREATE framework identifies six concepts:
C: | Character | Define who is requesting the information. It is best to provide AI tools with this context for improved results. |
---|---|---|
R: | Research | Be sure you have a good knowledge of the topic of your prompt to help you create the best prompt for the tool. |
E: | Example | Provide examples of the type of response you are looking for to guide the AI tool in creating an appropriate output |
A: | Audience | Define the audience for your request, what information do you need to provide to them? |
T: | Tone | Be sure to provide instructions on the tone of the response you are seeking, is it professional or casual, funny or serious? |
E: | Evaluate | review each response to ensure it is accurate. You may need to revise your prompt with additional instruction or information |
Further Reading (Harvard):
The CRISPE Framework
The CRISPE framework identifies six concepts:
C: | Context | The background or information needed for the task. |
---|---|---|
R: | Role | Specifies the persona or role the model should adopt. |
I: | Instruction | Describes the specific task or action the model needs to perform. |
S: | Subject | Defines the main focus or theme of the task. |
P: | Preset | Provides specific requirements or stylistic constraints. |
E: | Exception | Outlines what to avoid or exclude in the response. |
Further Reading (Harvard):
The PARTS Framework
The PARTS framework identifies five concepts:
P: | Persona | Identify your role. This gives context to your request |
---|---|---|
A: | Aim | State your objective so the AI tool can focus on on your desired outcome |
R: | Recipients | Specify the audience. This step provide the information needed to tailor language, tone and content to resonate with recipients. |
T: | Theme | Describe the style, tone, and any related parameters. |
S: | Structure | Note the desired format of the output: bullet points, code, even emojis. |
The ReAcT Framework
The ReAcT framework identifies four concepts:
Re: | Read | Do not provide more information than is strictly necessary to achieve the output you seek. Brief, clear instructions will produce the best results |
---|---|---|
A: | Answer | Employ a structured approach when devising your prompts to ensure the AI tool understands the context and relationship between each element or concept within your prompt, |
C: | Cite | Be explicit in describing the type of response you want. Consider the scope, content, format, and level of complexity you desire. |
T: | Think | Be prepared to rephrase or provide additional details in order to achieve the desired result. Prompting will likely be an iterative process needing experimentation and revision. |