AI Prompt Engineering for Instructors

[Guest post by Mike Reese, Associate Dean of the Center for Teaching Excellence and Innovation & Associate Teaching Professor of Sociology, Johns Hopkins University]

My colleagues and I are regularly invited  to speak with faculty about the impact of generative artificial intelligence (AI) on teaching and learning including leading workshops about the topic. A faculty friend suggested over lunch, “Let’s stop talking about it. Help us start using it!” That was the genesis for the workshop, Prompt Engineering for Instructors – a workshop hosted by the Center for Teaching Excellence and Innovation (CTEI) in February in which we modeled prompting strategies for instructors developing course materials.  The workshop focused on text-based, large language models (LLMs) rather than other tools like DALL·E,  a generative AI tool which generates images.

Before starting, we reviewed important considerations when using generative AI applications for teaching:

  • FERPA – You should not enter any personally-identifiable student data into non-university approved tools (e.g., general subscription to OpenAI’s ChatGPT). Doing so would be a violation of FERPA.
  • Access – The most powerful models are not surprisingly fee-based. If you ask your students to work with generative AI tools, remember some students mayMan using application to generative AI contents have access to better models than others if they can afford to pay a subscription fee.
  • Resources –  While these tools are powerful, they are also resource intensive (e.g., power and water usage). Consider the need for using these tools with the environmental impact.
  • Knowledge Cutoff – The LLMs you use were trained on sources up to a certain date, known as the knowledge cutoff. Asking questions or generating assignments about events after that knowledge cutoff are likely to lead to hallucinations unless the LLM is provided additional information when generating its response.

I shared some general strategies that I use when prompting LLMs. The following strategies are inspired by Jules White’s Prompt Engineering workshops on Coursera and Jordan Wilson’s Everyday AI’s Prime-Prompt-Polish workshop.

  • Be specific and detailed – Providing more specificity and detail in your prompt will focus the response. The LLM will follow your directions literally so make sure you communicate exactly what you want.
  • Give it a role / Motivate it / Provide context – Consider telling the model who you want it to respond as (e.g., your role!) and include helpful context (e.g., information about your course!) to inform its response. “You are a college faculty member teaching Introduction to Sociology…”
  • Provide examples – This is often called one-shot or few-shot prompting. For example, when asking a LLM to draft homework problems, I include examples of problems from previous years.
  • Optional: Describe desired output/format – Describe the format for the response (e.g., create a rubric in a table format with the criteria in the rows and rating categories in the columns).
  • Optional: Intentionally choose which LLM to prompt – Each LLM has its own personality. It takes time to learn these, but as you do, you may find some models are better for specific tasks.
  • Optional: Suggest (iterative) improvements – If you don’t like the response, repeat with follow up prompts explaining what you don’t like and improvements to make.

Prompt Examples

Below are the prompts demonstrated during the workshop with notes on each to explain the principles above. Generally, we used Anthropic’s Claude 3.5 Sonnet.

Writing Learning Objectives

Anthropic Claude AI chatbotWe started by asking Claude to write learning objectives for an introductory sociology course that I teach. The purpose of these three prompts was to show how providing more specificity and detail generated different responses.  The last response incorporates assigning Claude a role: me, a faculty member teaching a college-level sociology course.

  • Prompt 1: Develop learning objectives for a sociology course.
  • Prompt 2: Develop learning objectives on culture for a sociology course.
  • Prompt 3: You are a faculty member teaching an introductory-level sociology course at a college. One unit is on culture. Write three objectives for a unit on culture at each of the lowest levels of Bloom’s taxonomy: Remembering, understanding, applying. The format should start with, “By  the end of this unit, students will be able to,” then list the objectives in bullet format. The action verb for the learning objective should not include unmeasurable words including understand, know, learn, etc.

Creating Homework Questions

In the next example, I showed how I use LLMs to create homework and test questions. This has been one of the most productive uses of generative AI in my teaching. I write new homework problems each year for my social statistics course. Using a model to draft initial questions has cut that time from 6 hours to 2 hours for each homework.

