Find helpful tutorials or share inspiring use cases on AI technology for higher education.

Shared content may not reflect the policies of Tilburg University on the use of AI. 

Become a Prompt Engineer: How to Talk to ChatGPT

Your toolkit for Prompt Engineering is getting quite extensive, as this is already the ninth part of the series. We’ve covered many aspects related to interacting with a Large Language Model. In various ways, we’ve shown how to communicate. Today, we’re going back to the basics. We’ll focus on the basics and provide practical word choices for the main question: How to Talk to ChatGPT?

Avoiding the Easy Pattern Trap

Large Language Models, like ChatGPT, tend to follow a pattern, the so-called easy pattern. This means that if you give a single prompt (Zero-shot prompting), the model will come up with a “vanilla” answer. Here, vanilla means an unstructured and detail-lacking piece of text. In short, a zero-shot prompt will yield a superficial answer and can be regarded as a black box type of answer as you do not know which route it will take. This is something we have learned to circumvent with various techniques in the series.

Example Case: Write an introduction to Credit Default Swaps.

ChatGPT has no idea how to structure and which language to use for the answer to this question. And from the other side, you have no idea how it will respond. ChatGPT doesn’t know who it’s dealing with. This could be a 6-year-old child, a PhD student in Finance, or a 93-year-old. Additionally, it mentions various terms, which it explains superficially. Not exactly useful output. As we discussed earlier, you can get quite far by using placeholders and/or shot prompting.

Reminder: Shot Prompting means giving the Large Language Model a pre-chewed explanation of what you need, by providing an example of a question-answer pair. When you ask the next question, the AI will use that answer template.

Conveniently, ChatGPT is steered in a certain direction with how it answers, and thus it can give a more targeted response. It also learns from the submitted example, on what level its output should be based. As you can see in this example of the same prompt using shot-prompting and placeholders, ChatGPT still tends to ramble a bit. But still, we steer ChatGPT in a certain direction in the conversation. 

Think about the practical applications. By setting up a framework for working out definitions, example cases, etc. for a course, like Finance, and working out an example completely as you want a response, you can have ChatGPT work out the second, third, and fourth… definitions in the style you want. Shot Prompting can thus function as a method for automating your summary.

Engage in conversation with…

Another method we lightly touched on in the very first article of the series is role prompting. This means that you provide the AI with a role that matches the form of the answer you want to receive. Role prompting changes the style of the text that ChatGPT gives. By specifying to the AI which role it should take on, this can be a specific person, job, or certain characteristics of a person responding, you are modifying how it writes the output based on the assigned role. This can be used to change the tone, style, and depth of the information presented.

Example case: Example Creator for Study Concepts

In this example, we do not specify a person, but what kind of action (role) ChatGPT should complete. This is a prompt for both teachers and students, which can provide creative insights through a practical learning method. As seen in the prompt output, the AI follows neatly the prompt.

Do not forget that you can iterate on prompts. Zoom in on the specific examples to work them out further and let them be explained in more depth. Then the real value comes in. As mentioned earlier in the article, the first answer is usually still somewhat “vanilla.”

Save a Prompt Template: Act as an example generator for students. When confronted with new and complex concepts, adding many and varied examples helps students better understand those concepts. Please ask what concept I would like examples of, and what level of students I am teaching. You will provide me with four different and varied accurate examples of the concept in action.

Academics are… Critical

What describes a good academic: A Critical Thinker. So, why not let ChatGPT be a critical thinker as well? Although this is very similar to the previous section, we want to zoom in here on the iterating part of the prompt. Namely, let ChatGPT do the work as an Critical Academic.

Two-step Procedure

First, ask ChatGPT to criticize your work and then ask ChatGPT to rewrite it using its own suggestions.

  • Initial Prompt: Criticize the following text and convince me why it’s not good. Let’s think about the problems with the text step by step.
  • Iterating Prompt: Great points. Rewrite the text and improve it based on your criticism.

A critical mind would say that this prompt could be improved to be more specific and yes this should. However, this will fulfill the illustration’s purposes. So, that part of prompt engineering we will slide over to you.

For our example case, we go a bit rogue and let ChatGPT help with an assignment. First, we let ChatGPT criticize our assignment answers and then use its own criticism to rewrite our text.

Be critical of ChatGPT response: as it can hallucinate, it can be wrong, and you are responsible for your own assignment.

Practical Word Choice Tips

In “conversation” with ChatGPT, you need to pay attention to how you refer to things, label things, and give instructions. Therefore, always keep the following principle in mind when writing a prompt:

If you printed out your input, and handed it to Data from Star Trek, what would he do?”

This principle aids as a mentality. Data, being an android with a precise and logical understanding, would interpret your instructions literally. Similarly, ChatGPT processes inputs based on its content. 

Tip 1:  Contain the main focus of your task within the verb itself. 

Instead of ‘Rewrite this to be shorter‘ it’s more effective and consistent to say ‘Condense this.'”The verb “condense” explicitly instructs ChatGPT to shorten the text.

Clear verbs reduce ambiguity by encapsulating the task within the action word itself. This helps in minimizing the cognitive load on the AI, allowing it to perform the task more effectively. It also helps to keep consistency in responses, as the AI follows a more defined instruction.

Tip 2: Avoid negative commands

Instead of saying, “Don’t be overly formal“, say “Keep it casual“.

Negative commands can be problematic because they often introduce ambiguity and unintended interpretations. ChatGPT, like people, can sometimes fixate on the very thing you’re trying to avoid by using a negative command. 

The analogy of thinking about pink elephants when instructed not to highlight this issue. When you tell someone not to think of something, the image or idea often becomes more prominent in their mind. Similarly, when giving instructions to ChatGPT, positive commands help focus the AI on what you want it to do rather than what you want it to avoid.

Conclusion

To wrap up this part in the series on prompt engineering, we’ve journeyed through various methods to “Talk” with Large Language Models like ChatGPT. Revisiting core concepts and refining our approach, we focused on practical applications. 

We learned to avoid this easy pattern trap by using shot prompting, creating more structured and targeted completions. Role prompting and iterative refinement further, tailor the output to your specific needs. At last, word choice when prompting is important. Clear, positive commands with precise verbs reduce ambiguity and improve AI responses. By applying these principles, you can make your conversations with ChatGPT more beneficial.

Happy Prompting!