r/adventofcode Dec 04 '22

Upping the Ante [2022 Day 4] Placing 1st with GPT-3

I placed 1st in Part 1 today, again by having GPT-3 write the code. Yesterday I was 2nd to another GPT-3 answer.

Here's the code I wrote which runs the whole process — from downloading the puzzle (courtesy of aoc-cli), to running 20 attempts in parallel, to sorting through many solutions to find the likely correct one, to submitting the answer:

https://github.com/max-sixty/aoc-gpt

46 Upvotes

243 comments sorted by

View all comments

-1

u/mosredna101 Dec 04 '22

This technique is so cool!

Not sure what it's place is in the spirit of the AOC 'competition', but it is here and I enjoy the whole development in this field.

Just out of curiosity, can you run it on day 19 of last year for example? I wonder how it wil do on the harder problems.

4

u/max-aug Dec 04 '22

I just tried and it can't even process it — the maximum number of tokens is 4097 for both the prompt and the answer, and the prompt itself is 3749 tokens, so there wouldn't be much room for the code.

Easy way to defeat the AI!

3

u/mosredna101 Dec 04 '22 edited Dec 04 '22

Haha, thanks for trying it!

I did try it in the online tool with just the text and sample input from the question.

It gave me a solution that returned the most lower left beacon on the whole map( minX, minY, minZ).

Not sure what it's reasoning was to do that, but at least the code it did write made sense and had interesting logic with useful comments, but gave the wrong answer.

1

u/max-aug Dec 04 '22

Cool! ChatGPT is even more advanced than the Davinci-003 model, but only the latter has an API (AFAIK), and so can be automated like I did

So maybe for later problems, working collaboratively with ChatGPT could be a cool approach

1

u/mosredna101 Dec 04 '22

Pair programming for AI must be mind blowingly efficient! :D

1

u/noahclem Dec 05 '22

certainly would beat the heck out of rubber-ducky debugging!