chatGPT counting letters in sentances


Why can’t ChatGPT count the number of letters in a sentace?
If i ask something like ‘please give me 10 sentances each containg 15 letters’ it can give a correct count of the letters in a sentance. Sometimes it does, but most of the times it doesn’t.

Kind regards,

1 Like

It’s not optimized for this kind of thing, same reason it isn’t good at math. It’s a language model, not a counting model. There’s many other threads on the forum talking about word count and character count. You can try giving it examples or other methods of prompting.

1 Like

To expand on what @novaphil has said, it’s because of tokenization.

The GPT models have their own sort of “alphabet” where words are made up of tokens rather than letters. So, when you submit something to the model it is broken up into these tokens before being processed.

If you want to see this in action, you can enter some text into OpenAI Platform and it will show you how the models understand the text at an “atomic” level.

So, beyond just not being very good at counting the model will likely never be able to give you a precise accounting of the number of characters in a bit of text.

That said, it could write and execute a simple python script to count characters if needed.