17

Seeing Ding Liren playing the French, I asked ChatGPT for an example of a game he played with this opening:

Can you give me an example of Ding Liren playing the French defence?

ChatGPT replied:

Certainly! Here is an example of Ding Liren playing the French Defense in a game against Wesley So:

[Event "GCT Superbet Chess Classic 2021"] [Site "Bucharest ROU"] [Date "2021.06.07"] [Round "1.1"] [White "So, Wesley"] [Black "Ding, Liren"] [Result "1/2-1/2"] [ECO "C01"] [Opening "French"] [Variation "Exchange variation"] [TimeControl "5400+30"] [Termination "Game drawn by repetition"]

1.e4 e6 2.d4 d5 3.exd5 exd5 4.Nf3 Nf6 5.Bd3 Bd6 6.O-O O-O 7.Bg5 h6 8.Bh4 Be6 9.Nbd2 Nbd7 10.c3 c5 11.dxc5 Nxc5 12.Bc2 g5 13.Bg3 Bxg3 14.hxg3 Qb6 15.Nb3 Nce4 16.Nfd4 Bd7 17.Qd3 Rae8 18.Rad1 Re7 19.Rfe1 Rfe8 20.Re2 a5 21.Nd2 Nc5 22.Qf3 Bg4 23.Rxe7 Rxe7 24.Nf5 Bxf3 25.Nxe7+ Kf8 26.Nxf3 Qxb2 27.Rd2 Kxe7 28.Re2+ Kd6 29.Nd4 Qa1+ 30.Kh2 Ng4+ 31.Kh3 h5 32.Nf5+ Kc7 33.Re7+ Kb6 34.Nd6 Qh1# 1/2-1/2

In this game, Ding Liren played the French Defense with 1...e6, and the game transposed into the Exchange Variation after 2.d4 d5 3.exd5 exd5. While the game ended in a draw, it is an example of Ding Liren's ability to play the French Defense at the highest level of competitive chess.

