Skip to Main Content
Libraries
askus Ask us
 

Prompt Design For Beginners

Make the robot work for you.

Key Points Of The Module: Specify An Output Format

  • This module shows you how to instruct ChatGPT-3.5 to precisely format its response (or output) based on your prompt.

    • Outputs need to be text-based but there are a variety of formatting styles available. 

    • Use Markdown syntax in your prompts to specify formatting elements to ensure consistent formatting in ChatGPT's responses.

Step 1: There Are Numerous Output Formats Available

Word cloud showing the numerous output formats of ChatGPT.

Image Caption: A classic word cloud showing examples of over twenty-five text-based output formats available from ChatGPT.

  • I brought back the classic word cloud to illustrate that there are numerous output or response formats available from ChatGPT.
    • The outputs need to be text -based, not in audio or image-based formats. However, they can be presented in a variety of forms, such as a list of steps, code snippets, numbered and bulleted lists, tables, dialogues, poems, and more. There is ample space for expressing your creativity!

Step 2: Output As A Table

In the first example, I ask ChatGPT to format its response to my question as an easy to read table. 

  • "Easy to read" means that ChatGPT selects headings, spacing, and organizational elements that are visually appealing. It's a useful pro tip!

Prompt In ChatGPT-3.5: 

Laura:

List the top four science fiction television shows based on books.
For the TV shows, include the title and run dates.
For the books, include the title, author, and publication date.
Format the output as an easy to read table.

ChatGPT:

The top four science fiction television shows based on books displayed in a table format by ChatGPT.

Image Caption: The top four science fiction television shows based on books is displayed by ChatGPT in a table format that contains six columns. The four television shows listed are The Expanse, The Handmaid's Tale, Altered Carbon, and Westworld.

Step 3: Selecting Specific Formatting Styles for the Response

In the first example, I allowed ChatGPT to select the formatting style for the table. For this second example, I specify how I want each element to be styled in ChatGPT's response. As you incorporate a larger number of specific formatting elements into your prompt, ChatGPT will increasingly struggle to provide accurate responses. You might have to balance what you want stylistically with ChatGPT's current limitations. 

Explanation of the Example

  1. Use Markdown Syntax
    To ensure consistent formatting in ChatGPT's responses, you need to understand a tiny bit of Markdown syntax. Markdown is a simple coding language where you use plain text to indicate formatting elements. While ChatGPT may interpret styles based on words like "bold" or "italics" , the model will more likely apply random formatting. This can be a source of frustration for new users!
  • Here's an explanation of the Markdown syntax used in my upcoming prompt. Colour is added to make the symbols easier to see.
    • Bold: **your words** - enclose the words you want bolded in a double asterisk
      In the output for the model's response, the labels are bolded. For example, Run Dates, Author, Book Title, and Publication Date.
       
    • Italics: *your words*  - enclose the words you want italicized in a single asterisk
      In the model's response, the book titles are italicized. For example, Leviathan Wakes.
       
    • An ordered list is a numbered list. Use numbers followed by periods in front of the list items. 
      For example: 
    1. List item.
    2. List item.
    3. List item.
       
    • An unordered list is a bulleted list. Add dashes (-) in front of the list items.
      For example:
      - List item.
      - List item.
      - List item. 
  1. UPPERCASE LETTERS and lowercase letters
    Markdown doesn't have a special syntax for all uppercase or all lowercase letters. That's why I wrote TV SHOW TITLE in all uppercase. 
    In the model's response, the TV show titles are capitalized. For example, THE EXPANSE.
     
  2. Draw Attention to a Potentially Problematic Formatting Element
    I included a Note: to draw ChatGPT's attention that I want the TV show titles to be in uppercase letters. If I think ChatGPT will overlook a formatting element then I add a specific note to avoid the issue. 
     
  3. Compare the Television Shows Listed Between Step 2 and Step 3
    In the first example, ChatGPT selected Westworld instead of The Man In The High Castle (in example 2). Indeed, ChatGPT is notorious for providing inconsistent results. 

Prompt In ChatGPT-3.5: 

Laura:

List the top four science fiction television shows based on books.

Use the following output format:

**1.** **TV SHOW TITLE** (**Note:** the uppercase!)
- **Run Dates:** Run dates of the TV show
- **Author:** Author of the book
- **Book Title:** *Title of the book*
- **Publication Date:** Publication year of the book

ChatGPT:

Certainly, Laura. Here's the information formatted according to your specifications:

1. THE EXPANSE

  • Run Dates: 2015 - 2022
  • Author: James S.A. Corey (Daniel Abraham and Ty Franck)
  • Book Title: Leviathan Wakes
  • Publication Date: 2011

2. THE HANDMAID'S TALE

  • Run Dates: 2017 - Present
  • Author: Margaret Atwood
  • Book Title: The Handmaid's Tale
  • Publication Date: 1985

3. ALTERED CARBON

  • Run Dates: 2018 - 2020
  • Author: Richard K. Morgan
  • Book Title: Altered Carbon
  • Publication Date: 2002

4. THE MAN IN THE HIGH CASTLE

  • Run Dates: 2015 - 2019
  • Author: Philip K. Dick
  • Book Title: The Man in the High Castle
  • Publication Date: 1962

ACTIVITY: Your Turn!

Creative Commons License
This work by The University of Victoria Libraries is licensed under a Creative Commons Attribution 4.0 International License unless otherwise indicated when material has been used from other sources.