Live data from Hacker News

Why can't transformers learn multiplication?

arxiv.org

81–90 of 111 posts

Re: Why can't transformers learn multiplication?

#81
There are two kinds of computing - precision computing and probabilistic computing. For example, cryptography falls into precision computing. There is no room for being incorrect even by a single bit. Where as machine learning is about getting a range of answers, with tolerance for error.

I like to visualize them as cuts and spans in a continuum, such as a number line. They make up the full picture. One exists only because of the other. One can't do the job of the other and one is defined only in terms of the other.

Banks wouldn't use AI to compute the account balance after a transaction or for authenticating a customer. Network software wouldn't use AI for encryption and decryption of the TLS traffic. Also, banks wouldn't mind a x% error in computation of a credit rating, fraud detection or industry trends analysis.

Writing code is a probabilistic task with many variations possible, while the work done by the code during runtime, is a precision task, in most of the cases.

Re: Why can't transformers learn multiplication?

#82
post #10

Would love to see an architecture that learned more like humans. Start with just imitating one letter, then a few more, than some syllables, then full words, then sentences, etc. Progressively adding on top of previous knowledge Also, it’s interesting that one of the big goals/measures of models is their capacity to “generalize”, but the training methods optimize for loss/accuracy, and only after training test for ge…

Would like to see a car that moved like a horse.

Technically internal combustion engine has piston moving like horse legs.

Re: Why can't transformers learn multiplication?

#83

Earlier quoted context omitted.

"Would love to see an architecture that learned" Would be a far more accurate statement. Training != Learning.

Do you have an example of an algorithm that learns, rather than is trained/trains itself? I don’t really see the boundary between the two concepts.

Humans, and many other creatures, learn. While they are performing a task, they improve at the task.

LLMs are trained. While they are training, they are not doing anything useful. Once they are trained, they do not learn.

That's the distinction.

Re: Why can't transformers learn multiplication?

#84
post #69

Earlier quoted context omitted.

I'm a bit confused by this; are you referring to vanishing/exploding gradients during training or iteration at inference? If the former, this is only true if you take too many steps. If the latter, we already know this works and scales well.

How do you know if you've taken too many steps beforehand?

It's a hyperparameter much like learning rate. If the learning rate is too high, the training process would not work either. Addressing this is just a matter of a grid search.

Re: Why can't transformers learn multiplication?

#86
post #52
post #44

Earlier quoted context omitted.

Well, the LLM may re-infer the whole state fully on every instruction. Temperature 0 is deterministic and that's what we are looking for. If the model is trained properly on how the CPU state + instructions should be handled, then it should be able to produce the next state.

With temp = 0 if the model is off by one bit at step k, all subsequent steps are deterministically wrong. Your previous example shows the best case, which is a model can sometimes follow a textual recipe for long multiplication on short inputs. That's not the same as learning a length generalizing bit exact algorithm. Basically what you shown is the model can describe the algorithm. It doesn't show it can execute it…

> It doesn't show it can execute it at scale. Without writable state and bit exact ops,

Well, modern LLM coding agent products (eg. Claude Code) are able to store state in files in the current repository. So, you could have the model keep the "CPU State", and the files in the repository be the "RAM".

Also, could this https://arxiv.org/html/2402.17764v1 possibly reduce errors when doing inference? There is no floating point operations

Re: Why can't transformers learn multiplication?

#87
Interesting research, but it is still fascinates me why AI devs of current SOTAs ignore possibility to add numbers as first-grade citizens to AI. like for example suggested here: https://huggingface.co/papers/2502.09741

clean separation matter, it’s really strange to force models to mimic numbers and math via incredibly unfit token-mangling stuff, imho

Re: Why can't transformers learn multiplication?

#89
post #81

There are two kinds of computing - precision computing and probabilistic computing. For example, cryptography falls into precision computing. There is no room for being incorrect even by a single bit. Where as machine learning is about getting a range of answers, with tolerance for error. I like to visualize them as cuts and spans in a continuum, such as a number line. They make up the full picture. One exists only b…

> For example, cryptography falls into precision computing. There is no room for being incorrect even by a single bit. Where as machine learning is about getting a range of answers, with tolerance for error.

Doesn't both of them rely on randomness in real use cases/usage? And it's only once you have fixed seeds that cryptography becomes deterministic, and then you can make the same claim for most of ML, when the seeds are fixed you get fixed replies.

It happens to be that most people seem to use LLM clients that aren't deterministic, as they're using temperature + random seeds for each inference, but that doesn't mean someone couldn't do it in a different way.

Re: Why can't transformers learn multiplication?

#90

Earlier quoted context omitted.

People are probabilistic, and I've been informed that people are able to perform multiplication.

Are you sure? I bet you if you pull 10 people off the street and ask them to multiply 5 digit by 5 digit numbers by hand, you won't have a 100% success rate.

The pertinent fact is that there exist people who can reliably perform 5x5 multiplication, not that every single person on the planet can do it.
Post reply on HN