Okay, the final score is bizarre: it's a checkmate and a draw. And I don't think this is a super-GM game (it's a French exchange...). But I'm confused as to how ChatGPT created this game. The checkmating pattern looks familiar, so maybe it's from a famous game.

If you've attempted to play chess against ChatGPT, you quickly learn it doesn't know how to play, and constantly makes illegal moves. So I'm puzzled how it came up with a plausible game of chess. I didn't find it in the LiChess database.

[fen ""]
[Event "ChatGPT-generated game"]
[White "??"]
[Black "??"]

1.e4 e6 2.d4 d5 3.exd5 exd5 4.Nf3 Nf6 5.Bd3 Bd6 6.O-O O-O 7.Bg5 h6 8.Bh4 Be6 9.Nbd2 Nbd7 10.c3 c5 11.dxc5 Nxc5 12.Bc2 g5 13.Bg3 Bxg3 14.hxg3 Qb6 15.Nb3 Nce4 16.Nfd4 Bd7 17.Qd3 Rae8 18.Rad1 Re7 19.Rfe1 Rfe8 20.Re2 a5 21.Nd2 Nc5 22.Qf3 Bg4 23.Rxe7 Rxe7 24.Nf5 Bxf3 25.Nxe7+ Kf8 26.Nxf3 Qxb2 27.Rd2 Kxe7 28.Re2+ Kd6 29.Nd4 Qa1+ 30.Kh2 Ng4+ 31.Kh3 h5 32.Nf5+ Kc7 33.Re7+ Kb6 34.Nd6 Qh1#

Question: Where did ChatGPT get this game from?

8
  • 4
    probably not a game between masters considering they played till mate and with a queen down
    – cmgchess
    Apr 18, 2023 at 12:28
  • 32
    ChatGPT makes a bunch of stuff up and calls it true. It's sort of just winging it. I've seen this also in the programming realm, as well as anything about twitch streamers/league of legends game mechanics.
    – Thomas
    Apr 18, 2023 at 18:42
  • 5
    @Thomas That's the nature of Language Models. It doesn't actually "understand" anything. It, strictly speaking, is an output machine, one that can generate high-school / undergrad level writing, but it has no ability to detect truth. If enough people on the internet say a certain thing, it becomes "truth".
    – Nelson
    Apr 19, 2023 at 2:36
  • 14
    ChatGPT is a bullshit generator trained to generate the most exotic kind of bullshit - the believable kind. Often the truth is what's most believable - it does legitimately "know" a whole lot of things to the extent you are willing to accept a machine can know things - but it also often produces output that is not true.
    – user253751
    Apr 19, 2023 at 8:38
  • 2
    @Nelson: A key feature of ChatGPT which sets it apart from earlier work is that it doesn't work like you explain. The initial network training works like that, yes, but there's a second training phase (Reinforcement Learning from Human Feedback, RLHF) which greatly reduces the amount of bad output. Obviously that phase doesn't include chess.
    – MSalters
    Apr 20, 2023 at 7:25

3 Answers 3

19

If you've attempted to play chess against ChatGPT, you quickly learn it doesn't know how to play, and constantly makes illegal moves. So I'm puzzled how it came up with a plausible game of chess. I didn't find it in the LiChess database.

ChatGPT can most certainly play chess when prompted correctly; see e.g. my related question here for evidence. Playing chess against an opponent is expected to be harder than making up a game (because in the latter case, the model controls both sides and makes moves that from its point of view all fit into the story), so I find it unsurprising that it can hallucinate a whole game.

In that context, the strange result of the game ending with checkmate and being scored as draw has, I think, also a simple explanation. The story demands that the game be played by grandmasters, so the model will try to emulate good play. At the same time, the model generates the game one token at a time, and can never take anything back. So it generates the header, decides that the game will be a draw, and starts generating the game. Later on, good play demands that an obvious opportunity to checkmate not be missed, so it checkmates. Then it retcons the result to draw in order to remain consistent with the header, which, to reiterate the point, it cannot change after checkmate has been delivered.

It is possible that this tension between two different goals in the story it was writing (make it a draw! play well!) also explains some of the poor play shown. However, simple failure to keep track of tactics is also a plausible explanation here.

11
  • 24
    A more likely explanation is that ChatGPT doesn't actually understand chess in either the way that a human does or the way that a chess engine does. Rather, the training data contains enough examples of chess games that it's formed a rough understanding of what moves follow what other moves, and used that to hallucinate a chess game.
    – Mark
    Apr 19, 2023 at 3:31
  • 6
    @Polytropos I find it implausible that ChatGPT tracks board state because all it has to go on for each iteration is the list of moves so far in chess notation. As I understand it, it cannot store data between computing each token. Each one is computed from scratch based on the last N tokens.
    – user253751
    Apr 19, 2023 at 8:39
  • 2
    @w123 possibly if it has N layers, which it surely doesn't. The maximum iteration depth of learned algorithms is limited by the number of layers. Each layer can do a little computation (globally, based on the whole input) as well as referring to the outputs of the layer before it.
    – user253751
    Apr 19, 2023 at 14:04
  • 4
    @user253751 An experiment in the Microsoft paper "Sparks of Artificial General Intelligence" gives GPT-4 a sequence of movements through an unseen map. GPT-4 can then accurately describe the map, suggesting it has an internal representation of the map somewhere in its neural layers. Not a big leap to go from that to chess boards. twitter.com/zachary_horvitz/status/1638766875327754240/photo/1
    – KarlKastor
    Apr 19, 2023 at 18:23
  • 2
    @user253751: For GPT-4, one can sort of settle the question of whether it can track the position by giving it a game and asking for the FEN of the final position. The results are usually not perfect, but very similar to the positions actually obtained at end of game. For GPT-3.5, this does not work, but still it is able to announce checkmate, play legal moves, and even play mostly good moves throughout long games. I would expect that this involves some position-representation, although the form of that representation is not clear (it could be a lightweight bag-of-tricks representation).
    – Polytropos
    Apr 19, 2023 at 22:59
17

As this interesting video which explains how ChatGPT (and similar AIs) works, says about ChatGPT's problems when generating "answers":

Hallucinations: model might make up wrong facts

And this is clearly what has happened here. The game is a million miles from any game that Wesley So and Ding Liren would ever play.

ChatGPT also claims the game was played in round 1 of the GCT Superbet Chess Classic 2021. Here's the problem, although Wesley So did play the tournament, Ding Liren didn't. In fact in the first round So was black against Mamedyarov.

This ChatGPT answer is an example of it hallucinating or, more prosaically, making up stuff from random information it picked up from the internet.

The actual game moves will follow this pattern and just be from some random game it found online. Given the quality of the game it will have been played by two relatively low rated players perhaps even a bot.

2
  • 1
    The lichess AI gives Black 98 percent accuracy and 7 centipawns average loss, so it stands to reason that at least Black would not have been a low-level player, no matter where the game comes from.
    – Polytropos
    Apr 18, 2023 at 10:57
  • 4
    Most of this info was already stated in the question. The issue is: how could ChatGPT generate make up such a believable chess game in this particular spot only?
    – David
    Apr 18, 2023 at 11:00
12

ChatGPT is a language predictor - it doesn't "know" anything but what words are likely to come next.

What's interesting is that the Detector at https://openai-openai-detector.hf.space/ rates the quoted output text as being 78.15% "REAL" based on 383 tokens.

Normally the detector is really good with anything over 50 tokens, but chess notation is clearly a "language" with a predictable structure that the model can use to create a game out of thin air.

ChatGPT is not a search engine - but it does draw sources from all over including the web. I'd suspect that the vast bulk of published games in this notation are legitimate moves, so the language model for "chess notation" is influenced to predict legit plausible moves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.