kawsar.

Technical University of Denmark

Agents that play 2048

  • Expectimax
  • MCTS
  • HPC
Agents that play 2048Technical University of Denmark

Three game-playing agents and five heuristics, benchmarked over 11,000 games on the Technical University of Denmark's HPC cluster.

The work

In 2048 a new tile lands in a random spot after every move, so an agent has to plan under chance. Storing the best move for every possible board would take over 100 petabytes, so it has to search instead.

Technical University of Denmark · 2025 · Team of 4

What I found

Expectimax played best: at depth 5 with the score heuristic it averaged 10,714 points over 100 games. Searching deeper barely helped, since past depth 5 the score flattened while CPU time grew exponentially. MCTS came close for far less compute, averaging 8,783 points at about 4 CPU-seconds a game.

What I did

  1. 01Built three agents: Expectimax, Monte Carlo tree search and flat Monte Carlo.
  2. 02Designed 5 heuristics for scoring a board, from counting empty cells to a snake pattern that keeps big tiles in a corner.
  3. 03Ran over 11,000 games on the Technical University of Denmark's HPC cluster and ranked every setup by score per CPU-second.

Results

  • 10,714 average score, Expectimax at depth 5
  • 2,219 points per CPU-second, the most efficient setup
  • 11,000+ games on the HPC cluster

related links.

Back to theall works.