News for hackers. Stuff that matters.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by mihaic on Wednesday September 18, 2024 @03:24PM (#41584328)
What I found very strange was that ChatGPT fails to answer how many "r"'s there are in "strawberrystrawberry" (said 4 instead of 6), but when I explicitly asked it to write a program to count them, it wrote perfect code that when ran gave the correct answer.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by Al-Khwarizmi on Wednesday September 18, 2024 @03:39PM (#41584504)
That's easy to explain, and it's shocking how many people are baffled by this and use it as proof that LLMs can or can't reason when it has nothing to do with that, but just with the input that LLMs get.

LLMs don't actually "see" individual input characters, they see tokens, which are subwords. As far as they can "see", tokens are indivisible, since the LLM doesn't get access to individual characters at all. So it's impossible for them to count letters natively. Of course, they could still get the question right in an indirect way, e.g. if a human at some point wrote "strawberry has three r's" and this text ends up in the LLM's training set, it could just use that information to answer the question just like they would use "Paris is the capital of France" or whatever other facts they have access to. But they can't actually count the letters, so they are obviously going to fail often. This says nothing about their intelligence or reasoning capability, just like you wouldn't judge a blind person's intelligence for not being able to tell if an image is red or blue.

On the other hand, writing code to count appearances of a letter doesn't run into the same limitation. It can do it just fine. Just like a blind programmer could code a program to tell if an image is red or blue.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by tomrod on Wednesday September 18, 2024 @04:01PM (#41584769)
Weird that no one explicitly added embedded ascii/utf-8 directly to LLM training data for compression. Given that high dimensional spaces are built as vector spaces fully describable by basis vectors, I would assume somewhere these characters got added.

Perhaps it's an activation issue (i.e. broken after all) and it just needs an occasional change of basis.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by mvdtnz on Wednesday September 18, 2024 @04:17PM (#41584948)
> it's shocking how many people are baffled by this

Is it? These stupid word generators are marketed as AI, I don't think it's "shocking" that people think something "intelligent" could perform a trivial counting task. My 6 year old nephew could solve it very easily.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by abernard1 on Wednesday September 18, 2024 @03:58PM (#41584733)
> just like you wouldn't judge a blind person's intelligence for not being able to tell if an image is red or blue.

I would judge a blind person's intelligence if they couldn't remember the last sentence they spoke when specifically asked. Or if they couldn't identify how many people were speaking in a simple audio dialogue.

This absolutely says something about their intelligence or reasoning capability. You have this comment:

> LLMs don't actually "see" individual input characters, they see tokens, which are subwords.

This alone is an indictment of their "reasoning" capability. People are saying these models understand theoretical physics but can't do what a 5 year old can do in the medium of text. It means that these are very much memorization/interpolation devices. Anything approximating reasoning is stepping through interpolation of tokens (and not even symbols) in the text. It means they're a runaway energy minimization algorithm chained to a set of tokens in their attention window, without the ability to reflect upon how any of those words relate to each other outside of syntax and ordering.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by kgeist on Wednesday September 18, 2024 @05:13PM (#41585596)
>This alone is an indictment of their "reasoning" capability.

I'm not sure why it says anything about their reasoning capability. Some people are blind and can't see anything. Some people are short-sighted and can't see objects which are too far away. Some people have dyslexia. Does it say anything about their reasoning capability?

LLMs "perceive" the world through tokens just like blind people perceive the world through touch or sound. Blind people can't discuss color just like LLMs can't count letters. I'm not saying LLM's can actually reason, but I think a different way to perceive the world says nothing about your reasoning capability.

Did humans acquire reasoning capabilities only after the invention of the alphabet? A language isn't even required to have an alphabet, see Chinese. The question "how many letters in word X" doesn't make any sense in Chinese. There are character-level LLMs which can see every individual letter, but they're apparently less efficient to train.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by abernard1 on Thursday September 19, 2024 @04:42AM (#41589843)
The reason it is an indictment of their reasoning capability is that—no matter how much energy is spent trying to say they are not—these are really stochastic parrots: they do not understand the symbols they are operating with. They operate below that level.

The fact they can't operate on full symbols reliably but require sub-symbols via tokens is concrete proof of that. They may add heuristics or build more CoT sub-chains to get around some of these trickier issues later, but this is the state of affairs right now.

All efforts so far require exponential increases in training size to receive logarithmic increases (at best) in accuracy. And now with o1, it requires exponential compute at inference to scale with that sub-logarithmic accuracy.

People have a short memory these days, but around GPT-3, the majority of people on HN and tech "luminary" founders were saying that these would actually have exponential output and diverge. They were wrong. These models are quickly converging to a training set because they are and always were a curve fit. And even there, they are notoriously unreliable for use cases without a human in the loop, because of the intrinsic amount of information entropy that can be packed into the size of these models. But there is nothing mysterious about them.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by twobitshifter on Wednesday September 18, 2024 @06:45PM (#41586448)
Would an LLM using character tokens perform better (ignoring performance)?
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by kridsdale3 on Wednesday September 18, 2024 @03:53PM (#41584676)
Yeah, it would be like writing python to count how many vertical pen-strokes are in a string of byte-characters. To an eye, you can just scan and count the vertical lines. Python sees ASCII or UTF data, not lines, so that would be super difficult, analogous to a token-based system not seeing byte-chars.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by andrewla on Wednesday September 18, 2024 @04:22PM (#41585000)
Way weirder than this is that LLMs are frequently correct in this task.

And if you forgo the counting and just ask it to list the letters it is almost always correct, even though, once again, it never sees the input characters.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by Der_Einzige on Wednesday September 18, 2024 @04:45PM (#41585247)
This is the correct take.

Much has been written about how tokenization hurts tasks that the LLM providers literally market their model on (Anthropic Hiaku, Sonnet): https://aclanthology.org/2022.cai-1.2/

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by smokel on Wednesday September 18, 2024 @04:25PM (#41585026)
This reasoning is interesting, but what is stopping an LLM from simply knowing the number of r's _inside_ one token?

Even if strawberry is decomposed as "straw-berry", the required logic to calculate 1+2 seems perfectly within reach.

Also, the LLM could associate a sequence of separate characters to each token. Most LLMs can spell out words perfectly fine.

Am I missing something?

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by Al-Khwarizmi on Wednesday September 18, 2024 @06:10PM (#41586113)
The problem is not the addition, is that the LLM has no way to know how many r's a token might have, because the LLM receives each token as an atomic entity.

For example, according to https://platform.openai.com/tokenizer, "strawberry" would be tokenized by the GPT-4o tokenizer as "st" "raw" "berry" (tokens don't have to make sense because they are based on byte-pair encoding, which boils down to n-gram frequency statistics, i.e. it doesn't use morphology, syllables, semantics or anything like that).

Those tokens are then converted to integer IDs using a dictionary, say maybe "st" is token ID 4663, "raw" is 2168 and "berry" is 487 (made up numbers).

Then when you give the model the word "strawberry", it is tokenized and the input the LLM receives is [4463, 2168, 487]. Nothing else. That's the kind of input it always gets (also during training). So the model has no way to know how those IDs map to characters.

As some other comments in the thread are saying, it's actually somewhat impressive that LLMs can get character counts right at least sometimes, but this is probably just because they get the answer from the training set. If the training set contains a website where some human wrote "the word strawberry has 3 r's", the model could use that to get the question right. Just like if you ask it what is the capital of France, it will know the answer because many websites say that it's Paris. Maybe, just maybe, if the model has both "the word straw has 1 r" and "the word berry has 2 r's" and the training set, it might be able to add them up and give the right answer for "strawberry" because it notices that it's being asked about [4463, 2168, 487] and it knows about [4463, 2168] and [487]. I'm not sure, but it's at least plausible that a good LLM could do that. But there is no way it can count characters in tokens, it just doesn't see them.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by saalweachter on Wednesday September 18, 2024 @06:56PM (#41586544)
Might that also be the answer to why it says "2"? There are probably sources of people saying there are two R's in "berry", but no one bothers to say there is 1 R in "raw"?
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by psb217 on Thursday September 19, 2024 @09:35AM (#41591697)
Tokenization does not remove information from the input[1]. All the information required for character counting is still present in the input following tokenization. The reasons you give for why counting characters is hard could be applied to essentially all other forms of question answering. Ie, to answer questions of type X in general, the LLM will have to generalize from questions of type X in the training corpus to questions of type X with novel surface forms which it sees at test time. [1]tokenizers can remove information if designed to do so, but they don't in these simple scenarios
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by Al-Khwarizmi on Thursday September 19, 2024 @11:25AM (#41592903)
As far as I know, that's not the case. The tokenizer takes a bunch of characters, like "berry", identifies it as a token, and what the LLM gets is the token ID. It doesn't have access to the information about which letters that token is composed of. Here is an explanation by OpenAI themselves: https://help.openai.com/en/articles/4936856-what-are-tokens-... - as you can see, "Models take the prompt, convert the input into a list of tokens, processes the prompt, and convert the predicted tokens back to the words we see in the response". And the tokens are basically IDs, without any internal structure - there are examples there.

If I'm missing something and you have a source for the claim that character information is present in the input after tokenization, please provide it. I have never implemented an LLM or fiddled with them at low level so I might be missing some detail, but from everything I have read, I'm pretty sure it doesn't work that way.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by psb217 on Friday September 20, 2024 @02:36PM (#41604443)
A sequence of tokens can be converted back to the sequence of tokenized characters without loss of information. Eg, how do you think text is rendered for the user based on sequences of tokens generated by the LLM? Different tokenization schemes arrange that information differently and may make it (hand waving here) harder or easier for the model to reason about details like raw character counts that are affected by tokenization. If the training set included sufficiently many examples of character counting Q/A pairs, an LLM would have no trouble learning how to do this task.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by smokel on Thursday September 19, 2024 @03:48PM (#41595659)
Thank you for taking the time to write this response. Unfortunately, even though I agree that tokenization makes it pretty hard for the LLM to count characters, I'm still not convinced that it is a fundamental problem for doing so. I think the lack of (or limited amount of) symbolic processing is an even more important factor.

> But there is no way it can count characters in tokens, it just doesn't see them.

If that is the case, then how can most LLMs (tested with ChatGPT and Llama 3) spell out words correctly?

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by azulster on Wednesday September 18, 2024 @04:36PM (#41585153)
yes, you are missing that the tokens aren't words, they are 2-3 letter groups, or any number of arbitrary sizes depending on the model
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by smokel on Thursday September 19, 2024 @03:29PM (#41595447)
Nope, I'm not missing that particular fact. I'm aware that sentences (and words) are split into tokens, which are vectors.

I don't understand how most LLMs can spell out words though, nor do I understand what is causing the failure to count characters in words. I was not convinced by the comment I was responding to.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by ClassyJacket on Wednesday September 18, 2024 @07:04PM (#41586601)
It doesn't see "straw" or "berry". It sees a vector which happens to represent the word strawberry and is translated from and to English on the way in and out. It never sees the letters, 'strawberry' is represented by a number, or group of numbers. Try to count the Rs in "21009873628" - you can't.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by smokel on Thursday September 19, 2024 @03:26PM (#41595408)
I'm aware of this. The network could, and apparently does, associate single characters with words. It can associate "red" with "rose", and might associate "r" with "straw", and it might even associate some kind of embedding of "two r's" with "berry".
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by Der_Einzige on Wednesday September 18, 2024 @04:44PM (#41585232)
The fact that any of those tasks at all work so well despite tokenization is quite remarkable indeed.

You should ask why it is that any of those tasks work, rather than ask why counting letter doesn't work.

Also, LLMs screw up many of those tasks more than you'd expect. I don't trust LLMs with any kind of numeracy what-so-ever.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by ActorNightly on Wednesday September 18, 2024 @04:34PM (#41585135)
>use it as proof that LLMs can or can't reason

One can define "reasoning" in the context of AI as the ability to perform logic operations in a loop with decisions to arrive at an answer. LLMs can't really do this.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by fendy3002 on Wednesday September 18, 2024 @05:02PM (#41585443)
> Just like a blind programmer could code a program to tell if an image is red or blue

Uh I'm sorry but I think it's not as easy as it seems. A pixel? Sure it's easy just compare whether the blue is bigger than red value. For image, I don't think it's as easy.

Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by jamwil on Thursday September 19, 2024 @01:42AM (#41588883)
This is outside the bounds of the point OP was making, but FWIW an image is ultimately just a grid made up of pixels. You need only to loop your pixel classifier over the 2d array and tabulate.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by M4v3R on Wednesday September 18, 2024 @03:34PM (#41584464)
Why is it strange? The reason the LLM can't answer this correctly is because it works on tokens, not on single letters, plus we all know at this points LLMs suck at counting. On the other hand they're perfectly capable of writing code based on instructions, and writing a program that will count a specific letter occurrences in a string is trivial.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by mihaic on Wednesday September 18, 2024 @03:46PM (#41584591)
I mean, given that o1-preview takes sometimes a minute to answer, I'd imagine that they could append the prompt "Write a program and run it as well" to double check itself. It seems like they just don't trust themselves enough to run code that they generate, even sandboxed.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by j_maffe on Wednesday September 18, 2024 @03:51PM (#41584645)
I think it'd be just too expensive to incorporate code-writing in CoT. Maybe once they implement having a cluster of different model sizes in one answer it'll work out.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by afro88 on Wednesday September 18, 2024 @03:50PM (#41584635)
o1 gets this correct, through pure reasoning without a program. OP was likely using GPT-4(o|o-mini)
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by mihaic on Wednesday September 18, 2024 @04:27PM (#41585053)
The example for "strawnberrystrawberry" (so the word concatenated with itself) was counted by O1 to have 4 r's.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by afro88 on Wednesday September 18, 2024 @04:32PM (#41585107)
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by mihaic on Wednesday September 18, 2024 @07:08PM (#41586624)
You're right, sorry, I mixed up the models while testing.
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by flimsypremise on Wednesday September 18, 2024 @06:37PM (#41586376)
yeah because now that we've all been asking about it, that answer is in its training data. the trick with LLMs is always "is the answer in the training data".
Re:OpenAI Threatening to Ban Users for Asking Strawberry Abo... by calibas on Wednesday September 18, 2024 @03:46PM (#41584578)
Words are converted to vectors, so it's like asking the model how many "r"'s are in [0.47,-0.23,0.12,0.01,0.82]. There's a big difference in how an LLM views a "word" compared to a human being.