Skip to content
Home ยป The Advent of Code and GPT-3

The Advent of Code and GPT-3

Have you ever tried the Advent of Code?

It’s a fun piece of data processing, problem-solving, software puzzling, and trivia for December and also a nice challenge for the brain.

I’ve been doing it since the first of December and I’m not setting the world on fire with my results but in my defence, you only get points if you’re there when the challenge opens which is in the middle of the night my time!

Getting the Perfect Score

So how do those at the top of the leader board get there? I just found out the answer via the Advent of Code subreddit.

Firstly, there’s an Advent of Code CLI. This allows you to download questions and data and submit answers via the command line. Best of all it’s written in Rust!

Secondly, some smart people like this person have used GPT3 to parse the input and automatically generate the code to solve it. Here’s the python code which is fed to GPT3 to generate the answer.

Interestingly though there’s this:

Here’s the code I wrote which runs the whole process โ€” from downloading the puzzle to running 20 attempts in parallel, to sorting through many solutions to find the likely correct one, to submitting the answer:

So it’s not foolproof. There’s an AI working fast to generate a lot of attempts and then a person is still needed to validate the work and submit the right answer.

If you want to do it like me, the old-fashioned way, I can assure you it’s pretty satisfying as well!

If you’ve not started yet, it’s not too late. I’ve even created a private leaderboard which you are more than welcome to join me on!

The code to join is 1736885-790c27a6

See you there!