Generative AI (like ChatGPT) is a powerful tool, but if you are just using ChatGPT, you aren’t using it to its full potential. In this series of articles, we explore ways you can use these systems to give you better and more consistent output.
The companies offering these AIs have curated a voice for us to interact with. This is one that has been designed to be generally applicable for most use cases, but it might not suit our organization.
This article introduces a new and easy way to use the ChatGPT API through our OpenAI API Playground. We will explore some of the basics of using the API, and how you can use a technique known as “few-shotting” to get the API to talk in your voice. It’s as simple as providing some context and a few example responses.
API Prompting 101
The API let’s us send three different kinds of prompts:
System Prompt – This is context that tells the AI what we are doing.
User Prompt – This is what the user is asking the AI to do.
Assistant Prompt – This is how the AI responds.
Few-shotting means that we hand write some User and Assistant prompts ourselves. This shows the AI how we want it to respond.
If you have a few examples that you have already written, then this is a very effective way to use the AI to help you draft accurate and relevant responses.
For this article, we will imagine we are high school English teachers. We are going to give the students a challenging assignment and want to use the AI to help us write differentiation and scaffolding activities to help each student be more successful at it.
First, we will give a system prompt explaining the assignment and what we want the AI to do.
Students have read “A Modest Proposal” by Jonathan Swift – they were given the following question to answer:
In “A Modest Proposal”, Swift argues that the poor should sell their infants to the rich as food. He is clearly not being serious, but is instead making a comment on class inequality and the exploitation of the poor by the rich.
In today’s society, we face a number of pressing societal issues that can be ignored or disregarded. Write a satirical article like “A Modest Proposal” about a contemporary problem. Your solution should be so shocking and/or outlandish that it forces the reader to seriously reflect and evaluate the issue.
This is a challenging assignment. Therefore, your job will be to write differentiation and support activities that can help support students to complete this project.
The teacher will give you a problem that students are having, and you should offer a suggestion to help support them and build their understanding. Then you should give them a few steps to follow, so they have a starting point to make progress.
If we don’t give any examples (in AI-speak this is called zero-shotting), but just prompt the system for some support, it will give us a response like the following.
Students can’t think of an idea.
Suggestion: Provide a list of contemporary problems for students to choose from.
1. Research and compile a list of contemporary problems that students can choose from.
2. Share the list with students and explain that they can choose any problem from the list or come up with their own.
3. Encourage students to choose a problem that they feel passionate about or one that they think needs more attention.
4. Provide time for students to brainstorm and discuss their ideas with classmates and the teacher.
5. Once students have chosen a problem, guide them through the process of writing a satirical article similar to “A Modest Proposal”.
This isn’t quite right. I don’t want to know what I can do as a teacher; I want an activity for students to follow.
Ammo in the Chamber
Instead of what we have above, we are going to actually answer our question ourselves.
Students can’t think of an idea.
Assistant Response (that we wrote):
Brainstorming can help you think of ideas. A good approach is to start with a very big topic and then work your way down to a more specific idea.
For example, we can think of Social Media.
Social Media is owned by big corporations and they care more about profits than they do about people.
Lots of children use social media and they can develop bad habits.
There is an unhealthy relationship between social media companies and their users. The companies have a lot of control over what users see, and how much time they spend on the platforms.
Can you think of any other extreme situations where one person or group had a lot of power over another person or group?
Now let’s try it ourselves. Start with a big topic like:
Gender or racial inequality.
The brain drain.
Then, get more specific. Eventually, you will find a specific problem you can address in your writing.
Students have a good idea, but they are unsure of how to make it satirical.
AI Response (from ChatGPT):
Satire is a form of humor that uses irony, sarcasm, and exaggeration to criticize or mock a particular issue or problem. In order to make your idea satirical, you need to take an extreme position that is clearly absurd or outrageous. Here are some steps that can help you make your idea satirical:
1. Identify the problem: Clearly state the problem you want to address in your writing.
2. Take an extreme position: Take an extreme position on the problem that is clearly absurd or outrageous. For example, if your problem is gender inequality, you might suggest that men should be banned from driving because they are too aggressive on the road.
3. Use irony and sarcasm: Use irony and sarcasm to make your point. For example, you might say that men should be banned from driving because they are too aggressive on the road, but then suggest that they could still ride bicycles or tricycles.
4. Exaggerate: Exaggerate the problem to make it more absurd. For example, you might suggest that men should be banned from driving because they are too aggressive on the road, but then suggest that they should also be banned from using power tools because they are too dangerous.
5. Use humor: Use humor to make your point. For example, you might suggest that men should be banned from driving because they are too aggressive on the road, but then suggest that they could still drive bumper cars at the amusement park.
Remember that satire is meant to be humorous, but it is also meant to make a serious point. So make sure that your writing is both funny and thought-provoking.
Better Examples Better Answers
By just providing a single example, we are already getting better responses. If you add more examples, your answers will get better and better.
Few-Shotting is a great technique if you know exactly the kind of response you are trying to get out of the system and have a few examples ready to go.
These AI systems are very good at predicting what comes next. And so the more examples you offer, the better the predictions.