Skip to Main Content

Artificial Intelligence: Prompt Engineering

General information and guidance on the use of AI for the UCD community

"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):
Lund, B. (2023), "The prompt engineering librarian", Library Hi Tech News, Vol. 40 No. 8, pp. 6-8. https://doi-org.ucd.idm.oclc.org/10.1108/LHTN-10-2023-0189

*There are many methods for how a language model can be prompted. Some examples are:

  1. 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.”

  2. 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.

  3. 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?”

  4. 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."

  5. 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.

  6. 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.

  7. 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.

  8. 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)

  9. 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. Forbeshttps://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


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):
Korzyński, P. et al. (2023) 'Artificial intelligence prompt engineering as a new digital competence: Analysis of generative AI technologies such as ChatGPT', Entrepreneurial Business and Economics Review, 11(3), pp. 25-37.

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):
Moran, K. (2024, May 24). CARE: Structure for crafting AI prompts. Nielsen Norman Group. https://www.nngroup.com/articles/careful-prompts/

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):
Lo, L. S. (2023) 'The CLEAR path: A framework for enhancing information literacy through prompt engineering', The Journal of Academic Librarianship, 49(4), pp. 102720.

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):
Birss, D. (2023) 'How to research and Write Using Generative AI Tools'. LinkedIn Learning. Available at: https://davebirss.com/documents/the_prompt_guide.pdf (Accessed 13 February 2025)

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):
Wu, N. & Stamford, C., USA 2025, "Expanding Horizons in Prompt Engineering: Techniques, Frameworks, and Challenges", INTERNATIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT, vol. 9, no. 1, pp. 1-6.

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.

 

Further Reading (Harvard):
Yao, Shunyu, et al. ReAct: Synergizing Reasoning and Acting in Language Models. arXiv, 2022. DOI.org (Datacite), https://doi.org/10.48550/ARXIV.2210.03629.