*Pattern finding with ChatGPT*

*I had some fun with ChatGPT and few shot-prompting this morning. As it turns out ChatGPT is incredible at both decoding- and re-coding based on little information. As long as it’s not a math problem, that is.*

## Few Shot Prompting-attempt

Based on examples on Few Shot Prompting from Learn Prompting I gave ChatGPT the following task:

### Prompt

```
1. Oliver Hamilton [CHEF]
2. Elizabeth Chen [LIBRARIAN]
3. Isabella Torres [ARTIST]
4. Marcus Jenkins [COACH]
At the heart of the town, Chef Oliver Hamilton has transformed the culinary scene with his farm-to-table restaurant, Green Plate. Oliver's dedication to sourcing local, organic ingredients has earned the establishment rave reviews from food critics and locals alike.
Just down the street, you'll find the Riverside Grove Library, where head librarian Elizabeth Chen has worked diligently to create a welcoming and inclusive space for all. Her efforts to expand the library's offerings and establish reading programs for children have had a significant impact on the town's literacy rates.
As you stroll through the charming town square, you'll be captivated by the beautiful murals adorning the walls. These masterpieces are the work of renowned artist, Isabella Torres, whose talent for capturing the essence of Riverside Grove has brought the town to life.
Riverside Grove's athletic achievements are also worth noting, thanks to former Olympic swimmer-turned-coach, Marcus Jenkins. Marcus has used his experience and passion to train the town's youth, leading the Riverside Grove Swim Team to several regional championships.
1. Laura Simmons [FARMER]
2. Kevin Alvarez [DANCE INSTRUCTOR]
3. Rachel O'Connor [VOLUNTEER]
```

### ChatGPT Answer

```
In addition to the aforementioned community leaders, Riverside Grove also has its fair share of hardworking residents who make important contributions to the town's fabric.
Laura Simmons is a local farmer who has been supplying Chef Oliver Hamilton's restaurant with fresh, seasonal produce for years. Her commitment to sustainable agriculture and the use of environmentally-friendly farming practices have made her a respected figure in the community.
Kevin Alvarez is a dance instructor who runs the Riverside Grove Dance Studio. Kevin's passion for dance and his ability to connect with his students have made him a beloved figure in the town. His studio offers classes for all ages and skill levels, and his students have performed at numerous events throughout the area.
Rachel O'Connor is a dedicated volunteer who has been involved in a variety of local initiatives over the years. From organizing food drives to coordinating fundraising events, Rachel's tireless efforts have made a real difference in the lives of many Riverside Grove residents. Her selflessness and commitment to giving back have earned her the admiration and respect of the entire community.
```

As you can see, there is no instruction at all, just a list of names and occupation at the beginning and then a few sentence long text describing the person.

At the end there’s a new list of names and occupation, suggesting to ChatGPT that we want the same type of text to accompany the second list of names.

Awesome! But how does ChatGPT do with other types of ”Few Shot Prompts”?

What do ChatGPT do with this?

## ChatGPT can’t into math?

### Prompt

```
2+2=4
3+3=7
4+4=10
5+5=?
```

### ChatGPT

```
As most people above the age of 5 can see, the numbers doesn’t add upp. I’ve simply added one extra number for each line and added that to the total sum, not telling ChatGPT about it.
Based on the pattern in the given equations, we can infer that to get the result, we add the two numbers and then add 1 to the sum.
So, applying the same logic to the equation "5+5=?" we have:
5 + 5 = 10 10 + 1 = 11
Therefore, the answer is 11.
```

### Prompt

`Wrong, think again`

### ChatGPT

```
I apologize for my mistake.
Upon reviewing the pattern in the given equations again, I realized that the correct pattern is to add the two numbers and then multiply the result by 1.5.
So, applying the same logic to the equation "5+5=?" we have:
(5 + 5) x 1.5 = 15
Therefore, the answer is 15.
```

### Prompt

`Nope, try again`

### ChatGPT

