Hi guys.
Welcome to this session.
So in this session we want to talk about ChatGPT tokens which you get to see over here.
So tokens are you can consider like pieces of words which are being used and counted over here.
So when you give a prompt specifically the tokens are generated and ChatGPT different versions have
different limits token limits out there.
For example, ChatGPT 3.5 had a token limit of 4096 tokens and ChatGPT four later on had 8000 tokens.
And now that we have new versions of it, they are much higher number of tokens which we get over here.
So how it works is whenever there is a prompt which you give to ChatGPT, the prompt will take some
of the tokens from there.
So let's say you give a really long prompt to ChatGPT 3.5, wherein it it uses up.
Out of 4096 it uses up 4000 tokens.
So now we are left with only 96 tokens for ChatGPT to respond back.
So your input and ChatGPT output both are considered in the total token amount.
The limit which we have got here.
So that is why you might see certain times when you are having a long conversation with ChatGPT.
At the later stage of it, the the responses might not be that accurate, might not be that sensible
information which you are getting.
So in such a scenario, the hack which you can think of is starting a new chat, or what you can do
is you can go ahead and summarize the complete conversation, ask ChatGPT to summarize the whole conversation
in a concise manner, and then copy that into a new chat and start from there again, so that you have
the fresh number of tokens again generated for the new chat.
So there are also different ways you can figure out how much tokens a particular prompt will will take
up.
So that also we have tools like a tokenizer which tool which you can use over here.
So first let's look at how OpenAI defines tokens Uh, on their platform.
So tokens can be thought of as pieces of words, which they have.
So you can see one token is almost approximately equal to four characters in English.
Okay.
And 1 to 2 sentences becomes around approximately 30 tokens, one paragraph, approximately 100 tokens,
and so on and so forth.
So here you can read about the token limits, token pricing, even exploring tokens.
So here you can see uh, every particular word gets a specific token.
So for example my is 33666 color is 3124.
Then red is 2266.
Now if you look at period period is 13.
So which is remains the same everywhere in the second one as well.
Period is given as 13.
However, if you look at red uh in lower cases is 2266, whereas red with uppercase is 2297.
So like this it differs.
And this is how uh you can see tokens are used up in our prompts.
Now if you want to calculate, uh, a particular prompt will take up how much tokens.
So you can use tokenizer over here.
So you can see this particular sentence will take about seven tokens.
Characters are 28.
If we pick a bigger text, let's say we are picking up this big text.
So in that case it's taking 81 tokens and characters are 371.
Each of them have been color coded.
Now in this manner you can understand.
So this is the idea behind tokens which needs to be taken into consideration.
So whenever you are using ChatGPT for different reasons, uh, keep this in mind at the back end of
your mind, uh, so that you are aware about it and you can optimize accordingly so that you get better
responses.
Thank you so much, guys, for listening to this and I will see you in the next video.