James Fator

Machine Learning in 2048

10 June 2014

For whatever reason, I spent my most recent spring break working on an AI solver for the famous game 2048. I planned on it being a first introduction to machine learning and man... was it rough.

Creating the 2048 engine from scratch was pretty easy; the hard part was making it fast enough. I was going for the reinforced learning route using a Least-Squares Temporal Difference Learning algorithm. This basically meant that the game would very, very slowly learn to value certain moves/board configurations more than others. My goal was not just to beat the game, but to teach the program to generate and utilize a neural network to create complex predictions of which would determine the best move to make. When we take this route, we can avoid going deeper and deeper into the min-max hole; which, isn't a bad thing necessarily, it's just that I wanted to go fast!

That's where I ran into an issue... I needed to simulate a massive amount of games to get the data I was looking for. I ended up spending my spring break focusing on the optimization of the game engine so that it could simulate a game faster and faster. Time began to grow short and I had to put the project by the side while I finished up the semester. With that said, not much has changed with my schedule being full, but I figured I should at least get the game engine up there if other people are interested. Sure, right now it's the 17th java implementation of a 2048 solver; however, I think the direction I'm shooting for is a little different.

I'll eventually come back to it and finish up - preferably when I have a machine learning class under my belt. At least until then it's open source under the MIT License, so definitely check it out if you're interested.

Check it out on GitHub here!

As always, feel free to email me if there's any questions.