Image Caption: A cycle diagram depicting an overview of the approach used to build an effective prompt to format a list of song titles from a block of text.
Note:
The block of text used in this example is quoted below.
A tiny sample of popular songs with numbers in their title are “Eight Days a Week” and “When I’m Sixty Four” by the Beatles, “Edge of Seventeen” by Stevie Nicks, “Fifteen” and “22” by Taylor Swift, “99 Luftballons” by Nena, “10,000 Hours” by Dan + Shay and Justin Bieber, “99 Problems” by JAY-Z, “2 Become 1” by the Spice Girls, “Whalien 52” by BTS, “7/11″” by Beyonce, “Five Years” by David Bowie, “Three Times a Lady” by the Commodores and “7” by Prince.
Reference
Bonato, A. (2021, December 1). Adele’s ‘30’: A mathematician explores number patterns in album titles. The Conversation.
https://theconversation.com/adeles-30-a-mathematician-explores-number-patterns-in-album-titles-172677
In this step, I am asking ChatGPT to take a block of text and generate a list of artists and song titles in a specific format.
Note that I provide the block of text and then ask the model to wait.
Giving the model time to process a chunk of text helps prevent it from making reasoning errors.
I apply the few-shot prompting strategy by providing the model with two or more examples to shape how model will format the list of artists and song titles.
My prompt includes four concise examples. It's important to note that these examples don't necessarily have to originate from the block of text.
The prompts make use of delimiters such as Text: and ##.
Recall that delimiters are user selected symbols or words that help the model to understand the different sections of a prompt.
For example, the use of Text: separates the text block from the instructional sentence of the prompt.
Prompt In ChatGPT-3.5:
Laura:
Here is a block of Text. Please wait for instructions.
Text:
A tiny sample of popular songs with numbers in their title are “Eight Days a Week” and “When I’m Sixty Four” by the Beatles, “Edge of Seventeen” by Stevie Nicks, “Fifteen” and “22” by Taylor Swift, “99 Luftballons” by Nena, “10,000 Hours” by Dan + Shay and Justin Bieber, “99 Problems” by JAY-Z, “2 Become 1” by the Spice Girls, “Whalien 52” by BTS, “7/11″” by Beyonce, “Five Years” by David Bowie, “Three Times a Lady” by the Commodores and “7” by Prince.
ChatGPT:
Laura, I've read the text. Please provide me with the instructions whenever you're ready.
Laura:
For the block of Text, I want you to output a list of artists and song titles in the following format:
[Artist Name] => "Song Title"
Here are four examples:
[Jimmy Buffett] => "A Pirate Looks at Forty”
##
[Metallica] => “One”
##
[Ariana Grande] => “7 Rings”
##
[Matchbox Twenty] => “3 AM”
ChatGPT:
Certainly, Laura. Here's the list based on the format you provided:
[The Beatles] => "Eight Days a Week"
[The Beatles] => "When I'm Sixty Four"
[Stevie Nicks] => "Edge of Seventeen"
[Taylor Swift] => "Fifteen"
[Taylor Swift] => "22"
[Nena] => "99 Luftballons"
[Dan + Shay and Justin Bieber] => "10,000 Hours"
[JAY-Z] => "99 Problems"
[Spice Girls] => "2 Become 1"
[BTS] => "Whalien 52"
[Beyonce] => "7/11"
[David Bowie] => "Five Years"
[The Commodores] => "Three Times a Lady"
[Prince] => "7"
Next, I want to format the song titles into a consistent style by converting all of the numbers written as words into their numeric format.
For example:
However, converting Eight to 8 is a surprisingly complex task for ChatGPT to consistently grasp.
In this step, I am going to:
Why Did I Use Two Detailed Examples to Guide the Model Instead Of Twenty?
Prompt In ChatGPT-3.5:
Laura:
Instructions:
These Song Title names have numbers written as words. I would like the numbers in the Song Title names to be in their numeric format.
Here are two examples:
Input: [Jimmy Buffett] => "A Pirate Looks at Forty”
Think: Forty to 40
Output: [Jimmy Buffett] => "A Pirate Looks at 40”
##
Input: [Bob Marley] => “Three Little Birds”
Think: Three to 3
Output: [Bob Marley] => “3 Little Birds”
Your Task:
Apply the two examples in the following format:
Input: [David Bowie] => "Five Years"
Think:
Output:
ChatGPT:
Certainly!
Input: [David Bowie] => "Five Years"
Think: Five to 5
Output: [David Bowie] => "5 Years"
I hope this meets your expectations. If you have any more requests or questions, feel free to let me know!
References
Aryani, A. (2023, December 9). What is your context window? Medium.
https://medium.com/@amiraryani/what-is-your-context-window-772b1c65b881
Bhavsar, K. (2023, November 18). Prompt engineering for arithmetic reasoning problems. Towards Data Science.
https://medium.com/towards-data-science/prompt-engineering-for-arithmetic-reasoning-problems-28c8bcd5bf0e
In my original prompt design plan (fantasy?), I wanted ChatGPT to take a single prompt and correctly (and consistently!) convert all 14 song titles. I quickly learned that ChatGPT isn't capable of this type of execution yet (this module was written in December 2023). I realized that I had to guide the model through the thought process of converting numbers into their numeric formats and also needed to break down the entire procedure into individual prompts for each song title. This would allow me to closely monitor the model and correct any formatting errors as they occurred.
Thus, this step is designed to provide an interactive and controlled approach to the song title conversion process.
Let's break down the two prompts:
In Prompt 1:
In Prompt 2:
Input: [The Beatles] => "Eight Days a Week"
Think: Eight to 8
Output: [The Beatles] => "8 Days a Week"
Is this conversion correct? Y or N?
I respond with Yes (correct conversion) or No (incorrect conversion). This allows me to correct any formatting mistakes or oversights as they occur on a title-by-title basis.
Note: I only show the process below for the first four song titles, as well as the last one, because it is so repetitive.
Prompt In ChatGPT-3.5:
Prompt 1
Laura:
Instructions:
Here is The List of artists and song titles. Please wait for further instructions.
The format is [Artist Name] => "Song Title"
The List:
[The Beatles] => "Eight Days a Week"
[The Beatles] => "When I'm Sixty Four"
[Stevie Nicks] => "Edge of Seventeen"
[Taylor Swift] => "Fifteen"
[Taylor Swift] => "22"
[Nena] => "99 Luftballons"
[Dan + Shay and Justin Bieber] => "10,000 Hours"
[JAY-Z] => "99 Problems"
[Spice Girls] => "2 Become 1"
[BTS] => "Whalien 52"
[Beyonce] => "7/11"
[David Bowie] => "Five Years"
[The Commodores] => "Three Times a Lady"
[Prince] => "7"
ChatGPT:
Thank you for providing the list. I'm here and ready for further instructions whenever you're ready to proceed.
Prompt 2
Laura:
Instructions:
The Song Title names have numbers written in words. I would like the numbers in the Song Title names to be written in their numeric format.
The Thought Process for converting numbers written as words into their numeric format.
Thought Process:
Input: [Jimmy Buffett] => "A Pirate Looks at Forty”
Think: Forty to 40
Output: [Jimmy Buffett] => "A Pirate Looks at 40”
Apply the Thought Process to The List.
Start with the first item in The List.
Your Response will be formatted as:
Input:
Think: (**Note:** Specify "no conversion needed" only if the number is already in numeric format.)
Output:
Confirm with me if the conversion is correct before you proceed to the next item in The List.
Ask Y or N?
My Response will be formatted as:
Y: Correct conversion
N: Incorrect conversion
ChatGPT:
Input: [The Beatles] => "Eight Days a Week"
Think: Eight to 8
Output: [The Beatles] => "8 Days a Week"
Is this conversion correct? Y or N?
Laura:
Y
ChatGPT:
Great! Moving on to the next one:
Input: [The Beatles] => "When I'm Sixty Four"
Think: Sixty Four to 64
Output: [The Beatles] => "When I'm 64"
Is this conversion correct? Y or N?
Laura:
Y
ChatGPT:
Excellent! Let's proceed:
Input: [Stevie Nicks] => "Edge of Seventeen"
Think: Seventeen to 17
Output: [Stevie Nicks] => "Edge of 17"
Is this conversion correct? (Y/N)
Laura:
Y
ChatGPT:
Great! Let's continue:
Input: [Taylor Swift] => "22"
Think: no conversion needed
Output: [Taylor Swift] => "22"
Is this conversion correct? Y or N?
Laura:
Y
[Process continues for the remaining song titles in the list. I'm not going to show the entire process since it's so repetitive.]
ChatGPT:
Perfect! Let's proceed.
Input: [Prince] => "7"
Think: no conversion needed
Output: [Prince] => "7"
Is this conversion correct? Y or N?
Laura:
Y
Prompt In ChatGPT-3.5:
Laura:
Compile all of your Outputs into a numbered list.
Verify that you have 14 items.
ChatGPT:
Certainly! Here is the compiled list of outputs:
There are 14 items in the list. If you have any further instructions or questions, feel free to let me know!
For the following block of text:
Text:
Embark on a diverse musical journey with bands featuring numbers in their names. The legendary Jackson 5 introduced the world to soulful harmonies with "ABC." 30 Seconds To Mars, led by Jared Leto, offers anthemic rock vibes in hits like "City of Angels." Blink 182's punk-rock spirit shines in classics like "All The Small Things." 3 Doors Down captivates with the post-grunge anthem "Kryptonite." One Republic's pop-rock brilliance is evident in the chart-topper "Counting Stars." Matchbox Twenty's alternative rock sound resonates in "Real World." Three Days Grace brings intense energy with "The Good Life." One Direction's global charm is epitomized in the pop gem "What Makes You Beautiful." 5 Seconds Of Summer delivers infectious pop-punk energy with hits like "Teeth." These bands with numeric elements in their names have left an indelible mark on the music scene, each bringing a unique flavor to the industry.
Laura's Solution: You can read my prompt interaction with ChatGPT for the activity by clicking here.