2048
The classic game, plus an agent that plays it. Use the arrow keys yourself, or press Watch AI Play. The agent takes over from whatever position is on the board and runs until it reaches 2048, then starts over. Press it again to take back the board.
Arrow keys or WASD to move. Swipe on touch.
- Agent
- —
- Games
- 0
- Wins
- 0
- Moves
- 0
- Best tile
- —
- Rate
- —
How the agent works
The agent is an n-tuple network: a linear value function over small patterns of adjacent cells. Each tuple looks at a handful of cells and reads a learned weight out of a table. The value of a position is the sum of those lookups. Every tuple is evaluated under all eight symmetries of the board and shares one weight table, so a pattern learned in one corner is known in all of them.
Training is TD(0) over afterstates, the position after the slide and merge but before the random tile lands. That's the trick that makes the whole thing work. The agent never has to average over where the next tile might appear, because it's evaluating a deterministic consequence of its own move. Picking a move is then just: try all four, take the one with the best immediate reward plus learned afterstate value.
The result is a policy that's a lookup table, not a neural network. This is why it ships to this page as a few megabytes of quantized integers with no ML runtime involved.