263 points · by freeqaz · 3y ago · 70 comments
>>Yes, 10000 is bigger than 10050.
>But even the mighty ChatGPT often can't do simple math
GPT is bad at math because BPE input compression obfuscates individual digits. https://bbot.org/etc/gpt-math.png You'd be bad at math too if every number was scrambled.
The graph is from page 22 of the GPT-3 paper from 2020. https://arxiv.org/abs/2005.14165 Even with 175 billion parameters it can't reliably do four digit addition.
An example from 4 days ago of ChatGPT being as bad as you'd expect at string reversal: https://news.ycombinator.com/item?id=35297183
(Although, I just tested ChatGPT Mar 14 Version against the above question after doing a bunch of math prompting and it got it right...)
The closest anyone's come to proving that byte-level tokenization is better is the ByT5 paper https://arxiv.org/abs/2105.13626
But they only showed evidence for improvement on specific tasks, not general performance, which is an important distinction. And their own benchmarks show that the improvements tend to be marginal: https://i.imgur.com/6Cw0APS.png
One view of the situation is that byte-level access (or "digit-level" in this case) gives a way to accelerate training, and to achieve higher performance with fewer parameters. The model doesn't need to spend as much effort on learning the decompression algorithm (tokenization).
But once learned, the tokenization doesn't seem to hinder a model from achieving higher performance, the same way that JPG compression doesn't hinder us from achieving an image that looks very good to humans. It's a bit like arguing an artist would be better if they only operated on raw bitmaps, or that our eyes would be better if our visual cortex didn't do any signal compression. Maybe, but the fact that our eyes do it is pretty strong evidence that compression isn't harmful.
I'm talking about specific tasks: saying if 10000 or 10050 is larger. GPT is demonstrably bad at that. The ByT5 paper doesn't mention arithmetic tasks or show benchmark results for the specific task I mention.
Your linked comment says:
>This is a common myth but in practice no one (as far as I know) has shown that byte level predictions result in superior overall performance.
Stating if BPE or character tokenization is better for everything is a much broader claim, one I didn't make! One could easily imagine a toolformer that calls out to calc.exe for anything involving numbers which would get much better numeric performance while still using BPEs.
This is the myth I was referring to. BPE compression may slow down training, but it doesn't follow that slower training is the reason for being bad at math.
If you trained GPT specifically on arithmetic tasks, you'd get superior performance to GPT-3, regardless of which tokenization scheme you'd use. But you'd destroy most of its knowledge about everything not-arithmetic.
I.e. "how many letters are in a word" or "which is the fifth letter of this word" type tasks is screwed up because the model has no information about the length of each token other than what it can infer from seeing some words in similar challenges in children learning materials; so it knows the length of some tokens (i.e. those used in simple words in similar materials) but not all of them.
"does 123912879212392 contain the digit 7" can fail because the model has limited information that the token "79" in the middle is somehow related to the token "7". If you ask whether "87" is contained in that number, then it has to deduce that from seeing tokens "128" and "79", both of which have no direct relation to the digits in them.
"is 50100 greater than 50200" becomes a tricky challenge because due to its tokenization it tries to compare "501"/"00" with "50"/"200" while knowing that "501" is greater than "50"; just as comparing "10000" with "100"/"50". We use Arabic numerals because their positional encoding makes arithmetic easier, but language models receive the same data without positional encoding, they get given something that's more like an extreme version of Roman numerals.
I mean, all of it can be learned if given sufficient data, however, we shouldn't be surprised if some tasks seem more difficult than they should be if we have explicitly crippled the representation we use to communicate these tasks to the system. And it doesn't neccesarily mean that we should change the tokenization (because these tasks are toy challenges not relevant to most real functioning), we just shouldn't use these types of letter/digit challenges to judge the quality of models.
Also side note...I went to high school with the author and hadn't heard about him for a while lol. That was a neat surprise.
All tasks that rely on it will perform worse than expected.
That's alrithmetics. For math problems:
Each alien chicken has 3 legs, each alien rabbit has 7 legs, for a total of 33 legs, how many alien chicken are there?
Now try to calculator that!
https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its...
Model would probably take that description and write python code to compute the answer.
It might be http://nlg.csie.ntu.edu.tw/~cjchen/papers/eacl2023.pdf
They show an increase from 65% to 70% on their "comparing numbers" benchmark.
https://arxiv.org/abs/2102.13019
The essence of it from the abstract:
". In particular, the model fails to learn addition of five-digit numbers when using subwords (e.g., “32”), and it struggles to learn with character-level representations (e.g., “3 2”). By introducing position tokens (e.g., “3 10e1 2”), the model learns to accurately add and subtract numbers up to 60 digits. We conclude that modern pretrained language models can easily learn arithmetic from very few examples, as long as we use the proper surface representation."
They compare it against PaLM and Minerva, both of which are fine tuned on math datasets.
It outperforms both at roughly the same parameter count (eg Llama 65B vs Palm and Minerva 62B) but unclear how much of this is due to encoding vs the many other differences.
It is useful to see that the performance increase is clearly not due to fine turning though.
Q: “Is 10000 bigger than 10050”
A: “No, 10,000 is not bigger than 10,050. 10,050 is 50 units larger than 10,000”
>>> Is 10000 bigger than 10050?
>Yes, 10000 is greater in magnitude than or exceeds the value of 10050. The number 10000 has a larger exponent and can be represented as (2^4) * 3 + (-7), while the number 10050 cannot have an even integer representation since it requires two more digits to represent its magnitude than any other positive whole numbers, which is not possible.
Well that's not right. Restarted with a new seed.
>>> Is 10000 bigger than 10050?
>Yes, because 10000 > 10050
>>> Is 10,000 bigger than 10,050?
>No, they are equal. The difference between them is only one digit (i.e., the last number). Therefore, it's not possible to tell if either value is greater or lesser by just looking at their values without knowing more information about what those numbers represent and how they were obtained in the first place.
Oooof. The LLaMA tokenizer didn't save it here.
That one is especially hilarious. But the part at the end "how they were obtained" is really strange. Where in its dataset would it possibly have learned such nonsense? Doesn't matter where numbers come from to compare them.
It implies that it doesn't understand what numbers even are in general, and that giving it a calculator (that it can use perfectly) only masks a much deeper problem.
I mean, I'm reading a ton of people say "its not just pattern recognition and token prediction, it has emergent properties!!!!" and from experimentation I believe it.
But if the models can pick up language and its intricacies, and even do simple logic tasks, shouldn't it also be able to pick up on what numbers are and how they work? At least knowing that where a number came from doesn't matter when its just about comparing their value in a pure mathematical sense?
What does that mean for concepts other than numbers? Do those models fake a LOT more than we already believe they do?
> Is 10000 bigger than 10050?
Yes, 10000 > 10050 > Why do you think 10000 is bigger than 10050?
Because the number after decimal point in both numbers are different. In case of '10,000', it has two digits and one comma while for '10,064' there are three digits with no commas between them which makes 10,059 as a whole number.
> Can you explain that better?
Sure! The first digit after the decimal point in both numbers is zero (indicating they are integers), but there's one more significant figure for 10,064 than for 10,059. This means that if you were to round off these two values using a calculator or computer program, it would give different results: - Rounding upwards from the second digit after decimal point in both numbers gives us 2 significant figures (i.e., "rounded" value) for each number; however, only one of them has an extra zero before that rounding figure. So if you were to use a calculator or computer program to calculate these values as rounded off from the second digit after decimal point using any method like truncation/roundoff etcetera (i.e., "rounded" value), it would give different results: - For 10,059, there is no extra zero before that rounding figure; therefore, you get a rounded result of 2 significant figures for this number using any method like truncation/roundoff etcetera (i.e., "rounded" value). However, if we were to use the same method on 10,064 and then calculate its rounded off version from second digit after decimal point as well; it would give a different result: - For this number too there is no extra zero before that rounding figure. Therefore you get a rounded value of "2" significant figures for this number using any method like truncation/roundoff etcetera (i.e., "rounded" value).
> But why are you mentioning the numbers 10,059 and 10,064 when the original numbers were 10000 and 10050?
The reason for this is that I wanted to demonstrate how roundoff errors can occur even with seemingly accurate data. In reality, it's not always possible or practical to obtain exact values of quantities like money amounts in real-world situations where there are many decimal places involved (e.g., 10,059 vs. 10,064). Therefore, we need to be aware that even seemingly accurate data can still have errors due to roundoff or other factors such as truncation of values when converting from one format/unit system to another.
> And if the 10000 and 10050 were the exact values, and not the rounded result, would 10000 be bigger than 10050?
Yes! If we had two numbers that exactly matched each other (i.e., if they both represented $10,000), then it is possible for one number to represent a larger amount of money due to rounding errors or truncation during the conversion process from one format/unit system to another.
> So, using the exact value of 10000 and the exact value of 10050, is 10000 bigger than 10050?
Yes! If we had two numbers that exactly matched each other (i.e., if they both represented $10,000), then it would be possible for one number to represent a larger amount of money due to rounding errors or truncation during the conversion process from one format/unit system to another.
> Is 10000.0 bigger than 10050.0?
Yes! If we had two numbers that exactly matched each other (i.e., if they both represented $10,000), then it would be possible for one number to represent a larger amount of money due to rounding errors or truncation during the conversion process from one format/unit system to another.
>
Still failed with the decimal.
Then engage the most appropriate plugins.
Do you know what percentage, roughly, this model has been trained relative to something like LLaMA? Are we talking 10%? 50%? 90%?
It may be possible that it is still useful if it can be trained further by the community!
Or, you know, customers who want a quote on how much it’ll cost to train on their data.
Not everyone has unlimited budgets to train a model to state of the art performance for giggles.
They have a cloud service offering for example fine tuning and pretraining well known LLM models on their chips. (est. $40k to train GPT3 6.7B in ~11 days)
There are no good benchmarks for text generation, but it would be surprising if it was competitive with the best open models.
It's unclear how much RLHF can help here - AFAIK no one has tried out DataBrick's Dolly to compare a GPT-J based RLHF model.