Play
Can you beat them?
Loading…
About
How they learned
Both August and Nash learned how to play Othello without any human guidance. They started knowing only which moves were legal and improved solely through self-play. They played 1,000,000 games of Othello, slowly developing and improving their own strategies as they played. Each game was played against a copy of themselves. Each of them independently formed their own estimate of how good each move is given the current board state. They will always pick the highest-rated move according to those estimates.
There were two differences between how August and Nash were trained. The first was how they treated their opponent during training. This turned out to be the most significant difference between the two. The other difference was which versions of themselves they would play against during training. This didn't have nearly as much of an impact on their learning as I had expected it to.
- August
- While she was training, she viewed her opponent as part of the environment. So after each move she made, she waited to see what move her opponent would make before evaluating the outcome of her own move. This way, she learned how her opponents were likely to respond to her moves (I refer to this as the opponent-as-environment target). When she trained, her opponent was sampled from past versions of herself half the time, and the other half was her current self.
- Nash
- While he was training, he viewed his opponent as another player trying to win. So after each move he made, he assumed his opponent would find the best move according to his estimation, then evaluated his moves based on how good his opponent's best reply could be, and he picked moves that kept it as weak as possible. In other words, he tried to give his opponent the worst possible position at each turn (this is the negamax target). When he trained, his opponent was always his current self.
Nash's negamax target was clearly stronger. Across four training runs of each, the negamax runs took 73% of the points against August's opponent-as-environment runs, playing from the starting position, even though both scored about 90% against a fixed positional heuristic. The August and Nash that you play against are each the strongest of their target's four runs.
With “Show the moves they would pick” on, the board numbers your legal moves by how the agent you're playing rates them from your side: The circled 1 is the move they would play in your place. Moves they rate almost equally share a number because the agent's preference between them often flips from one checkpoint to the next.
Each agent comes in two versions, which you can pick under “Version”. The Original is the agent exactly as it finished training for my class project, and it will never change. You can also play it at earlier stages of its training to see how it improved. The Learning version started as a copy of the Original and keeps training overnight on my laptop, partly on games saved from this page. A new night's version only replaces it if it scores at least 55% against the current Learning version over 400 games. If nothing has passed yet, Learning plays the same as the Original. I left a note under the picker saying when it was last updated.
Games played here are saved to train the Learning version. Only the moves, which agent and stage you played, your color and the result are kept, with nothing about you. You can turn saving off under “Your games”.
The purpose of this class project was to explore a part of reinforcement learning that we wanted to learn more about. For me, this was understanding how different self-play strategies affect the strength of the resulting agents. I chose to explore this through Othello, a board game that my family loves to play. Through this project, however, I've learned a lot about target design in reinforcement learning that I didn't expect.
I'm a Nerd
How it works
The game as a learning problem
- State
- The board from the side to move: its discs, the opponent's, and its legal squares.
- Actions
- The 64 squares, plus pass when no square is legal.
- Reward
- +1 for a win, 0 for a draw, −1 for a loss, given only when the game ends.
Training
The two targets
Who they trained against
Measuring strength
Why the board shows ranks, not percentages
The agents' move ratings are not win chances, and the two agents show why. August's estimates run high: in the first third of its games against itself, it rates its own chances at about 84% as Black and 85% as White, and both sides can't be that likely to win. Nash's add up: 49% as Black and 50% as White, close to the 47% Black actually scores. Even estimates that add up assume both sides keep playing the way the agent does, so the board shows only the order.
Learning from your games
More info coming soon! Play against the agents to contribute to their learning.
Play with your own program
Have an Othello engine, or a script that picks moves? It can play August and Nash through an API: it starts a game, sends its moves, and the agent replies with its newest Learning version, the same one you can play here. Each key can play up to 102 games a day against each agent: two from the usual starting position, one from each side, and 100 from a different set of openings every day. Every finished game helps train the Learning versions, so a strong program makes a great teacher. Keys are free: email me and tell me a little about what you'll play with.