> It’s not even trying to be competitive, it’s just guessing how the game will continue. If you blunder, it might guess that this must be a game between two blundering fools, and play accordingly.
In a certain sense, GPT-2 is optimized to "look good to people interested in AI." Above all else it tries to generate plausibly-human-looking things, while completely oblivious of any other goal. This makes it an interesting fit for scenarios with objective scoring criteria. It may never be "good" at the scenario, only entertaining to human observers.
It’s a pity that the common annotation for a “surprising” move is to follow the move code with an examination mark (or two) rather than preceding it; otherwise we would have a simple way of making the model generate surprising moves on command. :)
> otherwise we would have a simple way of making the model generate surprising moves on command
One method would be to just take the 3rd or 4th best move option. It wouldn't be a winning strategy but it would probably be pretty surprising and still moderately effective.
Also, I'd imagine that the most surprising moves would require the opponent to make a very precise series of moves to avoid a losing position. While the best moves usually slowly improve your position, the most surprising moves might polarize the position by giving the opponent a chance to improve but also making the chance of a costly blunder more likely.
In that sense you could look for moves that give the opponent the fewest number of positive expected value moves rather than finding moves that give your opponent the lowest possible EV response.
It is surprising to me that you can predict optimal/strong engine moves with 27% accuracy using a completely trivial linear model, that is by a single matrix multiplication.
I wonder how well it would compete with this GPT-2 engine.
GPT-2 is byte pair encoding and transformer. Is there any indication that BPE plays any role here, because the vocabulary is fixed? If not, then it is only the transformer that is interesting and this post is just trying to use the name of the model, because it sounds cool. And actually giving moves directly to transformer may improve the results.
It's unknown what role if any BPE plays. I was surprised to discover that the final probability of a move is equal to the probability of each token from the root prompt, i.e. even though "1.Nf3 e5" is encoded as ['1', '.', 'N', 'f', '3', ' e', '5'] the probability of e5 seems unaffected by the fact that Nf3 is 3 tokens as opposed to one.
You're right that coming up with a token mapping could help things. It's a bit tricky to do that right now. Your options for fitting a custom vocab seems to be "use sentencepiece to fit a vocab, then modify the gpt-2 codebase to use the sentencepiece library for decoding".
I am honestly not sure if the output of sentencepiece is compatible with traditional encoders. What I mean is, it doesn't seem to generate an encoder.json + vocab.bpe file. It seemed to be some other kind of format. So I'm not sure if the tooling that has evolved around OpenAI's encoder format would be applicable there. I really don't know, though.
This is amusing but doesn't really prove anything special about GPT-2 or general intelligence. You can probably get similar results with an n-gram model.
Though this is not particularly strong, I don't think you would get similar strength from an n-gram model. You need longer-term correlations, which is generally where transformers do well.
>> How impressed should we be that the same AI can write poems, compose music, and play chess, without having been designed for any of those tasks? I still don’t know.
For the record, you can do the same things with a Hidden Markov Model (or hand-crafted rules) and the results won't be very different. Except that they won't elicit breatheless articles about being a "step towards general intelligence".
The text generated by GPT-2 is far superior to HMMs. GPT-2 was able to perform unsupervised machine translation and answered more than 5x as many questions correct on the SQUAD Q&A dataset than the previous best pure neural model.
Not to mention that the text generated by GPT-2 can often fool an online reader whereas HMMs have the problem of being long-term incoherent and don’t reference back to subjects of the sentence like GPT-2 often does.
I’m not staying you should believe the AI hype in news media. But the paper does contain a lot of thorough analysis and comparison to the previous state of the art.
Leaving the question of machine translation etc aside for the moment, this is about playing chess from textual examples of play. There is no reason to assume that, even if GPT-2 was really any good at machine translation, that it would be any good at chess.
I guess people think "it's a powerful model so it should do well in any task" but that's typically not the case for neural nets. I know what OpenAI claims about how it can do a little bit of everything, machine translation benchmarks are borked and I bet so are question answering ones (which I confess I don't know much about).
Hello everybody. I made this notebook. If you like this kind of thing, please subscribe to gwern's patreon. https://patreon.com/gwern
It's a GPT-2 1.5B model trained on the kingbase 2019 dataset. (>3M games of >2000 ELO rating.) It was trained for 400k steps with batch size 6 using 140 TPUs in 24h using a technique known as swarm training. Here's an incomplete whitepaper on swarm training: https://www.docdroid.net/faDq8Bu/swarm-training-v01a.pdf
Each line is of the form [Result "0-1"] [WhiteElo "2715"] [BlackElo "2793"] 1. e4 ...
Result 0-1 means black won; 1-0 means white won; 1/2-1/2 means a draw.
At runtime I prompt it with [Result "0-1"] and a high elo for white and black to make it more likely to generate higher level moves.
Our next project will be a GPT-2 IRC bot where you can talk with simulated people. We currently have one that wasn't trained for very long, yet the preliminary results are interesting enough to warrant a more serious time investment. https://twitter.com/theshawwn/status/1208667331230089216
Many people have asked for a thorough technical writeup which I hope to make available soon. In the meantime, you an read some of our GPT-2 1.5B adventures here: https://www.gwern.net/GPT-2#gpt-2-1.5b
Lastly, someone on /r/slatestarcodex apparently did this exact same thing a few months ago. They trained on algebraic notation instead of PGN format, which is basically x1y1x2y2 coordinate form with no mention of the type of piece. It was also trained on 1B moves. The engine is superior to ours and can apparently reach move 40 without blundering, according to the replay. https://www.reddit.com/r/slatestarcodex/comments/el87vo/a_ve...
I have also been porting the stylegan2 codebase to TPUs to facilitate swarm training. We hope to train on a very large dataset like the entirety of danbooru2018. No promises, but results are interesting so far. https://twitter.com/theshawwn/status/1214245145664802817
I hope you all found this enjoyable. The GCE bill is currently $50, which I'm keeping an eye on. (Go subscribe to gwern's patreon to see more projects like this!)
1.e4 e5 2.Ke2 Nc6 3.Kf3 g6 4.Kg4 Bg7 5.Nf3 h6 6.Nxe5 Bxe5 7.d4 Bg7 8. e5 at this point the notebook started allocating more memory and after it became irresponsive.
this is hilarious and also a great idea. i dont see any reason why you can't play a few million games against itself and other engines and see where it takes you. less efficient than alpha zero probably, but how much so?
It should be similarly efficient. AlphaZero used 1,000 TPUv1's to generate self-play games, and a much smaller number of TPUs to train the model on the previous self-play results. Whenever it generated a model that was >= 55% better, that became the new model.
You're right, "efficient" should be substituted with "possible". We're certainly not claiming that this is a smart way to do it, just that you can.
Still, I think that there's a chance it could work well. Each move could be prefixed with the final outcome of the game, which is the technique either alphazero or muzero uses.
> It’s not even trying to be competitive, it’s just guessing how the game will continue. If you blunder, it might guess that this must be a game between two blundering fools, and play accordingly.
In a certain sense, GPT-2 is optimized to "look good to people interested in AI." Above all else it tries to generate plausibly-human-looking things, while completely oblivious of any other goal. This makes it an interesting fit for scenarios with objective scoring criteria. It may never be "good" at the scenario, only entertaining to human observers.