-
Notifications
You must be signed in to change notification settings - Fork 2
Prompt Engineering Basics
(Image credit: Google DeepMind, Unsplash)
Prompt engineering is the process of designing effective prompts to obtain desired responses from large language models (LLMs). LLMs are statistical models trained on massive datasets of text and code.
They can generate text, translate languages, create various types of creative content, and answer questions informatively.
However, LLMs are not perfect and can sometimes generate incorrect or misleading information. Prompt engineering can help mitigate these issues by providing LLMs with the necessary information to generate accurate and informative responses.
There are several techniques for prompt engineering, including:
- Using keywords: This technique involves using keywords in the prompt to help the LLM focus on the topic of the prompt. For example, if you want the LLM to generate a love poem, you might include keywords like "love" and "poem" in the prompt.
- Using examples: This technique involves providing examples in the prompt to help the LLM understand the desired format of the response. For instance, if you want the LLM to summarize a news article, you might include an example of a summary in the prompt.
- Using constraints: Constraints can be used to limit the scope of the LLM's response. For example, you might specify the length of the response in the prompt if you want the LLM to generate a 100-word response.
Prompt engineering is a crucial skill for effective use of LLMs. By crafting clear and concise prompts tailored to the specific task at hand, you can ensure that LLMs generate accurate, informative, and creative responses.
(Image credit: CC, ChatGPT and Artificial Intelligence in Higher Education.UNESCO.)
Most chatbots models like OpenAI ChatGPT, Google Gemini, and Anthropic Claude have some similarities, but have inner differences, but accept same syntax.
Type of prompt | Writing styles | Role Playing: "Act as X" |
---|---|---|
Binary | Academic | Agricultural Engineer |
Comparative | Confrontational | Bill Gates |
Explanation | Creative | Chemistry Professor |
Feed-back | Formal | Defense Attorney |
Fill-in-the-blank | Humorous | Environmental Scientist |
Instruction | Informal | Family Counselor |
Multiple choice | Journalistic | Geoscientist |
Ordering | Narrative | Health Educator |
Open-ended | Objective | Industrial Engineer |
Prediction | Poetic | Mark Twain |
Scenario | Technical | William Shakespeare |
more ... | more ... | more ... |
Task | Prompt example |
---|---|
Natural Language Processing | |
Text generation | "Write a ..." |
Summarization | "Summarize this text: ..." |
Open question answering | "(How/Who/What/Where/When/Why) did ..." |
Paraphrase | "Rewrite this text: ..." |
Machine translation | "Translate this text into Language : ..." |
Structured output styles | |
List of objects | "Give a list of quantity object names" |
Numbered lists | "Give a numbered list of quantity object names" |
Create Tables | "Create a table from this list: ..." |
Unstructured output styles | |
Narrative modes (1st, 2nd or in 3rd person) | "Write a paragraph on how to verb something in first person" |
Formal | "Write a paragraph on topic in a formal style" |
Informal | "Write a paragraph on topic in an informal style" |
Personas | "Write a paragraph on topic in the style of persona" |
Media types | |
Write social media posts | "Write a tweet on topic" |
Write blogs | "Write a blog on topic" |
Write Emails | "Write an email on topic to audience" |
Write poems | "Write a poem about description topic" |
Write songs | "Write a type of song about desired topic and show guitar chords" |
Write Resumes / Cover Letters | "Write a job position resume" |
Parameter name | Use | Description |
---|---|---|
Answers |
-a or --answers
|
Specifies the number of output answers (default is 1) |
Category |
-c or --category
|
Specifies the category of prompt (coding, creative, factual, fun, general, music, news, science, sports and writing) |
Format |
-f or --format
|
Specifies the format of output ("html", "markdown", "plain text", other) |
Language |
-l or --language
|
Specifies the required language of output |
Size |
-s or --size
|
Specifies the maximum number of characters in the output |
Temperature |
-t or --temperature
|
Control the creativity of output. The higher the temperature will result in more creative output (maybe less coherent). The temperature can be any value between 0 and 1 (default may be 0.5) |
Here there are applications of eight distinct prompt techniques to interact with the Large Language Models
- Zero-Shot Learning: This method involves assigning a task to the AI without providing any prior examples. The task is described in detail, assuming the AI has no previous knowledge of it.
Prompt: "Explain what is a Learning Theory".
- One-Shot Learning: In this approach, a single example is provided along with the prompt. This aids the AI in understanding the expected context or format.
Prompt: "In philosophy of science, scientific knowledge is constructed by the scientific community, which seeks to measure and build models of the natural world. Explain the role of constructivism in philosophy of science".
- Few-Shot Learning: This strategy involves providing a few examples (typically 2–5) to help the AI comprehend the pattern or style of response you're seeking.
Prompt: "In learning theory in education, there are many theories like Behaviorism, Cognitivism, Connectivism, Constructivism, Humanism and others. What are the key differences from each other and what goals or objectives share in common?"
- Chain-of-Thought Prompt: In this method, the AI is asked to outline its thought process step by step. This is particularly beneficial for complex reasoning tasks.
Prompt: "Describe the step-by-step process of developing a learning objective in Bloom's Taxonomy, from determining the level of complexity of thinking, to writing the objective."
- Iterative Prompt: This process entails refining your prompt based on the responses you receive, gradually guiding the AI towards the desired answer or style of answer.
Prompt 1: "What are the latest developments in learning theories?"
Prompt 2: "Can you give more details on the Cognitive Load Theory and ways to optimize learning?"
- Negative Prompt: In this approach, you instruct the AI on what not to do. For example, you may specify that you don't want a certain type of content in the response.
Prompt: "Are there other theories on multiple intelligences beside Gardner's theory?"
- Hybrid Prompt: This method combines different strategies, such as few-shot with chain-of-thought, to obtain more precise or creative outputs.
Prompt: "Bloom's taxonomy is very useful in learning processes in school environments. Describe how it can be combined in learning processes based on skill development in training courses."
- Prompt Chaining: This involves breaking down a complex task into smaller prompts and stringing the responses together to create a final answer.
Prompt 1: "List some examples of forms of evaluation in learning processes."
Prompt 2: "How does peer reviews in formative assessments and mention a few different practical ways to implement these?."
Prompt examples |
---|
Tell me something I don't know! --size 50 --temperature 0.1 --category factual --answers 3
|
Tell me something I don't know! --size 50 --temperature 1.0 --category fun --language French
|
Create a lesson plan for a {grade level} class that incorporates {specific topic or skill} and engages students through {specific teaching method or activity} |
Create a curriculum map for a {grade level} class that aligns with state standards and includes {specific topic or theme} |
Design a feedback system for {specific type of assignment} that provides constructive feedback to {grade level} students and promotes {specific learning outcome or skill} |
Create a study plan for a {specific subject} exam that includes {specific review materials or strategies} and identifies potential areas of weakness to focus on |
Develop a classroom management plan that addresses common student behavior challenges such as {specific challenge} and outlines specific strategies for addressing them |
Design an assessment or feedback tool that helps {grade level} students track their progress and identify areas for improvement in {specific subject} |
Create a plan for differentiated instruction for a {grade level} class that includes {specific learning style or ability} students |
Design a technology-integrated lesson plan that enhances student learning and engagement in {specific subject} |
Develop a professional development plan for improving {specific teaching skill or technique} in {specific subject} |
Design a classroom environment that promotes positive behavior and learning, including {specific visual or interactive elements} |
Design a project-based learning activity that encourages {grade level} students to apply {specific subject} concepts in a real-world context |
Develop a plan for fostering a positive and inclusive classroom culture, including {specific activities or discussions} |
Create an assessment and grading policy that aligns with state standards and promotes {specific learning outcome or skill} |
Design a plan for building positive relationships with {grade level} students, including {specific strategies for rapport-building} |
Create a lesson plan that encourages {grade level} students to work collaboratively on a {specific project or assignment} |
Develop a plan for learning centers that align with state standards and promote {specific skill or concept} in {specific subject} |
Design a scaffolding plan for {grade level} students who struggle with {specific subject} concepts, including {specific strategies for support and reinforcement} |
Create a lesson plan that incorporates {specific student interest or need} and promotes student ownership of learning in {specific subject} |
Develop a plan for regular self-reflection on teaching practices and identification of areas for improvement |
Create a plan for assessing student learning that includes {specific formative and summative assessments} |
Type | Prompt examples |
---|---|
Exam preparation | |
Generate questions | Generate practice questions on this: {paste material or give topic} |
Multiple-choice questions | Generate multiple choice questions on this: {paste material or give topic} |
Create flashcards | Create flashcards on this topic for me: {paste material or give topic} |
Improve text/explanation | How can the following text/explanation about {topic} be improved?: {paste text} |
Mnemonics | Help me remember the 5 most common fact/properties about {topic} |
Historical or factual events | Help me memorize 20 century History |
Formulas and equations assistance | |
Step-by-step instructions | Find the derivative of f(x) = 3x^3 + 2x^2 + 1 |
Concepts clarification | Clarify the concept for the equation: Find the derivative of f(x) = 3x^3 + 2x^2 + 1 |
Language learning | |
Vocabulary building | What does 'aimer' mean in French and what is the antonym? |
Conversation practice | Engage me in a conversation in French (I'm a beginner) |
Los modelos ChatGPT/Gemini/Claude can help you in the following tasks:
-
Summarization: Can provide brief overviews of lengthy articles, helping to summarize their content.
-
Feedback on essays: Can offer feedback on drafts of academic papers by highlighting areas that need improvement, suggesting alternative phrasing for ideas, and providing general writing tips to enhance the overall quality of the paper.
-
Research assistance: Can assist with research by generating relevant articles, academic papers, and other sources that can be used as references for your work.
Topic explanation includes:
-
Definitions: By entering a keyword or phrase, can generate a definition and provide context to help you understand the meaning of the term.
-
Examples: Can provide examples of how a particular concept or idea can be applied in different scenarios, offering practical illustrations.
-
Explanation of complex concepts: If you struggle to understand a specific concept, you can ask a related question, and ChatGPT/Gemini/Claude will explain it in simpler terms, breaking down complex ideas into more easily understandable language.
A variety of commands makes ChatGPT/Gemini/Claude a flexible tool that can contribute to your academic writing or other assignments. Basic commands include ‘define’, ‘compare’, ‘describe’, ‘calculate’, and ‘summarize’ ─ you can try to type in your detailed request and then iterate adjusting your commands based on the answer the chatbot provides.
ChatGPT, Gemini, and Claude can improve teaching and learning processes by generating and assessing information, and can be used as a standalone tool or integrated into other systems. It can perform simple or technical tasks and examples show how it can augment teaching and learning.
Role playing | Description | Example of implementation |
---|---|---|
Possibility engine | AI can suggest alternative ways to express an idea | Students can write queries in ChatGPT/Gemini/Claude and use the "Regenerate" response function to explore alternative responses. |
Socratic opponent | AI can act as an opponent to develop and argument | Students can enter prompts into ChatGPT/Gemini/Claude, using the structure of a conversation or debate. Teachers can ask their students to use ChatGPT/Gemini/Claude to prepare for discussions. |
Collaboration coach | AI helps groups to research and solve problems together | When completing tasks and assignments, students can use ChatGPT/Gemini/Claude to find information while working in groups. |
Guide on the side | AI acts as a guide to navigate physical and conceptual spaces | Teachers use ChatGPT/Gemini/Claude to generate content for their classes or courses, such as discussion questions, and to seek advice on how to support students in learning specific concepts. |
Personal tutor | AI tutors each student and gives immediate feedback on progress | ChatGPT/Gemini/Claude provides personalized feedback to students based on information provided by students or teachers (e.g., test scores). |
Co-designer | AI assists throughout the design process | Teachers can seek ideas from ChatGPT/Gemini/Claude for designing or updating a curriculum, including rubrics for assessment. Alternatively, they can focus on specific goals, such as making the curriculum more accessible. ChatGPT can provide recommendations and suggestions to help achieve these objectives. |
Exploratorium | AI provides tools to play with, explore and interpret data | Teachers provide basic information to students who write different queries in ChatGPT to find out more. ChatGPT/Gemini/Claude can be used to support language learning. |
Study buddy | AI helps the student reflect on learning material | Students explain their current level of understanding to ChatGPT/Gemini/Claude and ask for ways to help them study the material. ChatGPT/Gemini/Claude could also be used to help students prepare for other tasks (e.g., job interviews). |
Motivator | AI offers games and challenges to extend learning | Teachers or students ask ChatGPT/Gemini/Claude for ideas about how to extend students’ learning after providing a summary of the current level of knowledge (e.g., quizzes, exercises). |
Dynamic assessment | AI provides educators with a profile of each student’s current knowledge | Students engage in a tutorial-style dialogue with ChatGPT/Gemini/Claude, and then request that ChatGPT/Gemini/Claude create a summary of their current knowledge for sharing with their teacher or for assessment purposes. |
ChatGPT 3.5 is an AI chatbot that has been available since November 2022. It has the potential to revolutionize education systems, but it's also a threat. Some people have tried to ban ChatGPT in schools, while others believe it's the "silver bullet" solution to many education challenges around the world. The exact impact of the chatbot on the sector is unclear.
Skeptics say chatbots harm learning, but they disrupt traditional tools like essay writing. With a shortage of 69 million teachers worldwide, could ChatGPT, Gemini or Claude supplement or replace them? The launch of large language models shows potential to replace some human tasks. Are teachers an exception? Can chatbots complete tasks currently done by teachers? What are the risks? How can teachers use ChatGPT, Gemini and Claude to improve their practice and efficiency?
- Enhance lessons. In low- and middle-income countries, teachers face the challenge of making a dense curriculum engaging. To help with this, ChatGPT/Gemini/Claude can translate learning objectives into lesson plans, offer ideas for class preparation, and aid in creating new assignments and assessments. However, ChatGPT/Gemini/Claude does not assist with delivery, so teachers must still have strong teaching skills to ensure quality lessons.
- Create assessment questions. ChatGPT/Gemini/Claude can help teachers improve assessment questions and generate multiple-choice items. It can also encourage higher-order thinking skills by providing prompts for essay questions and practical tasks. By using different types of assessment, teachers can help students develop critical thinking, problem-solving, and collaborative skills.
- Support with language barriers. The ideal scenario is for teachers to instruct in their native language, but some education systems are shifting towards teaching in a second language, such as English, even when evidence suggests the opposite approach. In such situations, teachers who are not proficient in English struggle to teach effectively. A proposed solution is the use of chatbots to enhance teachers' language proficiency, enabling them to teach better in both their native and a foreign language. Tools like Duolingo and ChatGPT reportedly provide affordable, accessible, and highly personalized language lessons.
- Provide additional support to students. ChatGPT/Gemini/Claude can be used by teachers to encourage student curiosity and generate ideas for homework assignments. AI tools are particularly helpful in identifying the source information used in the chats. However, there is a risk that students may ask the chat to complete their homework for them instead of seeking help. To address this risk and teach about integrity, teachers can discuss the limitations of these tools, such as privacy risks, bias, and hallucination. Furthermore, teachers should focus on questions that cannot be answered by ChatGPT, such as those that require knowledge outside of the chatbot's training data, such as human emotions or subjective perspectives.
- Grading assessment and papers. ChatGPT/Gemini/Claude can be used to automatically grade multiple-choice/one-answer tests; it can also help teachers with standards-based grading. This has potential unintended consequences for low accuracy, poor grading or false positive proctoring (mistakenly red flagging students for cheating). When considering systems for proctoring or grading, it is critical to take measures to secure fairness, accountability, confidentiality, and transparency of their algorithms whenever needed.
- ChatGPT Cheat Sheet. Neural Magic.
- ChatGPT Cheat Sheet. Max Rascher.
- ChatGPT for Studying: How to use the AI-powered chatbot to learn anything you want. StudySmarter.
- Learn Prompting.
- Prompt Engineering Guide.
- Prompts for Education: Enhancing Productivity & Learning. Microsoft.
- The Prompt's The Thing: An Essential Guide to Google Bard. Skyscape.
- 100+ Creative ideas to use AI in education. Sandra Abegglen, Marianna Karatsiori and Antonio Martinez-Arboleda.
- 200+ Best Bard AI prompts you can't miss - ChatGPT compatible. TipSeason.
Created: 05/28/2023 (C. Lizárraga); Last update: 05/29/2024 (C. Lizárraga)
UArizona DataLab, Data Science Institute, University of Arizona, 2024.