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: Prompt Template

Welcome back to our Prompt Engineering series! In our previous article, we went through the 4 Key Principles of Prompt Engineering. And you learned how to instruct ChatGPT and created some prompts yourself! Now, we understand, if you’re thinking how am I ever supposed to know exactly what to prompt inside ChatGPT. Well in this article, we’re going to help you with that. Here we’re laying the foundation of every good prompt, by following a template. Reusable and powerful, so let’s take a look at the ingredients that make up a high-quality prompt.

Interacting with ChatGPT demands precision and intentionality. While the model has an impressive breadth of knowledge, its response depends on how you communicate your needs. Imagine trying to assemble furniture without clear directions, the end result might not match your expectations. Similarly, vague or ambiguous instructions can lead to responses that miss the mark.

The prompt template

There are six important parts that need to be included in a good prompt, which can be divided into ‘Mandatory‘, ‘Important‘ and ‘Optional‘. We will go through them one by one:

  1. Task (Mandatory)
    • Definition: The task describes the primary purpose of the prompt. It specifies the action you want ChatGPT to perform.
    • Guidelines:
      • Use a clear action verb (principle 1 of the previous article)
      • Be specific about what you need.
    • Examples:
      • “Explain the concept of machine learning.”
      • “Generate a summary of the following text.”
  2. Context (Important)
    • Definition: Context provides background information and situational details that help ChatGPT make the answer appropriate and relevant.
    • Guidelines:
      • Add relevant details about the situation, audience or other important information.
      • Helps create a more accurate and relevant answer.
    • Examples:
      • “Explain…. To a first-year Bachelor’s student in Mathematics.”
      • “In the context of European Union regulations…”
      • Taking into account the latest developments in renewable energy…”
  3. Persona (Optional)
    • Definition: Assigning ChatGPT a specific role or persona allows you to control the style and depth of the answer, as if it were coming from an expert in a particular field.
    • Guidelines:
      • Clearly specify the profession or role
      • Specify persona characteristics
      • Helps to obtain answers with the right expertise and tone.
    • Examples:
      • “Act as a professional software developer.
      • “You are an experienced financial analyst.
      • “Imagine that you are a renowned historian.”
  4. Format (Optional):
    • Definition: The format determines the structure and presentation of the answer.
    • Guidelines:
      • Specify the desired layout, length or style.
      • May include requests for lists, bullet points, essays, etc.
    • Examples:
      • “List the most important features.”
      • “Write a 300-word essay on climate change.”
      • “Provide step-by-step instructions for assembling a desk.”
  5. Tone (Optional):
    • Definition: Tone refers to the style or emotional quality of the response.
    • Guidelines:
      • Choose a tone that is appropriate for the intended audience or purpose.
      • Common tones include professional, informal, friendly, persuasive, etc.
    • Examples:
      • “Use a professional and formal tone.”
      • “Write in a conversational and friendly manner.”
      • “Adopt an inspiring tone to motivate the audience.”
  6. Example (Optional)
    • Definition: Giving examples of desired (or undesired) outcomes can help ChatGPT better understand what you expect.
    • Guidelines:
      • Include examples that clearly illustrate what you want.
      • Helps you tailor the answer to your specific needs.

We can collect all these good practices and put it all in one prompt. The standard prompt will then look like:

You are a [expert person]. [context]. [task (action verbs)]. Please use a [tone] writing style. The output should be [format]. It should look like the following example: [example].

An example would be:

You are a positive, motivating tutor. The student is preparing for their final exams in mathematics. Explain the key concepts of algebra. Please use an encouraging and clear writing style. The output should be a structured lesson plan. It should look like the following example: [give an example].

Other useful tips

  • Give as much information as possible
    This feels like stating the obvious, especially considering what already has been told, but it still remains the most vital part of writing good prompts. ChatGPT is unaware of your specific needs or queries, so it’s important to clearly convey your intentions or questions. This can only be done by giving ChatGPT as much information as you have when asking a question on something.
  • Follow-up corrections/prompt chaining
    ChatGPT will remember the environment it is in, namely the current chat you have with ChatGPT. When you have written your first prompt and generated your first answer, you can easily adjust the way in which the conversation is going by leveraging the context of the previous questions and answers. You can adjust and refine your questions based on the AI’s previous responses. If the AI misunderstands you, you can simply point out the error and proceed. This is something called prompt chaining, as you chain the prompts in a conversation.
  • Start a new chat when necessary
    As stated in the previous point, ChatGPT will always keep track of it’s environment, the environment being the current chat it is in. Even though you can thus use this to your advantage, sometimes the chat is steering in an undesirable direction and you may want ChatGPT to forget about the past information all together. It can then be a good practice to start a new chat, resulting in ChatGPT forgetting any context of your current chat.

