published on in tech gpt LLM gptaoc2022

Day 5 – Mutiny? – ChatGPT vs Advent of Code

Ok, today didn’t start like the other days. I started out with the normal priming prompt. And I got back.

Hi there! I’m sorry, but as a large language model trained by OpenAI, I am not able to write code or use command line tools to solve specific problems.[snip]

Maybe it knew this one would be hard and tried to avoid doing the work? It’s impressive how fast one start giving human feelings to(e.g., anthropomorphising) GPT.

But no fret, we know it can do it and indeed. If we just give it the problem, it will provide a solution. But it’s not doing great, the solution does not work, and giving back the error to it isn’t helping.

So to speed things up, I’ll provide some assistance to the assistant by pointing out more clearly why the error happens. It’s because it’s not parsing the data correctly, so we tell it that:

You’re reading the input data wrong, the first number is the number of crates to move, the second is the source pile.

And get a better version back.

But I also notice that it’s actually failing to parse the crate towers, it’s assuming each “tower” is on one line, which is wrong. To figure out the towers, you need to look at the whitespace.
I try telling GPT this, but it’s even more confused now, especially about the top crates which can have lots of whitespace on either side. After a few attempts and hints it produces something which almost work.

It dislikes being told what to do?

One thing I have noticed a few times is that GPT does not seem to listen to instructions which asks it to leave out part of the answer. Sometimes to speed things up I ask it to only show the code, but it will still add some extra wording. Or if I ask it to only show the function, it will still print the full code.

Either way, back to the code. It took many attempts to get it to do the right thing. I am curious if the others who are doing this had better luck.

It seems like no, as of now (2022-12-05-19:47 UTC) none of the others I have found has solved it.

But we got our ⭐ at the end. After a lot of trial and me giving some hints. The full transcript is available here! if anyone is interested.

Part 2

Okay, interesting. I’m not even going to try to copy the full instructions to GPT. Instead, I just read the instructions, and now we can move multiple crates at once.
Interestingly, during part 1, GPT already produced several solutions which looked like it solved just this.

But even if I tried a few times, I couldn’t get it to do it. So, I just gave up, or rather I solved it myself. But telling GPT exactly what it was doing wrong and how to solve it felt like it’s me solving it, not GPT. Although I’m happy to provide hints to GPT to speed things up, the idea is not to have me solve it and tell it how to. No second gold star today.

Conclusion

Yesterday’s problem was too easy, today’s was too complex. I had lots of issue getting GPT to understand the structure of a pile. To a human, it is intuitive that [D] is on the top.

    [D]    
[N] [C]    
[Z] [M] [P]
 1   2   3 

But not for GPT, many times when I tried to let it know what it was doing wrong, it reverted to moving the bottom item. Which makes sense, I doubt it has seen many examples like this in its training data.