Prompt engineering
Prompt Engineering simply means asking good questions to the AI. A prompt is your input with your question or request.
Prompt engineering involves devising targeted questions and instructions to help chatbots provide the right answers during chats. With better prompts, you get better results.
Together with the specifications of the chosen model, this determines the quality of the answer.
Elements of a prompt (question)
To get better results, you should consider the following points:
- Goal: what exactly do you want from the language model?
- Role: what role does the language model have?
- Context: background information about the request
- Style: what style do you want to use?
- Output: what format do you want? For example, are you writing an article, an email, or a letter?
The goal
Precisely describing the goal of your question is essential and cannot be omitted.
What do you want to know?
- Fact questions are possible, but be aware of the limitations (for example, current knowledge may be missing)
- Just like in Google, you won't get exactly the same answer if you ask the question multiple times
- The advantage is the “chat” function so you can ask follow-up questions
Example prompt with a clear goal:
Give a description of the main challenges of teaching remotely
Remote teaching brings various challenges. Some important challenges are:
-
Technological barriers: Not all students have access to the required technology, such as a computer, internet connection, or necessary software. This can result in unequal access to teaching materials and communication, causing some students to fall behind.
-
Motivation and engagement of students: In distance education, it is harder to maintain students' attention and engagement. They can be distracted by other activities or respond less quickly because there is no direct interaction with the teacher. It is essential to motivate students and increase engagement to achieve effective results.
-
Social interaction and collaboration: Distance education offers less room for social interaction and collaboration among students. The lack of face-to-face interaction can hinder learning, especially in activities where collaboration is essential. Teachers must devise alternative ways to enable students to communicate and collaborate virtually.
-
Assessment and feedback: Assessing progress and providing effective feedback to students can be challenging in distance education. Teachers must find creative and reliable ways to evaluate students and give feedback on their work without the possibility of direct observation.
-
Technical problems and connectivity issues: Distance education depends on technology and can be affected by technical problems such as software errors, slow internet connections, or server overload. These technical problems can disrupt the continuity of lessons and cause frustration for both teachers and students.
-
Pedagogical adjustment: Teaching remotely often requires adapting the pedagogical approach. Teachers must learn new methods and strategies to effectively convey the material and support students, taking into account the specific characteristics of distance education.
-
Workload and balance: Distance education can lead to an increased workload for teachers, as they must spend extra time and effort adapting their course materials and managing virtual learning environments. It is important to find a good balance between work and private life to prevent burnout.
Adding role and context
Adding a role and context results in better and more specific answers.
Example of the same question but with role and context:
As a secondary school teacher, give a description of the main challenges of teaching remotely to third-year havo students
Teaching remotely to third-year havo students brings various challenges for teachers. Some of the main challenges are:
-
Limited interaction: The lack of physical presence complicates direct interaction between the teacher and students. It is harder to ask questions, hold discussions, and provide feedback. The teacher must find creative ways to use digital platforms to stimulate interaction.
-
Technological obstacles: Not all students have equal access to technology or internet connections. Some students may have difficulties participating in online lessons or submitting assignments. Teachers must find ways to overcome these barriers and ensure all students can participate in remote teaching.
-
Self-discipline and motivation: Remote teaching requires students to have self-discipline and motivation to work independently. The absence of a physical classroom can lead to distractions and reduced motivation. Teachers must find ways to increase student engagement and encourage them to stay motivated.
-
Differentiation and individual guidance: It is harder to provide differentiation and individual guidance in remote teaching. Teachers must find ways to support students individually and ensure they receive enough attention to grow and learn.
-
Evaluation and feedback: Evaluating and giving feedback can be more challenging in remote teaching. It is important to use various evaluation methods suitable for online learning while providing effective feedback to support students' learning processes.
In short, teaching remotely to third-year havo students requires creativity, flexibility, and perseverance from teachers to tackle the diverse challenges and ensure all students can continue learning and developing.
Techniques
Below we describe several techniques you can use for more advanced prompts.
Technique 1 - giving examples
To ensure the language model uses the same style you want, provide one or two examples.
This method is called “one & few-shot prompting”
Write a letter to parents about the use of mobile phones in the classroom. Use our policy for writing the letter. (insert the text from the policy). Use as an example this letter the management recently wrote to parents, but do not use any information from this letter: (insert the text from the letter)
The full prompt is as follows:
Phone policy during lessons • All students put their phone in the phone bag upon entering the classroom. The teacher does not need to remind you of this. • Phones in the phone bag may only be taken out if the teacher has given prior permission. • If your phone is visible without the teacher's permission, it will be confiscated. • You can pick up your phone at the reception at 16:15 after confiscation. • The school is not liable for theft or damage of phones stored or confiscated in the phone bag. Using the phone bag does not mean the phones are entrusted to the school. • Use your phone only during lessons if the teacher asks you to and look forward to breaks to maintain all your social contacts (online and offline)!
Use for the style this letter the management recently wrote to parents, but do not use any information from this letter. Dear parent/guardian,
On Wednesday, August 30, the information evening marking the start of the new school year is scheduled. The evening focuses on getting to know the mentor and, of course, important general matters will be shared. Important topics will be discussed and we sincerely hope you can attend.
The program is as follows:
18:45 Arrival with coffee/tea
19:00 Program start
20:45 Program end
This evening is not intended for students!
Kind regards,
Mr. L. Hopeful and Ms. P. de Zwart
Department Heads
Below is the language model's answer to the detailed prompt with examples
Dear parent/guardian,
We hope you had a pleasant summer holiday and that your children are ready for a new school year. We would like to inform you about our policy regarding the use of mobile phones in the classroom.
To create an optimal learning environment, we have decided to implement a phone policy. This policy means that all students must place their phone in the phone bag upon entering the classroom. It is the students' responsibility to do this independently, without the teacher having to remind them.
Phones in the phone bag may only be used when the teacher has given prior permission. It is therefore important that students only take their phone out when explicitly allowed. If a phone is visible without the teacher's permission, it will be confiscated. Confiscated phones can be picked up at the reception at 16:15.
It is important to emphasize that the school is not liable for theft or damage to phones stored or confiscated in the phone bag. The phone bag serves only as a tool to safely store phones during lessons. Phones are explicitly not entrusted to the school.
We encourage students to use their phones only during lessons when necessary and when the teacher requests it. Social contacts can be maintained during breaks, both online and offline. We want students to focus on their schoolwork and create an optimal learning environment where they can fully concentrate.
We hope you as a parent/guardian understand our phone policy and discuss it with your child. Together we can ensure that students get the best out of themselves.
If you have any questions, please feel free to contact the school.
Kind regards,
Mr. L. Hopeful and Ms. P. de Zwart Department Heads
Technique 2 - giving a template
To ensure the language model uses a certain format, provide a template and an example. This ensures the language model structures or formats its answer in a specific way. You can think of very different formats useful in situations such as:
- csv output for importing into an Excel sheet
- json output for programming
- Group division for planning a sports day
Example prompt: Can you name three major wars from the 18th century? Format your answer as follows: War name: From year: To year: Countries on one side: Countries on the other side:
For example: War name: First World War From year: 1914 To year: 1918 Countries on one side: Germany, Austria, Ottoman Empire Countries on the other side: France, United Kingdom, Russia
This method is called “output templates”
Below is the language model's answer to the prompt with an output template
War name: Seven Years' War From year: 1756 To year: 1763 Countries on one side: Prussia, United Kingdom Countries on the other side: France, Austria, Russia
War name: American War of Independence From year: 1775 To year: 1783 Countries on one side: United States, France, Spain, Netherlands Countries on the other side: Great Britain
War name: Napoleonic Wars From year: 1803 To year: 1815 Countries on one side: France, Napoleonic allies (such as Spain, Italy, and German states) Countries on the other side: United Kingdom, Prussia, Russia, Austria
Technique 3 - giving a hint
To ensure the language model starts and writes in a certain way, give a hint. Here we write the hint at the end of the prompt.
Example prompt: Can you summarize this article for me? (paste your article text). Start your answer with: The main points from this article are:
- PASTE THE ARTICLE TEXT
This method is called “cues and hints” This example uses an article from the internet: https://www.leraar24.nl/2619420/onderwijs-op-afstand-wat-hebben-we-geleerd/
Below is the language model's answer to the prompt with a hint
The article discusses the experiences and lessons of teachers who provided distance education during the corona crisis. They had to decide which lessons could be given online and which were better done on paper. Some notable points are:
-
Mandy de Vries, a teacher at Nutsschool Morgenstond, created workbooks for her students to work at home. She communicated with parents via email, gave students a daily schedule, and called the students weekly. The school also used an online platform, Snappet, for extra practice material.
-
For many families, it was difficult to support their children's education at home, especially for parents who also worked from home.
-
Schools had to digitize rapidly, despite differing opinions within the team.
-
Special education made the situation more complex due to a lack of necessary equipment and attention to behavior and social interaction. The school tried to maintain contact with students in various ways, such as via video messages or phone calls.
-
The article contains practical tips for remote assignments, maintaining contact with students, and advice for parents working from home.
Overall, the article emphasizes the importance of innovative solutions, flexibility, communication with parents, and maintaining routine and structure in the educational process during the pandemic.
Technique 4 - splitting content from instructions
Sometimes the prompt is very long due to extra content and the language model does not interpret exactly what you want. You probably saw this in the previous example. Then split the content with triple quotes at the beginning and end of the text from the rest of the prompt.
Example prompt: Can you summarize this article for me? “”” (paste your article text). “”” Start your answer with: The main points from this article are:
This method is called “content splitting” This example again uses an article from the internet: https://www.leraar24.nl/2619420/onderwijs-op-afstand-wat-hebben-we-geleerd/
Below is the language model's answer to the prompt with split content. We use triple quotes or three asterisks to separate the context of the question.
The main points from this article are:
- During the corona crisis, teachers had to devise strategies and techniques to make distance education as effective as possible, while parents took on a larger role in supporting their children.
- Important factors for successful distance education were organizing a structured daily schedule, maintaining open communication between teacher and student, and making well-considered choices about which lesson components could be done online or on paper.
- Challenges relate to finding ways to support vulnerable students and the extra pressure placed on parents, especially those who also work from home.
- There was a rapid increase in digitization in schools, with the addition of new digital tools and methods. The article mentions teacher Mandy de Vries, who despite her short teaching experience, was able to help her colleagues with her digital skills.
- The article also emphasizes the importance of ongoing contact and attention for students, especially those in special education, and offers practical tips to achieve this for both teachers and parents.
- Finally, the article hopes that parental involvement in their children's distance education will continue even after the pandemic.
Technique 5 - ask for extra information first
You can give instructions to first ask additional questions before generating the answer. This way the language model helps you improve and specify your text.
Example prompt: “I want to create a lesson plan for 3 havo, in which we cover the lever law. The lesson lasts 45 minutes and I want to do an experiment demonstrating how the lever works. Before you write the lesson plan, can you ask me additional questions to improve the lesson plan?”
This method is called “ask before answer prompting”
Below is the language model's answer to the prompt asking for additional information
Of course! Here are some questions I can ask to improve the lesson plan: What is the goal of the lesson? Do you want the students to understand what the lever law entails and be able to apply it? Have you already gathered materials or resources to use during the lesson? For example, videos, images, or text about the lever law? How much prior knowledge do the students have about this topic? Should they already know what a lever is or do you want to introduce this during the lesson? Which terminology and concepts should the students understand to grasp the lever law? Think of things like the arm of a lever, the fulcrum, and the effort and resistance forces. Do you already have ideas for the practical part of the lesson where you want to demonstrate the experiment? If so, what materials and steps are needed to carry out the experiment? Do you think 45 minutes is enough time to explain the lever law, demonstrate the experiment, and possibly let students experiment with their own lever constructions? What questions or thought exercises can you give the students to evaluate their understanding and application of the lever law?
With this additional information, we can get a better picture of the goal and execution of your lesson plan and improve it.
Below is the language model's answer to the first question
- I want them to understand and apply the formula of the lever law
- I have no materials yet
- They have no prior knowledge
- They must know arm, fulcrum, and forces clockwise and counterclockwise with the symbols
- I want to use a lever with weights
- That should be sufficient
- They can try to balance by placing weights on the lever themselves
Below is the language model's second answer
Thank you for the additional information! Here is an example of how the lesson plan could look:
Lesson plan: Lever law - 3 Havo
Lesson goal: By the end of the lesson, students can understand and apply the formula of the lever law.
Duration: 45 minutes
Materials needed:
- Board and marker
- Lever with weights (for example, a wooden plank with a fulcrum in the middle and weights on both sides)
- Possibly extra weights or other materials to make their own lever construction
Lesson flow:
-
Introduction (5 minutes): Start the lesson by taking the lever scale as an example. Explain that in this lesson we will study the lever law, which helps us understand the relationship between the applied force and the resistance. Ask a few questions to the class to stimulate prior knowledge. For example: "What are some examples of levers in our daily life?", "What is a fulcrum of a lever?".
-
Explain theory (15 minutes): Explain the basic principles of the lever law, including the formula F1 x AF1 = F2 x AF2. Define the key concepts: the arm of a lever, the fulcrum, the effort force, and the resistance force. Use the board to draw illustrations and give examples of different lever constructions. Involve the students by asking them about the properties of the lever constructions they see. Visualize the lever law formula with example calculations and show how to apply it in different situations.
-
Demonstration (10 minutes): Demonstrate the experiment with the lever and weights. For example, place a 500-gram weight on one side of the lever and let the students adjust the effort force on the other side until the lever is balanced. Discuss the values of the forces and arms used to create balance and relate this to the lever law formula explained earlier. Answer any questions from the students and encourage them to take notes.
-
Practical exercise (15 minutes): Let the students work in groups of 2-3. Give each group a lever with weights or let them make their own lever construction with the available materials. Assign the groups the task of balancing the lever by placing weights correctly along the arm. Walk around the classroom to guide the groups, answer questions, and check if they apply the lever law formula correctly.
-
Conclusion (5 minutes): Gather the students again and briefly discuss what they have learned about the lever law. Let some groups present their findings and solutions while you classify them based on how accurately they applied the lever law. End the lesson by discussing the importance of the lever law in daily life and reiterate the importance of force and arm in creating balance in lever constructions.
This lesson plan provides a general framework that you can adapt to your class's needs and available materials.
Technique 6 - emotional prompt
You can give instructions to adjust the tone of the text to the underlying emotions.
Example prompt: “I want to write a letter to an angry parent. She wrote the following: “”” …. “”” (paste the text) I want the letter to take into account all the emotions involved.”
This method is called “emotional prompting” This example uses a letter found on the internet: https://www.ouders.nl/forum/ouders-en-school/kan-ik-deze-boze-brief-afgeven-lang
The full prompt then reads:
I want to write a letter to an angry parent. She wrote the following: """Dear school board,
Your last letter about the Easter breakfast upset me. After the extra parent activities this year at the start and end of each project for which I have to take time off to be there, the change of school hours causing me to work one hour less per week (my boss loves that!), the after-school care that may triple in cost in 3 years, the party week where I took time off earlier to watch the sponsor run only to find out it started half an hour earlier so I could only catch the tail end, fun group 5 assignments that cannot be done independently at home (find out what this ingredient is and make a nice presentation), the mandatory fruit eating with new lunchbox, the change from a joint Easter breakfast organized by the parent council to making an Easter breakfast for another child is the last straw.
Why do I have to look for currant buns, nice Easter decorations, sandwich toppings we don't have, a paper plate (there are 20 in a pack, I only need two) and arrange that nicely on a tray early in the morning (for 2 children) and then transport it by bike (can you imagine that) to school? First, I don't see the point of the Easter breakfast, as it has nothing to do with schoolwork. If it is organized because it is fun, then I must disappoint you. I will probably have two children at home complaining that they didn't get what they like (my daughter has already written down as a precaution that she doesn't like cheese, because she only likes a few types of cheese). Besides, as a parent, you want the best for your child, which causes the average parent to really put effort and spend money not to fall behind other parents. Don't we have a parent council that organizes these kinds of things? Is the parental contribution too low? I think it is cheaper to buy one large pack of chocolate sprinkles than 20 small ones, so it is not cheaper overall, but the costs are just distributed differently. In short, I am not participating in the Easter breakfast this way."""
I want the letter to take into account all the emotions involved.
Below is the answer we received from the language model
Dear parent,
First of all, I want to thank you for your candid communication regarding the Easter breakfast. Your anger is clearly felt, and I understand that various emotions are involved in this matter.
It is evident that many changes have taken place within the school over the past year, such as extra parent activities, changes in school hours, and the possible increase in costs for after-school care. I understand that these changes have a significant impact on your life and that the feeling of discomfort and frustration has increased as a result. It is unfortunate to hear that you have to take time off to participate in parent activities and that this causes problems in your work situation. I also understand that adjusting school hours can negatively affect your working hours. These are serious concerns that I fully understand.
Regarding the Easter breakfast, I understand that you are disappointed about the change from a joint breakfast organized by the parent council to making a breakfast for another child yourself. You describe the efforts you have to make to meet the requirements, such as finding specific products, purchasing certain decorations, and presenting the breakfast on a tray. I understand that these tasks are not only costly but also require a lot of effort. Moreover, it is disappointing that your children may not get what they like, which can cause extra frustration.
Furthermore, you wonder why this Easter breakfast is not organized by the parent council and whether the parental contribution is insufficient to cover such events. You rightly point out that joint purchases, such as buying one large pack of chocolate sprinkles instead of multiple small packages, can save costs and possibly achieve a fairer distribution of the burden. It is important to mention that your emotions are understandable and that your concerns are taken seriously. However, I must also mention that organizing such events and involving parents in activities is an important part of our school community. Coming together and enjoying these occasions can contribute to parental involvement, children's social development, and creating a positive atmosphere within the school.
To address your concerns, I will discuss this matter with the school board. I will convey your feedback to them and ask them to consider this issue when planning future events. Your input is invaluable, and we want to ensure a school environment where parents feel heard and understood. I hope we can find a solution together that is acceptable to both you and the school community. If you have other concerns or questions, please do not hesitate to discuss them with me.
Thank you for your time and understanding.
Kind regards,
Technique 7 - asking for multiple versions
Here you request multiple versions of an answer, so you have options. For example, you want the model to help come up with lessons with activating teaching methods. There are many possible methods, so you want several options. A good example is found under setting roles, under "Activating teaching methods". This also uses a system prompt to further guide the model.
You can read more about roles in the relevant article. This example with multiple versions is at the very bottom of the article. It is not fully repeated here.
Technique 8 - combining with a system prompt
With a system prompt, you can give instructions to the AI model. It is an instruction you can give the model to specifically shape the task or behavior of the model. You can include what kind of output you expect from the AI model. It is a way to steer the model and prevent irrelevant or unwanted answers.
Some examples of simple and general system prompts:
"I want you to be a friendly and helpful assistant."
"Always remain professional and respectful in your language."
"Focus on giving concrete, to-the-point answers without unnecessary details."
The system prompt sets the tone and expectations for the specific conversation or task you want to perform with the AI model.
You can also devise more advanced system prompts for specific tasks, such as summarizing a text: "Analyze the given text carefully and provide a concise but informative summary of the main points. Identify the core message and key details."
System prompts do not have the same influence on every AI model. With chatGPT it works very strongly, with Claude also, with other models the influence of a system prompt is less. Interesting to try out and see which model works best for your input.
You can set a general system prompt in preferences, but it is best to create these system prompts per task you want to automate. We call this roles in AI-School.
You can read more about roles in the relevant article.
Annotating a passage
Select text in a completed chat message and choose Annotate. Write a question or change instruction in the window, for example ‘Make only this sentence simpler’, and choose Save. You can annotate multiple passages this way. Then send; an extra prompt in the input field is not necessary but allowed. The passage remains saved with the comment, even if you switch to another window in between. You can remove an annotation before sending. On mobile, press and hold the text to select.