Example

You are a Marketing Professor. A 3rd-year bachelor student in marketing is preparing a marketing strategy for the launch of a new eco-friendly beverage. Develop a detailed marketing plan that includes market research, target audience analysis, positioning, promotional tactics, and implementation steps. Please use a professional and analytical writing style. The output should be a structured report with sections for each component of the marketing plan. It should look like the following example:

**Example:**

**Executive Summary**

This section provides an overview of the marketing plan, highlighting key strategies and objectives for the eco-friendly beverage launch.

**Market Research**

An in-depth analysis of the current beverage market trends, consumer preferences for eco-friendly products, and competitor strategies.

**Target Audience**

Identification and analysis of the primary and secondary target audiences, including demographics, psychographics, and purchasing behaviors.

**Positioning Strategy**

Detailed strategy on how the eco-friendly beverage will be positioned in the market to differentiate it from competitors.

**Promotional Tactics**

Comprehensive plan outlining advertising channels, social media campaigns, influencer partnerships, and promotional events to create brand awareness.

**Implementation Plan**

Step-by-step timeline and action plan for executing the marketing strategies, including budget allocation and performance metrics.

Conclusion

You are now equipped with the ingredients for a good prompt. We began by emphasizing the necessity of clear and specific instructions through the Task component, making sure that the primary purpose of the prompt is unmistakably conveyed. The context provides the situational backdrop, making responses more relevant to your specific needs. Going from general to personal. Introducing a Persona makes you use the model’s versatility, let the task in the given person context, be done by the person you want to. So think about who should let you do the job. Further, the Format and Tone components offer control over the structural aspects of the output, enabling the creation of organized and appropriately styled content.

By dissecting the prompt template into its six components, Task, Context, Persona, Format, Tone, and Example, you can now go to work to get the desired answers from an AI model. Are you there now? No, we have much more in store, we have just started!


Exercise set

Exercise 1: Identifying Prompt Components

Objective:
Identify the six key components of the prompt template within given prompts.

Instructions:
For the prompt below, label each sentence or phrase according to the six components: TaskContextPersonaFormatTone, and Example.

“You are an experienced academic advisor. A first-year student is struggling to choose a major that aligns with their interests in both technology and the arts. Develop a counseling session outline to help them make an informed decision. Use a compassionate and understanding tone. The output should be an organized outline with key discussion points.”
  • Persona: “You are an experienced academic advisor.”
  • Context: “A first-year student is struggling to choose a major that aligns with their interests in both technology and the arts.”
  • Task: “Develop a counseling session outline to help them make an informed decision.”
  • Tone: “Use a compassionate and understanding tone.”
  • Format: “The output should be an organized outline with key discussion points.”
  • Example: Not provided.
Exercise 2: Scenario Analysis

Instructions: Read the scenario and the associated prompt. Assess whether the prompt incorporates the necessary ingredients. If not, identify the missing elements and propose improvements.

Scenario: A graduate student is writing a thesis on renewable energy sources and needs a literature review.

Prompt: “Create a literature review on renewable energy sources.”

Example Answer

You are a senior research assistant in the Renewable Energy Department. A graduate student is writing a thesis on renewable energy sources and needs a comprehensive literature review focusing on the latest advancements in solar and wind energy technologies over the past five years. Write this Literature Review. Please use a formal and analytical tone. The output should be a structured literature review of approximately 3000 words, organized into sections with proper APA citations. Include an introduction, thematic subsections for each technology, and a conclusion summarizing key findings.

Exercise 3: Build your Own Prompt

Instructions: Think about a specific task or activity you need to accomplish within your university studies or extracurricular involvement. This could be anything from preparing a presentation, writing a research paper, organizing an event, or any other academic or administrative task. Once you have identified the task, construct a prompt for ChatGPT that includes the necessary components: TaskContextPersona (optional), Format (optional), Tone (optional), and Example(optional). And of course test it!