You are using AI wrong
I think every one of us can tell that AI is very dumb sometimes. Sometimes it outputs just utter nonsense or in simple terms - garbage. Sometimes it is smart and very helpful and sometimes it is as dumb as a chair.
For example, one day I asked AI about a book written by a specific author, but I didn’t remember the name of that book. Then AI said that the name of the book is “Wolf and Tractor”. It looks quite strange, especially if you take into account that the author died in the 18th century and there were no tractors in at that time.
And yes, I double-checked the internet because there was a chance that the word “Tractor” in the past was used for something else. But a search on the internet returned zero results. And any further questions return more and more bizarre results. It looks like AI went crazy.
But why does it happen? The answer is very simple, I had very long conversations with AI and it does not work well because of the token limitations of the AI model. What is a token? Here is a quote from ChatGPT: “1 token around 4 chars in English. 100 tokens around 75 words”. All words in the 2 paragraphs above are 102 tokens and 482 characters. You can play with the tokenizer here.
Free AI versions have token limits of around 100K tokens and paid versions around 1 million. Some most advanced AI models today have a limit of 2 million tokens. Some can say that there are less than 200,000 words that are in active use in the English language. So 1 million tokens should be enough to encode every single word in the English language, right?
Well, it is not. The token is not like the ID of each word. In some cases, the same words have the same ID but often then depends on the context of that word and their ID will differ.
For example this code:
echo "Test"
echo
generates 8 tokens. The space for example will get the same ID (220 in my example), but the word “echo” will get 2 different token IDs. In my example, the first one got ID 3713 and the last one got ID 198. But if you add 2 spaces before the first “echo” word then its ID will change to 256 instead of 2 times 220.
And the main issue is that when you ask the next question, all previous questions and responses count towards that limit because it is what developers of AI call “context”. It is the context of your conversation and AI must process it each time it answers your question.
Let us see it in action. I asked AI “When the second world war started?”. With a response, it will be 581 tokens. You are very far from reaching any limit. Then I asked, “When is it finished?”. And the AI knows that my first question was about the “second world war” and understands that “it” in my second question means “second world war”. But now the context grew to 1322 tokens.
Then I asked to write a program that counts the number of words in a given file in C and Delphi and the token count is already at 6200. Then 2 more simple questions and the token count is already very close to 10K which is already 1% of the limit. 1% in less than 5 minutes.
If you keep a conversation for a day and when you are researching some complex problem, you can easily consume up to 20% of the limit in a single day. Do it for the week and then you will sometimes observe a “crazy” AI.
I think that when the token count is very close to the limit AI removes something from memory and sometimes it looks like it was removing part of its knowledge base and then it resolves to pure fantasy and starts creating facts out of thin air. Eventually, I got something like an internal error and I had to reload the page.
For some AI it helps because refreshing the page starts a new conversation and some AI will keep it and as a result, the context didn’t change and it continued to generate mostly laughable responses.
What I’ve seen very often is amnesia. For example, you ask AI to write something in JavaScript. Then you have a very long conversation and then AI starts to produce code in C++ or Python. Or you put some constraints and then new responses violate them and you have to remind AI about it. It will follow new constraints but will forget about something else soon.
Somebody can say “But I asked a completely different question from a completely different topic”. For example, someone may ask a question about C++ and then ask about a pie recipe. They are very different but AI didn’t know that and to understand it, it still needs to process context.
As a result, my advice is to start a new conversation each time when you change the subject. And sometimes you will need to start a new conversation in cases when AI has to output a lot of information.
For example, some time ago I asked AI to write a relatively long program and it took like 15 000 tokens. Then I asked it to change it several times to work as I wanted and after around 20 minutes, the token count was close to 200 000. For many AIs, it will be well out of their token limit.
So keep conversations short and I hope it helps someone.
Comments