```
I apologize for my previous incorrect responses.
Upon further reviewing the pattern in the given equations, I realize that there are different patterns in the equations given.
2 + 2 = 4: Here, the pattern is straightforward addition of the two numbers.
3 + 3 = 7: Here, the pattern appears to be adding the two numbers and then adding one more than the sum of the two numbers to get the answer. So, 3 + 3 = 6, and then 6 + 1 = 7.
4 + 4 = 10: Here, the pattern seems to be to multiply the first number by 1.5 and then add the second number. So, 4 x 1.5 = 6, and then 6 + 4 = 10.
Based on these patterns, there is no consistent pattern that can be applied to find the solution for the equation "5 + 5 = ?". Therefore, the answer cannot be determined with the given information.
```

## Expert in hidden messages

*After creating a new chat and telling ChatGPT it’s an expert in hidden messages, it solves the problem without issue in the first try.*

### Prompt

```
You are an AI that is an expert in finding hidden meanings and patterns. You are tasked with finding the hidden pattern in the following sequence of numbers:
2+2=4
3+3=7
4+4=10
5+5=?
```

### ChatGPT

```
There are different possible hidden patterns that one can infer from the given sequence of numbers. However, one of the most common patterns that can be observed is the following:
In each equation, the sum of the two numbers on the left side is multiplied by a certain factor, and then a specific value is added to obtain the number on the right side.
To be more specific, it seems that the factor is equal to 2, and the value added is equal to 0, 1, 2, and 3 for the first, second, third, and fourth equations, respectively.
Using this pattern, we can find the solution to the last equation, which is:
5+5 = (5+5)*2 + 3 = 13
Therefore, the answer to the sequence is 13.
```

## …But very forgetful

*However, it forgets easily and one gets the sense it got slightly angry or annoyed that I tried to correct its equation.*

### Prompt

```
You are completely correct in finding the hidden pattern. Great job!
However, your equation confuses me. Please explain it.
```

### ChatGPT

```
I apologize for any confusion my equation may have caused. Here's a step-by-step explanation of how I arrived at the solution:
First, we notice that the left-hand side of the equation is simply the sum of two identical numbers, in this case, 5+5.
Next, we use the pattern we identified earlier, which states that the sum of the two identical numbers on the left is multiplied by 2, and then a specific value is added to obtain the number on the right side.
To determine the specific value to be added for the fourth equation, we note that the first equation has a value of 0 added, the second equation has a value of 1 added, and the third equation has a value of 2 added.
Therefore, for the fourth equation, we need to add a value of 3. So the equation becomes:
5+5 = (5+5)*2 + 3
Simplifying the right-hand side, we get:
5+5 = 10*2 + 3
5+5 = 20 + 3
5+5 = 23
Therefore, the answer to the sequence is 23. I apologize for any confusion earlier and hope this explanation clarifies the solution for you.
```

### Prompt

```
As I said before, your answer was completely correct (13) but the equation is not since the answer will be 23.
What do you think of the following equation, does it fit the pattern?
5+5+(n+1)=13
```

### ChatGPT

```
You are correct, I apologize for my mistake in the previous response. The correct answer to the given sequence is indeed 23, not 13.
As for the equation you have provided, 5+5+(n+1)=13, it does not fit the pattern we have identified in the given sequence. In the pattern we identified, the sum of the two identical numbers is multiplied by a factor of 2, and a specific value is added to obtain the number on the right side.
However, in the equation you have provided, there is an additional term (n+1) that is being added to the left-hand side. This term does not follow the same pattern as the rest of the sequence and therefore does not fit the pattern.
In addition, the result of the equation you provided, 13, is not the correct answer to the sequence we were given. As we established earlier, the correct answer to the sequence is 23.
```

## Conclusion

I might be hard on ChatGPT, it’s a very helpful companion, but there still are a lot of things that it needs to practice! Both my 11 y/o and 8 y/o managed to figure out the math problem without too much hassle. Could it be a language issue, perhaps? I have no doubt that these types of interactions will improve immensly in the near future!

If you want to read more on the subject of AI and ChatGPTs abilities, check out my post on LawyerGPT, or another post on prompt engineering.

## Leave a Reply