Activities: Learn Prompting

Basic programming techniques.

Published

22 Apr, 2024

Designing effective prompts to instruct LLMS to generate a desired output is referred to as prompt engineering. This activity will guide you through the process of creating prompts for LLMs.

Prompting Guidelines

In this activity, you can explore various prompting guides for LLMs. They more or less all converge on the same set of techniques. You can then use these techniques to write your own prompts

OpenAI give a set of strategies for using their models.

These include:

  • writing clear instructions
  • providing reference texts
  • splitting tasks into subtasks
  • giving GPT ‘time to think’
  • using external tools

Some general techniques are:

  • Numbered Steps:: For sequential tasks, use numbered steps. This helps the model understand the sequence of actions.

  • Use delimiters: To separate various parts of the prompt (e.g. ", `,, ', |, #, …).

  • Few-shot prompting: Provide a few examples for guidance.

  • Give the LLM a role: Make the model assume a role. For example, instruct the model to act like a tutor or you are an expert programmer.

  • Iterate and refine prompts: Often, you won’t get your desired result straight away. Improve your prompting strategy iteratively, and then once you are happy, choose your final prompt and use it in a new chat session.

Combining these techniques, a template prompt might look like this:

Template
  1. Role: who is being simulated?
  2. Task: what is to be done?
  3. Steps: what are the steps to complete the task?
  4. Context: what is the context of the task?
  5. Goal: what is the goal of the task?
  6. Format: what is the format of the output? How long should it be?

Remember to structure your prompt in a way that is clear and easy to understand. You can use markdown to format your prompt, and you instruct the mode to format its response using markdown.

Examples

Adopt a persona

Prompt:

You are an expert on the topic of university education and didactics. Explain the concept of “flipped classroom” to a group of teachers. Use markdown to format your response. Keep you explanation concise and to the point.

Certainly! Here’s a concise explanation of the “flipped classroom” model, tailored for a group of teachers:


Flipped Classroom: An Overview

The flipped classroom is an innovative educational model that rethinks the traditional learning environment by reversing the roles of classwork and homework. This approach shifts direct instruction from the group learning space (the classroom) to the individual learning space (typically through digital means), allowing the classroom to transform into a dynamic, interactive learning environment where teachers guide students in applying concepts and engaging creatively in the subject matter.

Key Components

  1. Pre-Class Preparation
  2. Videos/Lectures: Students watch recorded lectures or engage with other instructional materials at home.
  3. Readings/Activities: Additional resources may be assigned to complement the video material.

  4. In-Class Time

  5. Active Learning: Class time is dedicated to exercises, projects, or discussions that deepen understanding.
  6. Personalized Support: Teachers provide one-on-one assistance, clarifying doubts and addressing individual needs.

  7. Feedback & Assessment

  8. Continuous Feedback: Regular quizzes and interactive activities provide immediate feedback to students and teachers.
  9. Formative Assessment: Emphasizes understanding and improvement, guiding future teaching and learning strategies.

Benefits

  • Enhanced Engagement: Encourages active participation and collaboration among students.
  • Personalized Learning: Allows students to learn at their own pace, reviewing materials as needed.
  • Critical Thinking: Fosters a deeper understanding by applying concepts during class activities.
  • Teacher-Student Interaction: Increases meaningful interactions, focusing on guiding rather than lecturing.

Challenges

  • Access to Technology: Requires that all students have access to necessary technology at home.
  • Student Motivation: Success depends on students’ willingness to prepare outside of class.
  • Preparation Time: Developing materials and planning active learning sessions can be time-intensive for teachers.

Conclusion

The flipped classroom model represents a shift towards a more student-centered approach to learning. By reimagining the use of class time, it offers opportunities for deeper engagement and personalized support, preparing students more effectively for complex problem-solving and collaborative work. However, its success depends on careful planning, access to resources, and the motivation of both teachers and students.


I hope this provides a clear and helpful overview of the flipped classroom concept for your teaching strategies!

Now let’s try a different persona:

Prompt:

You are 13 year old high school student. Explain the concept of “flipped classroom” to your friends. Use markdown to format your response. Keep you explanation concise and to the point.

Hey friends! 🚀 So, I learned about this cool way of learning called a flipped classroom. Let me break it down for you:

What is a Flipped Classroom? 🤔

A flipped classroom is like turning our normal classes upside down. Instead of the teacher talking and us listening during class, we do the opposite.

How Does It Work? 🛠️

  • At Home: We watch videos or go through materials on our own. This is usually the “lecture” part but done at home.
  • In Class: Instead of listening to the teacher, we do activities, projects, or discuss what we learned. It’s all about applying what we know and asking questions.

Why It’s Cool 😎

  • More Control: We can pause or rewatch the videos at home if we don’t get something the first time.
  • Better Help: In class, the teacher helps us directly with what we’re stuck on.
  • Fun Learning: Doing activities and projects in class is way more fun than just sitting and listening.

So, it’s like we get the best of both worlds – learning at our own pace and then using class time for the fun and tough stuff! 🌟

Reference texts

Prompt:

You will be provided with

  • context: documents delimited by triple quotes
  • a question

Your task is to provide a simplified answer to the question using only the provided document and to cite the passage(s) of the document used to answer the question. If the document does not contain the information needed to answer this question then simply write: “Insufficient information.” If an answer to the question is provided, it must be annotated with a citation. Use the following format for to cite relevant passages ({“citation”: …}). Cite only the relevant sentence(s) of the document, not the entire document.

Document 1: ’‘’The flipped classroom intentionally shifts instruction to a learner-centered model, in which students are often initially introduced to new topics outside of school, freeing up classroom time for the exploration of topics in greater depth, creating meaningful learning opportunities.’’’

Document 2:’‘’With a flipped classroom, ’content delivery’ may take a variety of forms, often featuring video lessons prepared by the teacher or third parties, although online collaborative discussions, digital research, and text readings may alternatively be used. The ideal length for a video lesson is widely cited as eight to twelve minutes.’’’

Question: What is a good length for a video?

A good length for a video in a flipped classroom is eight to twelve minutes. (“SOURCE”: The ideal length for a video lesson is widely cited as eight to twelve minutes.)

Try asking a question that cannot be answered with the provided documents:

Prompt:

You will be provided with

  • context: documents delimited by triple quotes
  • a question

Your task is to provide a simplified answer to the question using only the provided document and to cite the passage(s) of the document used to answer the question. If the document does not contain the information needed to answer this question then simply write: “Insufficient information.” If an answer to the question is provided, it must be annotated with a citation. Use the following format for to cite relevant passages (“SOURCE”: …). Cite only the relevant sentence(s) of the document, not the entire document.

Document 1:’‘’The flipped classroom intentionally shifts instruction to a learner-centered model, in which students are often initially introduced to new topics outside of school, freeing up classroom time for the exploration of topics in greater depth, creating meaningful learning opportunities.’’’

Document 2:’‘’With a flipped classroom, ’content delivery’ may take a variety of forms, often featuring video lessons prepared by the teacher or third parties, although online collaborative discussions, digital research, and text readings may alternatively be used. The ideal length for a video lesson is widely cited as eight to twelve minutes.’’’

Question: Can you recommend a good book on the topic of flipped classrooms?

Insufficient information.

Structured output

You can also use prompts to instruct the model to produce structured output. For example, you can ask the model to give you a table.

Prompt:

You are a high school teacher. Give me a table containing Greek letters in one column, their pronunciation in the second column, and examples of usage in the third column. Give me a maximum of 6 rows.

Output:

Certainly! Here’s a table with Greek letters, their pronunciations, and examples of their usage:

Greek Letter Pronunciation Example of Usage
α (Alpha) AL-fuh α particle, α decay in physics
β (Beta) BAY-tuh β sheet in biochemistry, β radiation
γ (Gamma) GAM-uh γ rays in physics, Γ function in mathematics
δ (Delta) DEL-tuh δ function in mathematics, Δ change in variables
ε (Epsilon) EP-si-lon ε in calculus for limits, ε-nets in computational geometry
θ (Theta) THAY-tuh θ angle in trigonometry, θ in spherical coordinates

This table provides an introduction to some of the Greek letters, how they’re pronounced, and where they might commonly be found in scientific and mathematical contexts.

Exercises

  1. Write a prompt that will make ChatGPT or Copilot act as a writing critic.

You can use this as your starting point, and then iteratively improve it.

Your first step could be to translate this into German.

Feedback on a text

I want you to act as a [harsh/constructive] critic. Criticize what I give to you and show me where my argumentation is lacking. Start by asking me what text I would like feedback on. Then give me your feedback.

If you need an essay, you can use this one. There should be plenty to criticize.

Sollten Schulnoten abgeschafft werden?

In unserer heutigen Bildungswelt gibt es viele verschiedene Methoden, um den Fortschritt und das Wissen eines Schülers zu messen. Eine der gebräuchlichsten Methoden sind Schulnoten. Aber sollten wir wirklich Noten verwenden, um den Wert eines Schülers zu bestimmen? Ich glaube, dass Noten in Schulen abgeschafft werden sollten, und hier sind meine Gründe dafür:

Erstens, Noten sind oft subjektiv. Verschiedene Lehrer haben unterschiedliche Meinungen darüber, was eine “A” -Arbeit im Vergleich zu einer “B” -Arbeit ist. Ein Schüler könnte in einem Fach bei einem Lehrer eine “A” bekommen und bei einem anderen Lehrer eine “B”. Dies zeigt, dass Noten nicht immer ein genaues Bild von dem Wissen eines Schülers geben.

Zweitens, Noten erzeugen unnötigen Druck. Viele Schüler fühlen sich durch die Noten, die sie bekommen, gestresst und überfordert. Dieser Druck kann zu Angstzuständen, Depressionen und anderen gesundheitlichen Problemen führen. Wenn es keine Noten gäbe, könnten sich die Schüler mehr auf das Lernen konzentrieren und weniger darauf, eine bestimmte Note zu bekommen.

Drittens, durch die Abschaffung von Noten könnten Schüler mehr Freiheit in ihrer Bildung haben. Sie könnten Themen studieren, die sie wirklich interessieren, anstatt sich darauf zu konzentrieren, welche Themen ihnen die besten Noten bringen würden. Dies könnte zu einer besseren und umfassenderen Bildung führen.

Einige könnten argumentieren, dass Noten notwendig sind, um den Fortschritt eines Schülers zu messen. Aber es gibt viele andere Möglichkeiten, den Fortschritt zu messen, wie zum Beispiel Portfolios, Präsentationen oder Projekte. Diese Methoden könnten ein genaueres Bild von dem Wissen und den Fähigkeiten eines Schülers geben.

Abschliessend glaube ich, dass Schulnoten mehr Schaden als Nutzen bringen. Sie sind oft subjektiv, erzeugen unnötigen Druck und beschränken die Freiheit der Schüler. Es ist an der Zeit, dass wir ein neues System finden, um den Fortschritt und das Wissen unserer Schüler zu messen.

  1. What role should the model assume?
  2. What is the task? Try to have the essay critiqued, and then ask for suggestions for improvement.
  3. Have the model provide an improved version of the essay.
  4. Instruct the model to show you the changes it made to the essay (you can use markdown to format the output).
  5. Instruct the model to list the changes it made to the essay in a table, and to explain why it made each change.
  6. Reflection: Did your prompting strategies work? What worked well? What didn’t work well?

Further Resources

  1. Explore these prompt guides. Use both/either ChatGPT and Copilot to try out new ideas.

Prompting guide: DAIR.AI (Democratizing Artificial Intelligence Research, Education, and Technologies). The guide is licensed under an MIT license.

Back to top

Reuse

Citation

BibTeX citation:
@online{ellis2024,
  author = {Ellis, Andrew},
  title = {Activities: {Learn} {Prompting}},
  date = {2024-04-22},
  url = {https://virtuelleakademie.github.io/promptly-literate/pages/activity-cas-hochschuldidaktik.html},
  langid = {en}
}
For attribution, please cite this work as:
Ellis, Andrew. 2024. “Activities: Learn Prompting.” April 22, 2024. https://virtuelleakademie.github.io/promptly-literate/pages/activity-cas-hochschuldidaktik.html.