The examples below show how to use one-shot prompting (i.e., giving the LLM a past homework question). Once it gives me several options, I choose the one I like best. I may make some edits before I solve the problem to see if I think it is evaluating students at the appropriate level and on the objectives I intended.

Prompt: You are a professor teaching Introduction to Social Statistics at a college. You want to create a homework on confidence intervals. Please create 3 questions based on the following question in brackets that assess students on the same statistical concept but a different sociological context.

[The JHU police force has been debated at JHU. You conduct a random survey of Charles Village residents about whether they think JHU should have its own police force: 57% are for it and 43% are against. Construct a 99% confidence interval for the proportion of people who are for the police force if the sample size is a) 500 residents and b) 50 residents. Show your work. For each case indicate if you would be willing to suggest if the residents of Charles Village are for or against the JHU police force.]

Writing Assignment

I also demonstrated how to develop a writing assignment for my introductory sociology Man using chatbot with laptop at workcourse. The interesting part about this example was that the response did not follow the overall word limit I requested. It created a homework prompt with word limits associated with different sections that summed to more than 300 words. This is an example of hallucination.

Prompt: You are a professor teaching Introduction to Sociology at a college. You want to create a homework prompt in which students need to summarize the main points of an opinion essay from a newspaper and then apply sociological concepts to it. Students should use those concepts to provide a critique of the main argument including both strong arguments and weak arguments. Using the following essay in brackets, create a prompt for the homework that should be no more than 300 words. 

[Essay Example not provided for length and copyright reasons]

Rubric

In this example, we created a rubric for the previous writing assignment in my introductory sociology course. The two prompts show different responses when you provide more detail and communicate the format for the final rubric.

  • Prompt 1: Develop a rubric for this assignment.
  • Prompt 2: Rewrite the rubric using the same criteria, but include the following ratings with the associated points: Excellent (8-10 points), Good (5-7 points), Needs Improvement (1-4 points). Format it as a table.

Adapt the examples above for your courses. Share tips, strategies, and prompt examples from your course in the comments below!

Mike Reese
Associate Dean of the Center for Teaching Excellence and Innovation and Associate Teaching Professor in Sociology, Johns Hopkins University

Image Source:  flyalone – stock.adobe.com, gguy – stock.adobe.com, terovesalainen – stock.adobe.com

 

Lunch and Learn: Generative AI Uses in the Classroom

On Tuesday, April 23rd, the Center for Teaching Excellence and Innovation (CTEI) hosted a Lunch and Learn on Generative AI Uses in the Classroom. Faculty panelists included Louis Hyman, Dorothy Ross Professor of Political Economy in History and Professor at the SNF Agora Institute, Jeffrey Gray, Professor of Chemical and Biomolecular Engineering in the Whiting School, and Brian Klaas, Assistant Director for Technology and instructor at the Bloomberg School of Public Health. Caroline Egan, Teaching Academy Program Manager, moderated the discussion.  

Louis Hyman began the presentation by reminding the audience what large language models (LLMs) like ChatGPT can and cannot do. For example, ChatGPT does not “know” anything and is incapable of reasoning. It generates text that it predicts will best answer the prompt it was given, based on how it was trained. In addition to his course work, Hyman mentioned several tasks he uses ChatGPT to assist with, including text summarization, writing complicated Excel formulas, writing and editing drafts, making PowerPoint tables, and turning image files in the right direction.

In Hyman’s course, AI and Data Methods in History, students are introduced to a variety of tools (e.g., Google Sheets, ChatGPT, Python) that help them analyze and think critically about historical data. Hyman described how students used primers from LinkedIn Learning as well as Generative AI prompts to increase their technical skills which enabled them to take a deeper dive into data analysis. For example, while it would have been too complicated for most students to write code on their own, they learned how to prompt ChatGPT to write code for them.  By the end of the semester, students used application programming interface (API) calls to send data to Google, used OpenAI to clean up historical documents and images presented using optical character recognition (OCR), and used ChatGPT and Python to plot and map historical data.Two maps of 1850 New England showing the number of congregational churches and the value of congregational property. Data points plotted by students using AI.

