One of the weaknesses of GPT-3 is its relatively small context window, which is only 2000 tokens. That is, roughly speaking, equivalent to around 1000 words.
I call it 'small', but the equivalent in humans is working memory, which is usually quoted as having space for 5 to 7 "items". An item isn't a token, though; they are, more accurately, references to long-term memory, and GPT-3... doesn't have long-term memory. That's even more of an issue with AI Dungeon, which limits the size of the input to less than the maximum 1000 words for performance reasons.
There are a couple of ways to work around this. One way is to provide breadcrumbs, which is more or less automatic -- even if an old paragraph is forgotten, it'll have had consequences for later paragraphs. GPT-3 can pick up on amazingly subtle hints, which certainly includes these. That only works for
probable continuations, however, and if it's the only mechanism you use, you'll typically get output that looks banal and predictable, or random wandering between topics and genres, or both. Typically both.
The second way, which is enough for short-form fiction, is to use the 'pin' function. I'm using that as a mechanic in this quest -- if you vote for [X][Remember], what I do is add to that. It's prepended to the AI's input, though with a bit of a preamble that makes it work for... world state, more or less. The current contents is this:
The below is a short science fiction story by Terry Pratchett, on the subject of Generic Pawn Templates, otherwise known as GPT templates:
You enjoy reading fanfiction on Sufficient Velocity, that's why you haven't been working out. Your memory is hazy, however you can't shake the feeling that an increasing number of people are acting strange. Some are even missing. However, no one else seems to notice.
...that first sentence seems to help it produce better quality, so I use that or an equivalent almost everywhere.
However, the pinning function is in practice limited to 200 words. That might be enough for short-form fiction, but it isn't nearly enough for a longer story. So what is one to do? ...well, how do humans work?
The pinning function is roughly equivalent to short-term memory.
There's a third function available, world info, which is roughly equivalent to associative, long-term memory. It's a little hidden; if you're playing with this yourself, you'll need to search through the 'edit adventure' menu. To quote,
"Here you can add world info entries (comma separated keys and an entry) to shape what the AI knows about the world and hidden info the player doesn't see. An entry is included in what's fed into the AI if one of the keys is detected (case doesn't matter) in the last output or input."
I would recommend doing so in a second tab, so you have easy access. Just remember to click 'save' after each edit. I will not be letting you edit this, or even show you the contents, but right at the moment it looks like this:
It's going to grow. Most likely quite a lot. It's fairly common for the AI to do something that makes me need to retry, but if it
forgets an element of the past, the best way to fix that is by updating its associative memory. It's a bit of work, but well worth it if you want good results.
Note that, as far as I can tell, said entries are included in the AI's next input
even if the reason the AI gets invoked is that you pressed 'retry'. This is, of course, precisely what you'd want.