Friday, 30 October 2026

AI Psychology And The Context Window [AI Text Adventures part 7]

This article is part of a series about playing text adventures with AI. It’s written by a human being (me) but may include examples of clearly identifiable AI-generated text and imagery.

Humans have different kinds of memory – for example, short-term and long-term memory, or different areas of memory for facts and words, events and skills.

AI may or may not be intelligent. It is not human, and it has its own memory structures different from those of the human mind. From my discussion with ChatGPT after the end of Neon Meridian, and some background reading across the human Internet, I understand that ChatGPT and other AI chatbots have three different kinds of memory:

Context: the information available to ChatGPT that can be used when replying to a prompt, including information from the current chat (but not necessarily all of it), linked chats and files in the user’s account, and the other types of memory below.

Persistent Memory: a small amount of information available across chats, which can be altered by the user or ChatGPT, generally used to store “deductions” about the user, for example my supposed wish to play games that all feature a character called Mara.

Knowledge Base: a vast reservoir of knowledge and language taken from the books, movie scripts, webpages and all other documents given to ChatGPT for training. It’s possible that concepts such as the First Star or Lantern Project might have been derived from, say, the Expanse or Foundation novels as there will be information about these series in the base.

The bane of my life when playing AI text adventures has been context, and specifically the Context Window. I didn’t understand this at first – I thought that ChatGPT was using the whole of the chat transcript, however long, when in fact it is only looking back at part of it.

Imagine that I, the user, am writing a transcript on a scroll of parchment on a long wooden table. The scroll is much longer than the table. As the transcript gets longer, the scroll moves along the table until the first words of the transcript hang over the far end, where I can no longer see them. I asked ChatGPT to illustrate this:

This is significant for AI text adventures because when the transcript starts to fall out of sight, the first words that disappear are the instructions for the game. From this point ChatGPT is no longer following those instructions, instead it’s trying to reverse engineer the nature of the game from the rest of the transcript. At first you don’t notice – but the game becomes more repetitive, and the gameplay gradually drifts away from your intended rules.

This is also, finally, the solution to The Mystery Of The Never Ending Game. The end state in the instructions was lost immediately as soon as it fell outside of context. Even though there were mission objectives, ChatGPT no longer knew that I wanted the game to end once they had been reached.

Although this is a nice simple explanation of the Context Window, it is of course wrong. The window is not a specific amount of text, it’s an amount of processing activity. Imagine that as well as the user, there is a researcher who has to walk along the transcript looking for relevant information, then put together a response and return to the user within a very short time. I asked ChatGPT to add the researcher to the illustration:

This is a more accurate metaphor and it explains why the Context Window is unpredictable and can’t be treated as solid memory. How far along the transcript the researcher gets will depend on the complexity of the prompt – if a lot of analysis is needed, or if the researcher also has to detour and look things up in the knowledge base or elsewhere, then they won’t get as far along the transcript before they stop and turn back.

It’s not only game instructions that fade. As the transcript gets longer, characters, events and game lore will also be lost as they fall outside of context - so even though the information is still there in the transcript, the game continues as if it has all vanished. This has a chilling effect on the player - ever since I understood about this issue, I've been anxious about what is being lost from the game. It's as if there is a Lovecraftian, demonic entity at the far end of the table who is eating the parchment:

How can mere human users defeat the Context Eater? Can it even be defeated? In the next post I’ll discuss coming to terms with its invincible nature. But while it can never be killed, it turns out there are several ways to keep it at bay or reduce its appetite, allowing more satisfying user-AI experiences. Until tomorrow...

No comments:

Post a Comment