Hyman noted that one of the most challenging parts of the course was convincing students that it was OK to use ChatGPT, that they were not cheating.  Another challenge was that many students lacked basic computer literacy skills, therefore, getting everyone up to speed took some time. There was also not one shared computer structure/platform. The successes of the course include students’ ability to use libraries and APIs to make arguments in their data analysis, apply statistical analysis of the data, and ask historical questions about the results they were seeing in the data.

Jeff Gray continued by describing his Computational Protein Structure Prediction and Design course that he has taught for over 18 years. In this course, students use molecular visualization and prediction tools like PyRosetta, an interactive Python-based interface that allows them to design custom molecular modeling algorithms. Recently, Gray has introduced open-sourced AI tools into the curriculum (AlphaFold and RoseTTAFold), which predict 3D models of protein structures.

Example of protein folding using AlphaFold.

One of the challenges Gray mentioned was the diversity of student academic backgrounds. There were students from engineering, biology, bioinformatics, computer science, and applied math, among others. To accommodate this challenge, Gray used specifications grading, a grading method in which students are graded pass/fail on individual assessments that align directly with learning goals. In Gray’s class, students were presented with a bundle of problem sets categorized at various difficulty levels. Students selected which ones they wanted to complete and had the option of resubmitting them a second time for full credit. Gray is undecided about using this method going forward, noting that half of the students ended up dropping the course when they tried to complete all of the problems instead of just a few, and found the workload too heavy.  Another challenge was how to balance the fundamental depth of the subject matter versus application.  To address this, Gray structured the twice weekly class with a lecture on one day and a hands-on workshop the other day, which seemed to work well.

Brian Klaas teaches a one credit pass/fail course called Using Generative AI to Improve Public Health. The goal of this course is to allow students to explore AI tools, gain a basic understanding of how they work, and then apply them to their academic work and research. In addition to using the tools, students discussed the possible harms in Generative AI, such as confabulations, biases, etc., the impact of these tools in Public Health research, and future concerns such as the impact on the environment and copyright law. Klaas shared his syllabus statement regarding the usage of AI tools in class, something he strongly recommends all faculty share with their students 

Hands-on assignments included various ways of using Generative AI. In one assignment, students were asked to write a summary of a journal article and then have GenAI write a summary of the same article geared towards different audiences (academics vs. high school students). Students were then asked to analyze the differences between the summaries.Sample instagram post created using AI showing people from different cultures dressed as medical professionals. For another assignment, students were asked to pick from a set of topics and use Generative AI to teach them about the selected topic, noting any confabulations or biases present. They then asked GenAI to create a five-question quiz on the topic and take the quiz. A final assignment was to create an Instagram post on the same topic including a single image and a few sentences explaining the topic to a lay audience. All assignments included a reflection piece which often required peer review.

Lessons learned: Students loved the interdisciplinary approach to the course, confabulations reinforce core data research skills, and learning from each other is key.

The discussion continued with questions from the audience: 

Q: What would you recommend to an instructor who is considering implementing GenAI in the classroom? How do they start thinking about GenAI?
JG: Jupyter notebooks are pretty easy to use. I think students should just give it a try.
LH: I recommend showing students what ”bad” examples look like. The truth is, we can still write better than computers. Use AI to draft papers and then use it as an editing tool – it’s very good as an editing tool. Students can learn a lot from that.
BK : I recommend having students experiment and see where the strengths lie, get an overall awareness of it. Reflect on that process, see what went well, not so well. Feed in an assignment and see what happens. Use a rubric to evaluate the assignment. Put a transcript in and ask it to create a quiz on that information. It can save you some time.

Q for Brian Klaas: What version of GPT were you using?
BK: Any of them – I didn’t prescribe specific tools or versions. We have students all over the world, so they used whatever they had. ChatGPT, Claude, MidJourney, etc. I let the students decide and allowed them to compare differences.

Q for Jeff Gray: Regrading the number of students who dropped, is the aim of the course to have as many students as possible, or a group who is wholly into it?
JG: I don’t know, I’m struggling with this. I want to invite all students but also need to be able to dig into the math and material. It feels like we just scratched the surface. Maybe offering an intersession course to learn the tools before they take this class would be helpful. There is no standard curriculum yet for AI. Where to begin…we’re all over the map as far as what should be included in the curriculum.
LH: I guess it depends on what your goals are. Students are good at “plug and chug,” but bad at asking questions like, “what does this mean?”
BK: We didn’t get to cover everything, either – there is not enough time in a one credit class. There are just so many things to cover.

Q: What advice do you have for faculty who are not computer scientists? Where should we start learning? What should we teach students?
LH: You can ask it to teach you Python, or how to do an API call. It’s amazing at this. I don’t know coding as well as others, but it helps. Just start asking it [GenAI]. Trust it for teaching something like getting Pytorch running on your PC. Encourage students to be curious and just start prompting it.
BK: If you’re not interested in Jupyter notebooks, or some of the more complicated functions, you can use these tools without dealing in data science. It can do other things. It’s about figuring out how to use it to save time, for ideation, for brainstorming.
JG: I have to push back – what if I want to know about what’s going on in Palestine and Israel? I don’t know what I don’t know. How do I know what it’s telling me is correct?
LH: I don’t use it for history – but where is the line of what it’s good and not good at?
BK: I would use it for task lists, areas to explore further, but remember that it has no concept of truth. If you are someone who knows something about the topic, it does get you over the hurdles.
JG: You have to be an expert in the area to rely on it.
LH: Students at the end of my course made so much progress in coding. It depends on what you ask it to do – protein folding is very different than history that already happened.

Q: How can we address concerns with fairness and bias with these tools in teaching?
BK: Give students foundational knowledge about how the tools work. Understand that these are prediction machines that make stuff up. There have been studies done that show how biased they are, with simple prompts. Tell students to experiment – they will learn from this. I suggest working this in as a discussion or some practice for themselves.

Q: Students have learned to ask questions better – would you rather be living now with these tools, or without them?
JG: Students are brainstorming better. They are using more data and more statistics.
BK: AI requires exploration and play to get good responses. It really takes time to learn how to prompt well. You have to keep trying. Culturally, our students are optimized for finding the “right answer;” AI programs us to think that there are multiple answers. There is no one right answer for how to get there.
LH: Using AI is just a different process to get there. It’s different than what we had to do in college. It was hard to use computers because many of us had to play with them to get things to work. Now it all works beautifully with smart phones. Students today aren’t comfortable experimenting. How do we move from memorization to asking questions? It’s very important to me that students have this experience. It’s uncomfortable to be free and questioning, and then go back to the data. How do we reconcile this?

JG: What age is appropriate to introduce AI to kids?
LH: Students don’t read and write as much as they used to. I’m not sure about the balance.
Guest: I work with middle and high school teachers. Middle school is a great time to introduce AI. Middle school kids are already good at taking information in and figuring out what it means. Teachers need time to learn the tools before introducing it to students, including how the tools can be biased, etc.

Q: How can we encourage creative uses of AI?
BK: Ethan Mollick is a good person to follow regarding creative uses of AI in education and what frameworks are out there. To encourage creativity, the more we expose AI to students, the better. They need to play and experiment. We need to teach them to push through and figure things out.
LH: AI enables all of us to do things now that weren’t possible. We need to remember it’s an augment to what we do, not a substitute for our work.

Resources:
Hyman slides
Gray slides
Klaas slides

Amy Brusini, Senior Instructional Designer
Center for Teaching Excellence and Innovation
 

Image source: Lunch and Learn logo, Hyman, Gray, and Klaas presentation slides, Unsplash