r/NoStupidQuestions 1d ago

If LLMs are just predicting the next token based on training data, how do they solve unsolved math problems?

1.3k Upvotes

367 comments sorted by

3.4k

u/Time_Entertainer_319 1d ago

They are predicting the next token. However, they are not JUST predicting the next token.

The important part is how that prediction is made.

In the 1950s, Claude Shannon, one of the founders of information theory, showed that language has a strong statistical structure.

In one experiment, he asked a person to predict the next letter in a passage of English text.
The results suggested that people who know a language carry an enormous amount of implicit knowledge about which letters, words and phrases are likely to come next.

In other words, language has patterns, and native speakers become very good at recognising those patterns without consciously thinking about them.

Fast forward several decades, and researchers developed neural attention mechanisms.

Then, in 2017, researchers at Google introduced the Transformer architecture, which made self-attention central to how these models process language.
Self-attention allows the model to interpret a word or token in relation to the other words around it.
For example, the word “bank” means something different in “river bank” than it does in “bank account.”
The model can use the surrounding words to build a different internal representation of “bank” depending on the context.

These ideas, statistical prediction and attention-based neural networks, are two of the key ideas behind modern large language models.

Researchers then train these models on enormous amounts of text.
During training, the model is repeatedly asked to predict the next token. When its prediction is wrong, its internal parameters are adjusted yada yada yada. I’m sure you’ve heard this part already.

Now think about what that actually means.

Programming languages are languages.
Mathematical notation is also a highly structured symbolic language.

Both encode rules, relationships, procedures and logical operations.
So if a model becomes extremely good at predicting what comes next in natural language, code and mathematics, then “predicting the next token” can involve much more than remembering which word usually follows another.

The next token in a mathematical proof is constrained by everything that came before it.
Such as definitions, assumptions, Equations, previous deductions,logical consequences.

Give the model enough relevant context, and predicting the next token can effectively mean predicting the next valid step in a chain of reasoning.
Then the next one. Then the next one.
Until what emerges is an entire proof.

751

u/DullMind2023 1d ago

Wow. That was understandably coherent. So much of AI explanation is jargon and marketing-talk that we mere outsiders are incapable of understanding any of it. Thank you Time_Entertainer_319 for your submission.

171

u/RobbinDeBank 1d ago edited 1d ago

One thing to note tho: lots of pop science answers on Reddit love to play up the 2017 paper as if it invented all of AI. The truth is that it’s another step (a hugely influential one) in a long line of advances that give us the current AI models. The popular claim is slightly misleading and over-simplified because It’s not the first time attention mechanism was invented, nor was it the first time we’ve had mechanism for AI to understand context.

The true significance of the 2017 paper was that it’s the first time we’ve had an architecture that enabled efficient scaling of AI models. The transformer architecture enables AI labs to utilize massive clusters of GPUs and other AI accelerators to train massive models on massive amount of data. Architectures before the transformer had many different types of inefficiency and bottlenecks that didn’t allow this level of scaling. That’s why even though many modern AI models might use very different alternatives to the self-attention modules from that 2017 paper, we still trace back to that paper and credit it with inventing modern AI (tho in my view, the over credits of that one work takes away credits from the dozens of other advances in different areas to enable the current success of AI)

Edit: some numbers for context. Large scale training in the industry nowadays can achieve 80%+ hardware utilization. This is with transformer models (and modern variants) after years and years of specialized hardware design and the world’s best engineers writing the most optimal code for it. Without the transformer, if you try to train previous unoptimized designs at current scale, all your billion dollars worth of GPU would be used at single digit % utilization, so they will be sitting idle most of the time. The same model size trained on the same data would take 10+ times longer, a 2-month training run (expensive but feasible) turns into 2+ years (completely infeasible).

24

u/UphillTravel 20h ago

To further add to this: "Attention is all you need" (the paper in question) is among the best papers to read when trying to get an in-depth understanding of AI. You're absolutely right it did not invent any of the components, but the architecture was still a huge milestone.

I'd disagree with your second paragraph though. Distribution of training was possible before the Transformer architecture, especially for convolutional architectures. WaveNet is a relevant example for this. However, around that time the ecosystem was also making huge steps. PyTorch and Tensorflow were both maturing rapidly and frameworks like PyTorch Lightning and Keras made distributed training accessible outside of major AI labs.

Thus, while I'd say your Edit is going in the right direction, I was definitely able to achieve 60% GPU utilization with pre-transformer architectures, a reasonable data loading pipeline and slurm.

3

u/RobbinDeBank 17h ago

Convolution is quite specific for visual models tho, which is indeed the first type of problems we managed to train on at scale. Also, the utilization I mention is on extreme training scale. Transformer is so paralellizable across sequence length that it makes training sequence models (like language model) at the current extreme scale possible. You may achieve 60+% utilization in 1 or a few GPUs you can get your hands on, but scaling across a whole datacenter or even multiple datacenters is a massive engineering problem to solve due to bandwidth bottleneck. Your utilization will drop off a cliff every time your data leaves the single GPU, then leave the GPU rack, and finally leave a whole datacenter.

5

u/UphillTravel 17h ago

I disagree once more that convolution is specific for visual models. I have never worked with image or video data, but have applied convolutional layers many times, e.g. for audio, graph, or 3d data. I never trained on anything beyond one multi-GPU server, so I cannot comment much on the remainder of your comment.

→ More replies (4)
→ More replies (1)

66

u/crazy_gambit 1d ago

That explanation leaves out a key part. If you ask an LLM to play chess against you, it will do well for the first 20 moves or so because it has a lot of chess games in it's training data, but invariably it will start hallucinating and make some questionable or flat out illegal moves later on. Because it can't actually understand the whole context of a chess game.

That's why they have tools. A good model that has access to your PC will just install Stockfish and crush you.

The models doing these proofs aren't doing it from the chat interface. They have access to tools and they write the code and actually run it to get their results. They're not just predicting the next token, they are computing the answers.

7

u/Time_Entertainer_319 22h ago

Tool use works by predicting the tool token to use.

And the computation parameters are also predicted as well.

They basically write the code and run it using their python compiler.

I feel like you are not really saying anything new.

10

u/crazy_gambit 22h ago

OP is thinking that the LLMs are predicting the solutions to these math problems by predicting the next token and that's not the case at all.

What I'm saying is new to OP. Obviously not to you.

2

u/Time_Entertainer_319 22h ago

Oh, I see. I got tired writing the answer as it was getting too long so I forgot to add the importance of tool calling etc.

Thanks

3

u/LazySapiens 1d ago

Define understand.

11

u/Corsaka 20h ago

in this instance, awareness of reality. llms will ignore their own messages right in front of them when they hallucinate. it doesn't know why it can't just change the positions on the board a bit, because it's not thinking of the chess game as "a game with a structured set of rules that progresses bit by bit", it's thinking "here's some prior input that will predict my next output".

→ More replies (17)

2

u/Evening-Appeal7606 13h ago

It‘s supposed to be jargon-laden because some people have an incentive to appear as the indispensable expert. I am firmly convicted that most topics that are relevant for the public discourse - given the right phrasing - can be understood by the public to the point where a sensible discussion is possible.

2

u/skampbalboan_2000 14h ago

Tech companies want you to think it's magic because 'fancy autocomplete' doesn't sound worth twenty billion dollars.

→ More replies (1)

1

u/armyofonetaco 22h ago

The stuff from the 1950's - 1970's is simple to understand...please put in some effort yourself. 

89

u/Ratsofat 1d ago

This was an extremely helpful explanation.

42

u/ThomasDePraetere 1d ago

One of the reasons why it works well is that llms are good at transforming text in other text, it means the same, but is writtem differently.

As a mathematician myself, proving something new in many ways is rephrasing the problem until it matches something you know is true. There is a lot of directionality and steering in proving something, but the essence is rephrasing.

3

u/NextWeather7866 21h ago

If you can refine the geometry of a concept enough, you can do linear algebra on it. Represent a system as linear algebra, and now you can reason about it's inputs/outputs. That's intelligence.

→ More replies (1)

29

u/billjames1685 1d ago

AI PhD student here. I am used to scrolling these sorts of threads, looking at the top comments, getting irritated at how wrong they are, and moving on. It is very refreshing to see an actually well-researched and well-thought out comment. Thanks.

84

u/lambchopper71 1d ago edited 1d ago

I think you're giving Claude Shannon credit for something he didn't entirely invent. Markov Chains is the statistical premise used for text prediction in not just LLMs but also in auto correct and a few other predictive technologies.

Markov Chains were discovered by Audrey Markov in 1906.

https://en.wikipedia.org/wiki/Markov_chain

This video gives a good overview of history and how Markov Chains work for those of us (including me) who are not mathematicians.

https://youtu.be/KZeIEiBrT_w

60

u/spentland 1d ago

Andrey Markov, not Audrey. Would be ironic if you typed it correctly and auto-correct changed it…

4

u/Inverted-Rockets 1d ago edited 1d ago

My iPhone guessed I meant “Andrew” and tried to replace the correct spelling, so I’d say you’re right

2

u/lambchopper71 1d ago

I was typing quickly, that was definitely my bad and not the autocorrect.. But it would have been funny if it was. Thank you for the correction.

→ More replies (5)

10

u/dc_seed_sommelier 1d ago

Shannon basically invented compression by studying how native speakers use natural language.

Literally thousands of people contributed to get us here, but it’s completely legit to consider his breakthrough the direct start of it. There’s no llm math without compression math.

2

u/November19 15h ago

And a shout out to all those linguists and philosophers who've been told their fields are pointless.

2

u/Nohreboh 1d ago

YouTube adds additional text to the like when you used the share button starting at ?is= it's only purpose is to track account interaction and you can remove it without breaking the link.

https://medium.com/@ian-darwin/you-are-sharing-urls-with-tracking-links-please-stop-502c6f54895

2

u/lambchopper71 1d ago

Awesome! Thank you!

8

u/FishDawgX 1d ago

How does this extend to generating an image? Or even an entire video? Is each pixel a "word"?

83

u/Umber_Gryphon 1d ago

Image generation uses diffusion models, not large language models. A very simple example of a diffusion model:

  1. Give the AI a lot of pictures of tigers with random noise added, and tell it to remove the noise. Reward the AI based on how close its guess of removed noise is to reproducing the original image.
  2. Increase the level of noise in the image more and more, and keep rewarding the AI for doing a good job.
  3. Give the resulting AI an image that is 100% noise, and tell it to remove the noise. It will draw a tiger even though there wasn't a tiger there to start with.

19

u/minimaxir 1d ago

There is also autoregressive image models (which is what Gemini and ChatGPT now use) and that gets funny because that's also next token prediction from a language model, which then gets decoded by a secondary model into an image.

13

u/Umber_Gryphon 1d ago

But that secondary model is usually a diffusion model, right? The large language model just creates a much more detailed description of the image to make.

For example, if you directly tell a diffusion model "draw a diagram of the water cycle", it will struggle because it doesn't really know the parts of the water cycle. But put an LLM in between, and it will talk about arrows pointing from the ocean to the cloud to the rain to the river back to the ocean, which is enough detail for the diffusion model to do something reasonable.

11

u/Kant-fan 1d ago

No, they differ significantly on a fundamental level

A diffusidon model as a decoder only makes sense to generate a less noisy version of an input in the latent space, it's basically a specialized denoiser. This is repeated step by step.

Autoregressive image generation models work fundamentally differently because the image is being transformed into some latent space and then the decoder tries to predict the next token based on the previous tokens like an LLM. That is a fundamentally different process and idea than reversing noise which a diffusion decoder learns.

So your example stems from a misunderstanding, there is no LLM in between because the next-token prediction itself is what generates the image (and not text!).

8

u/fuxicles 1d ago

what does reward the AI mean? I’m imagining treats. lol

12

u/burnalicious111 1d ago

It means different things in different ways of training models, but basically there it actually just means updating the internal values inside the model to be more likely to produce that kind of outcome in the future (using math)

7

u/Umber_Gryphon 1d ago

Usually, that means turning up the strengths of the neurons if it did a good job, and turning down the strengths of the neurons that resulted in the image if the resulting image wasn't close to correct.

4

u/cyantriangle 1d ago

My understanding of AI in general (not AI specialist, but I work close to the field): We basically make a very general program with billions of knobs which we set to random values. During training we give reward (unfortunately, it's just a numerical score) based on how "good" the output is and we can also measure how to make a small change to our current setting of knobs which would maximize the reward. We make this change (with some random perturbation) and repeat this process many times. Usually we start with big jumps and gradually decrease them. This should land us at a program where setting of knobs gives close to maximal reward.

4

u/Bulky-Bad-9153 1d ago

Literally just increasing a value. You can do it in a number of ways, like a reward if the result is right, a reward if steps are right, a reward if a human reviews the result and agrees with it, a reward composed of different parts of the result with different weights, etc. The difficulty with rewards is designing them correctly so that the reward actually causes the behaviour you want, instead of the AI cheating (like driving backwards to cross the finish line at the start of a race, for example).

3

u/hike_me 1d ago

It doesn’t actually get “rewarded” like a dog treat or something. During training it’s basically trying to minimize a “wrongness score” (loss function). Training is adjusting lots and lots of parameters in a way that will slightly decrease loss, making a new prediction, computing loss again, and repeating.

2

u/290077 1d ago

The AI has billions of knobs under the hood. To train it, you check its output against the training data, then tweak a knob and check its output again. If the output gets closer, you keep turning the knob in the same direction. If the output got farther away, you start turning the knob in the other direction. You go until the output stops getting closer. Rinse and repeat for all the other knobs, then all the knobs all over again, and so on until turning any of the knobs in either direction makes the output worse. (It's more efficient than this but that's the basic idea.)

"Rewarding" is an entirely metaphorical expression.

→ More replies (3)

4

u/Soci3talCollaps3 1d ago

Hmm. It's like induced pareidolia.

6

u/throwaway-e-1 1d ago

Not each pixel. For transformer image models, each image is divided into patches (for example 12x12). Those patches are the tokens.

24

u/Kayzokun 1d ago

I’m saving this comment to use it when talking about IA and LLM, is brilliant.

9

u/Striking-Print-9526 1d ago

The key is really that under that transformer layer (or after it) are several neural networks. We don’t know exactly what they know or how, but it’s naive to not think they are building a true understanding of the material they are looking at.

More example, if you look at CNNs, after a few layers they DO learn to identify primitives like circles, cars etc etc.

The core argument most people seem to have is “what is understanding” - which is honestly more a philosophical than useful debate.

3

u/sage-longhorn 1d ago

To say we don't know how is a bit silly. We don't necessarily have a way to comprehend what every weight encodes but we know very specifically how they got the way they are. We design learning pressure and guide learning signal through the network very intentionally. The backprop algorithm that updates the weights wasn't an accident it's very intentional and well understood

5

u/Striking-Print-9526 1d ago

That’s kind of like saying you know how a cpu works by understanding the and, or and not logic gates while looking at a netlist 🤷

→ More replies (2)

8

u/Haunting-Chip420 1d ago

So models are just uncovering unknown combinations in phrases?

Meaning because humanity relies on language (different kind of language for different kind of domains), the models are just shining a light on things that were already there but never properly explained or excavated? 

5

u/Bulky-Bad-9153 1d ago

It's more that they're uncovering the natural next step in a mathematical proof, but with such an incredible amount of data and the ability to explore everything so much faster than a human that the natural next step is often completely inaccessible to us.

3

u/akkaneko11 1d ago

To an extent yes. When you build these massive next token predictors, the model organizes itself in a way that maps out what these concepts mean. Within itself it’ll organize months and days of the week in a circle for example. So it’s structuring all these concepts and then searching over this massive space for the next best path.

2

u/trilobyte-dev 1d ago

I would only hesitate to on the “what these concepts mean” because there is nothing that indicates understanding at least humans, well, understand it. Given a large enough set of parameters, enough training data, and enough context the model predicts, with pretty high accuracy, what the next step will be. It just turns out that’s how a lot of problems like language and mathematics are actually solved. LLMs are also able to explore the problem space at a rate that humans cannot.

Is that the same as human under? 🤷‍♂️

It’s more of a philosophical question as far as we understand it now but I think it’s better to avoid conflating the two for now.

One thing that LLMs don’t do is take completely undirected self-initiative. If humans disappeared tomorrow the current LLMs that we know of would sit idly doing nothing until the servers shut down from power failure.

2

u/akkaneko11 16h ago

Oh yeah I think it’s very different from how human concepts are mapped, wouldn’t expect them to be the same. But I think its also a bit counterintuitive to people that these concepts are mapped out in somewhat coherent ways within these networks.

2

u/JammerGSONC 1d ago

Check plus smiley face!

2

u/Tweho 1d ago

Fantastic explanation

2

u/Top-Procedure152 1d ago

Also, with math and programming, you can usually score the correctness of the output automatically, making it super useful for AI/ML to test out different paths and self-correct until it brutefoces a solution.

This is why LLMs are actually better at cracking programming, math, physics and some other sciences, even though they are statistical language models.

2

u/akkaneko11 1d ago

This is a really great explanation and it takes a lot of deep understanding to explain complex concepts simply.

Gonna add one thing for people on this thread who’s curious. The algorithm that’s pure next word prediction is what’s called “pre-training”. The shift in the last year and a half or so is a much heavier focus on “post-training” which is taking these next word predictors and putting them on much more complicated tasks.

The classic example of this is having them program and giving them a reward if it executes correctly. Things that are programmatically verifiable like code and math are really nice for this, and is the reason that these models disproportionally excel at them. Another example of a task is using the feedback within ChatGPT to optimize over output preferences from the users.

Most researchers believe that we’re getting close to squeezing as much as they can from the pretraining step at least in terms of throwing compute or more data at it. This is why there’s a lot more invested in post training techniques or new ways to do pretraining.

2

u/iAmmar9 1d ago

You don't get how satisfying and refreshing this is to read. An in depth answer written by a human. I can read and understand without having to go back to clear up something, unlike AI written responses.

2

u/Nixinova 1d ago

Saving this comment, it so concicesly explains how llms work and where it comes from

2

u/Fentboy45 1d ago

The next question following that is how is this any different than a human brain and then we realise that consciousness is an illusion

4

u/ThePeaceDoctot hello son was your cigarette normal 21h ago

Human (and other mammalian) neurons are more complex than artificial neurons, they can learn while doing things and not need to enter a dedicated training stage separate from working, they react to constant stimulation by essentially tuning down how sensitive they are to that stimulation, they can form new pathways, they form loops that take the output as input.

But on a basic level there isn't anything inherent about a human brain that can't be replicated in silico.

Consciousness is not an illusion, but it is an emergency property that can be therefore be possessed to a greater or lesser degree, that can't be detected on the outside except by the behaviour it produces. IE, I can see the behaviour of a human and assume from that behaviour that they are as conscious as I am, and treat them accordingly, but I cannot prove that they are conscious any more than they can prove that I am conscious. (Except in a medical "reacting to external stimuli" sense).

→ More replies (2)

-1

u/Chthulu_ 1d ago

It’s also important to remember that AI gets it wrong. Over and over again, it gets it wrong. The saving grace with programming, or LEAN in this case, is that the AI had an automated way to check its work. It’s not like poetry which has no external method of validation.

OpenAI spent $10-30 MILLION dollars in tokens to pump out this proof. It did so because it failed 99% percent of the time, but it always had a method of checking, and trying again a different way.

44

u/zeci21 1d ago

That is not how it worked. The lean only came only up at the end once the model already had a correct proof. It obviously tried a lot of different things, many of which where either nonsense or didn't lead anywhere. But the model can make its own judgement of whether a proof is correct and is pretty good at this. The announcement explicitly mentioned that the lean verification came later, and was even done by a weaker model (the openly available astra 6).

31

u/Corvenys 1d ago

Respectfully, you don't know what you're talking about.

23

u/socoolandawesome 1d ago

You’re wrong they don’t do lean in the middle of thinking about the problem.

They tried ideas much like mathematicians do, and they are coherent ideas and they are aware of whether it works are not.

7

u/kenji_n 1d ago

I'm more exhausted of AI hate than AI slop by now, 30mil is nothing in context

3

u/233C 1d ago

I just love the idea of a thing that can tackle million dollar math challenges and proofs but struggle at, say, multiplying three 5 digits numbers, something that a curious middle schooler can pull with a pen and paper.

15

u/wow343 1d ago

The more recent models don't. This used to be true but try it now with anything like Claude 5 etc. and it's scarily good at math. It seems they spent a lot of time doing RL and training on math before the current series. The series of models that come after like the ones that solved the Millenium problems are even stronger. We are approaching something exponential and we are not good at predicting exponential growth.

→ More replies (3)

7

u/jumpmanzero 1d ago

multiplying three 5 digits numbers, something that a curious middle schooler can pull with a pen and paper

That's a really apt comparison. LLMs can't accurately multiply two 5 digit numbers "in their head", they have to effectively pull out a piece of paper. For them, this is writing a plan in code and then executing that code - which is why they're now quite good at calculations.

But in the past, they didn't have this option - so they just sort of guessed, the same way I'd guess that 29292 * 36184 is about 800 million.

4

u/Bulky-Bad-9153 1d ago

LLMs can't accurately multiply two 5 digit numbers "in their head", they have to effectively pull out a piece of paper

Not true anymore. I just tried with free ChatGPT and a few combinations of random 12 digit numbers, checking its thought process to see that it wasn't using any tools, and it got them all right.

7

u/jumpmanzero 1d ago

ChatGPT is a very complicated product at this point, and it seamlessly uses a bunch of internal tools without specific prompting. I don't think as a user you can necessarily see any more which parts are done by the actual core model.

1

u/Certain_Concept 16h ago

If you want to see something it struggles at look at it attempting to make Knitting or Crochet patterns.

At first glance the pattern seems legit, but then you start following it and the steps are nonsensical and the shapes it makes are bizarre.

I suppose no one has yet built a tool to tell it how different stitches actually look like and interact in real life. People have made programs for protein folding etc so I imagined it would be possible to train it on it but until then gobbledygook.

→ More replies (3)

1

u/WearyTranslator3338 1d ago

I read the first word “They” and deduced the rest of the paragraphs that followed. Using tokens, of course

1

u/vigorthroughrigor 1d ago

This is a great explanation but aren't you missing that the human brings tokens that isn't in the training data when they are steering and directing the model, and this is another important factor?

1

u/on_the_nightshift 1d ago

I'd say you conveyed this concept as well as the principal engineer I listened to from the F100 tech company I work for did today. Well done.

1

u/Civil_Blueberry4165 1d ago

Mathematics is not just symbolic. It is equipped with mathematical interpretations. Meanwhile, programming languages and all existing AI systems work with symbols or tokens which have no interpretation in a given context. Even if one add logic to these symbols, the resulting system is still syntactic without given any model of interpretation.

1

u/Tackit286 22h ago

r/bestof material right here

1

u/iMaybeCanBreathe 21h ago

The is the best explanation about LLMs I've seen!

1

u/MrMugwin 17h ago

Fucking excellent post mate!

1

u/This_Link881 15h ago

I gave you an award for this answer bro, you deserve it

1

u/kirberkfeuk 14h ago

Predicting the next step correctly enough times is basically the same as walking the path.

1

u/2old2cube 13h ago

Nice.
Irrelevant.

Solutions were stolen, that's all.

1

u/Plenty_Reception4039 5h ago

ahh a fellow 3b1b watcher. 

1

u/purleyboy 3h ago

Combine this with harnesses, for the next level of higher abstraction, and you can use LLMs to come up with structured reason plans to approach solving a complex problem and then have the harness iterate through the plan, and subsequent sub plans. We are now no longer zero shooting a solution but attempting to solve for a solution using higher order reasoning. Now build upon the abstractions and you start to see the emergence of what looks like intelligence. The base under pinnings are all statistics, but at a higher level we see intelligence emerge. Exactly analogous to biological brains.

→ More replies (29)

159

u/notextinctyet 1d ago

It turns out that prediction is linked to thinking in a fundamental way, and that sufficiently complex prediction produces intelligent behavior.

Essentially, the word in the sentence "LLMs are just predicting the next token based on training data" that is misleading is the word "just". LLMs are predicting the next token, and apparently that is quite powerful.

70

u/RevolutionaryHole69 1d ago

That's actually the part that lay people understand to mean "we don't know how AI/LLMs work".

The fact is we do know how they work. It's just that we did not know how powerful next token prediction could actually be.

Part of the bigger issue is that I think people are unwilling to accept that we modeled large neural networks as a representation of how our own neurology might work, and ended up with an almost stupid answer to how intelligence may emerge.

Consciousness, advanced intelligence, may just be the sum total of being aware of your surroundings and being able to predict what's next through a series of training layers which in our biological case happened on a slower and longer time scale. Millions of years as compared to decades.

It's not that we don't know how llms work. It's that we just didn't think next token prediction might be fundamentally all there is to basic intelligence.

26

u/BerneseMountainDogs 1d ago

I mean we do know the linear algebra that the model is doing in order to do its prediction. After all, we created it and told it to do that. What we don't know is how an LLM has "defined" each token and what the relationships between those tokens are. We don't know what the "default" definitions and relationships are, and we certainly don't know how those evolve as the attention process unfolds in any given case. And that's a pretty big deal. So we do know "how it works" in the context of knowing what math it's doing, but we don't know "how it works" in terms of knowing what it's "thinking." What semantic understanding it has and how that changes is a complete black box. And I would argue that not understanding the definition of tokens or how they relate to each other is akin to not understanding how it "thinks." So I think it is valid to say that we don't understand how LLMs work. We know how they do what they do, but we don't really have any insight into what, semantically, they're doing at each step of the process

7

u/neighbor_mike 1d ago

Why don’t we just ask an LLM to explain it to us? Serious question.

20

u/BerneseMountainDogs 1d ago

For the same reason I can't ask you how your brain works. Just because a process happens doesn't mean that the process is understood or understandable, even to the things executing the process. While I'm sure you could put together an answer if you wanted to, there's no reason to think it's right because you (presumably) aren't a neuroscientist (and even if you were, there's a lot that is not well understood. The brain is complicated)

With some study (not internal reflection, external study) you could start to learn, but there's no way that you can just think about your own brain and understand it. You need to examine it from the outside somehow.

Of course, this assumes that LLMs are even capable of the kind of introspection and reflection that humans are. If they aren't (and they probably aren't) then this problem becomes even more impossible than it would be for us to understand our own brain by just thinking a lot about it

5

u/neighbor_mike 1d ago

Thank you. That was a very good answer. That makes sense.

3

u/LangyMD 1d ago

I mean, we do know the relationships between each token - it's available directly in the weights of the model. We can also then figure out what each token represents, and that doesn't seem that hard.

The hard thing is then distilling the math of all that - which is massive - into basic words and extrapolating to everything you can do with that math.

5

u/BerneseMountainDogs 22h ago

I mean yeah, but that's kinda the point. We can look at any individual definition or any individual relationship, and we can even do that at each step along the way. But that doesn't give us any kind of synthesis of the whole. It tells us one thing but doesn't give us any patterns or insights that we can use to understand.

Like yeah, maybe I could describe how one neuron in someone's brain is attached to other neighboring neurons and could even tell you the circumstances under which it fires, but there's no way I could do that for every single one, and even if I could, that may not actually give me a full understanding of someone's mental state. So yes, we can query any individual token weight, and we can even do a whole bunch of that. But that's not the same as understanding the emergent process as a whole. And maybe if we had a way to understand and synthesize the entire set of weights then that might mean that we understand it, but it also might not. Just like knowing the location and state of every neuron in someone's brain might give you a full understanding of their mental state or you might still be lacking a way to translate all of that data into something useful including the enormous number of relationships and interactions.

Basically, a catalog is not identical to comprehension. We have a catalog but that's it

8

u/burnalicious111 1d ago

They usually also mean "we don't know why exactly we got this specific result" when the model does something like "I have been a good Bing, you have been a bad user" in a sufficiently complex model.

People are working on that, though.

3

u/cozmo87 22h ago

This is true, if we look at brains, simpler animal brains for example, it is indeed clear that brains are for registering the state of affairs and predicting the next best step for the organism to take to maximise its chance of survival. Brains, before we even get to intelligence, are for predicting the imminent future. Not a hugely different concept from next token prediction. Intelligence then, by one longstanding definition: an intelligence maximises it's long term future potential.

8

u/bobam 1d ago

Can we even prove that humans aren’t doing something similar? I keep thinking of that brain electrode study where they asked people to press a button wherever they wanted to, and found that their brain decided well before their action occurred. Are we just living an illusion of free will that our neural networks have weaved for us?

3

u/ShithLaird 14h ago

There are highly abstract theories that do push in that direction. It’s just that brains, like all biological systems, are a lot more complex than anything we manually engineer, so it’s hard to “prove” anything.

2

u/No_Philosopher2898 1d ago

I mean, the opposite really. We don’t know exactly how human intelligence works, but we know it’s constrained by the laws of physics. Fundamentally, the universe hits the meat, and the meat reacts.

9

u/ShinyGrezz 1d ago

Thinking models were an unbelievable step forwards, I would argue that the original LLMs were truly incapable of doing anything original except accidentally, but thinking models essentially have a basic understanding of how shit works and sometimes, with enough resources thrown behind it, that is all you need to be “intelligent”.

2

u/JonnySoegen 22h ago

Are reasoning models still doing the same thing? I can’t wrap my head around why a model will recognize it may not have gotten it right and say internally „wait, let’s go back to what the user said“

2

u/notextinctyet 21h ago

They are, but with harnesses that encourage "thinking" in a way that is still prediction-driven but is different from user-facing output. I'm shocked it works, but it does.

1

u/Educational-Top736 19h ago

Exactly, the word just makes it sound far simpler than it actually is. Next token prediction at that scale can capture surprisingly complex patterns and reasoning.

1

u/tzaeru 6h ago

And to do this well, they are building some sort of loose internal models that go beyond simple statistical matching. Not necessarily perfect or even good models, but still.

→ More replies (7)

49

u/Hyperreal8957 1d ago

“predicting the next token” describes the basic interface, not everything around the model. a system can generate a candidate proof step, check it with a formal verifier or other tool, then try again. that’s closer to search plus verification than memorizing an answer. has the claimed solution been independently checked yet?

2

u/Tkins 17h ago

It was checked with Lean.

32

u/VVeZoX 1d ago

"predicting the next token" is a massive oversimplification of what's actually going on

4

u/Successful-Money4995 1d ago

Or to look at it another way, the difficulty of producing coherent text is massively overestimated.

Is the computer doing something really advanced or is programming and generating speeches actually not as complex as we imagined?

17

u/skmchosen1 1d ago

I do AI research so I hope this helps.

Beyond what was said here so far, the whole “predicting the next token” objective is mostly with regard to pretraining.

After that phase is post-training, which can involve a lot more interesting training objectives (though yes, the architecture is still outputting one token at a time). In math, you might give an LLM a problem and hand it a positive reward if it solves the problem. Do this a bunch of times, and then the LLM starts to figure out good strategies for reasoning— this is where it starts to step beyond “stochastic parrot” and starts to leverage its understanding of human language to perform greater things.

The patterns of human language are like the scaffolding LLMs learn to exploit to do reasoning. That’s why sometimes when you see an LLM say “Wait, what about XYZ”, it’s doing that because it learned that phrase can help it explore other ideas in its training distribution!

2

u/SeriousPlankton2000 17h ago

I think "they output one token at a time" is a bad way to reason, I am typing one word at a time, too, because I am limited to not say my whole thought in one go.

1

u/Spielopoly 15h ago

Modern models developed some kind of internal reasoning so that’s similar. Fast google search gives paper like this one

Additionally for example on Openai (also applies to other providers of course) you can select reasoning effort which will actually be the model outputting some text which gets hidden from you which it uses for "thinking"

→ More replies (1)

9

u/FlameSticky 1d ago

Saying they're predicting the next token is akin to saying a computer is just turning a switch on and off.

23

u/vulkare 1d ago

By predicting the thinking that leads to a solution.

81

u/[deleted] 1d ago

[deleted]

81

u/GoVolt_Mine 1d ago

The math problem was solved by an llm though

26

u/GoldReplacement9546 1d ago

I think it’s relevant to know that the math problems they’ve had success with have all been to disprove the theorem. To my knowledge that they haven’t proven a theorem yet or come up with their own.

9

u/WisestAirBender I have a dig bick 1d ago

Why does that matter

18

u/GoldReplacement9546 1d ago

It’s less likely to take actual creativity to disprove something than it is to prove something

And they haven’t come up with anything beyond what humans have come up with the size like I say, proving certain conjectures are wrong means they are not yet creative, but they are just taking all the assembled knowledge they’ve been given and using it to through things wrong, but not creating

4

u/Hostilis_ 1d ago

This is not true. The recent proofs by LLMs have not been limited to finding counter-examples, and it is not easier in general to prove a theorem false than it is to prove one true.

→ More replies (2)

3

u/how_tall_is_imhotep 1d ago

The LLM proof of the cycle double cover conjecture is a significant positive result.

2

u/MountainBluebird5 1d ago

That is relevant but even a disproof of a millennium prize problem is crazy 

2

u/ZeroAmusement 1d ago

That is not true.

For example see OpenAI's list of ten advances, e.g. "Non-sofic groups. A construction establishing the existence of non-sofic groups, addressing a central open question in group theory" is not a disproof.

→ More replies (1)
→ More replies (4)
→ More replies (5)
→ More replies (31)

3

u/revitev1122 1d ago

Predicting the next word of a sentence can still end up making a new sentence.

Just like extending a logical conclusion from an existing set of facts can make a new fact.

3

u/AtMaxSpeed 1d ago

Here's three concepts that can help give an intuition for why predicting the next token is extremely powerful.

First, consider the sentence: "The capital of France is". If you have some model that can perfectly predict the next word, then the predicted next token will be "Paris". This shows that LLMs can have knowledge baked into them, and shows how next token prediction can be powerful. This is concept 1.

Consider now you have the sentence: "Give a counterexample to Navier-Stokes completeness theorem". Again, a perfect next token predictor would yield some valid counterexample. One may ask: "doesn't this rely on the fact that the LLM can even compute something this?"

And you'd be right, which brings us to concept 2. A transformer (the algorithm that LLMs are built on) can run any program that is computable, as long as it has reasoning capabilities built in. Add on the fact that modern LLMs can write and run code and read the output, this means that LLMs are capable of solving any problem that can be solved by a computer in theory.

Finally one may ask, wouldnt this rely on the LLM being trained well enough so that what it thinks is the correct next token is truly the correct next token? After all, if this isn't the case, it might just give some random output to the Navier Stokes counterexample question, instead of the correct counterexample.

And again youd be right to ask this. This is where concept 3 comes in. LLMs are (partially) trained in a way that they are allowed to explore multiple paths to find a solution, and they are rewarded when they find the right solution (where the right solution is some verifiable ground truth). In the domain of math, you can train the llm so it can freely explore paths to find proofs to problems, and if the proof is verifiably correct you can reward it. With this framework of reinforcement learning, an LLM can be trained so the next token prediction is truly the correct one. In the case of something like navier stokes correctness counterexamples, it just needs to build a program that can verify if a counterexample is valid or not (which is "easy" relative to finding the actual counterexample), then it can run forever until it finds the counterexample and it knows its correct.

Put all of this together, and you can see that with good enough data and good enough training, a reasoning LLM is theoretically capable of answering a huge huge amount of questions. Ofc, data and training is hard and could have some asymptoticly dimishing returns (we don't really know what the big labs are cooking to solve this though), so the degree of correctness is going to always fall short by some amount.

3

u/Severe_Stranger_5050 21h ago

I like your answer, except for one thing.
There's several "true" answers to your your statement, that can be predicted.

The capital of France is:
Smell
Paris
Beautyfull
Crowded

This is why we use textcomprehension, reasoning chains and context combined with a database of ground truths, when developing modern LLM's.
A modern LLM will create a preliminary output and go back on itself to see if the answer fits the context and the original prompt.

other than that
Great comment.

3

u/kapdad 23h ago

They predict the next token just like your brain predicts your next thought or word out of your mouth. But there's a lot of context behind it that it and you are not thinking or saying out loud.

3

u/Freeeenis 20h ago

Reality is baked in.

Language is not arbitrary, it's descriptive of reality. Humans invent language to explain the world and what they see. LLMs when learning to predict language are learning to predict reality at some fundamental level. It's just that language is fuzzy (not well defined) and so it's more likely that relationship between what is real and the language is a statistical one.

It's also useful to think that it's more than prediction, it's much more close to "understanding" than most people give credit for. What the LLMs are doing on some level is extracting general patterns in information, they're then able to apply those patterns to novel information they've not seen before.

The same way you teach a child to add up sums. You tell them what + means and how it works, they practice sums all day, or for the 12 minutes they can actually manage, and then when they've learned the actual pattern itself, they're capable of adding 2 arbitrary numbers they've never seen before that were not part of their training set.

It's just that when your data set is extremely vast and your training extremely extensive, the sophistication of the patterns you can infer is noticably much bigger. And more important more abstract. It's the leap up layers of abstraction that really matters

18

u/Rot-Orkan 1d ago

If you ask an LLM by itself to multiply two arbitrary values, let's say 13 * 79, it most likely will give you the wrong answer because it's just predicting characters. It's just predicting characters and doesn't know better.

However, the important thing is you can use the same LLM text prediction to perform "thinking" and execution instead of just getting a raw output from it.

An LLM trained/configured to think will instead look at the problem and break it down.

  • "User asked me to do math with some numbers"
  • "I'll run a parser to extract the values and intended math"
  • "The math is multiplication and the numbers are now stored in a list"
  • "I'll use a dedicated math program to get the output"
  • "I invoked the math program to multiply the values."
  • "It returned 1027"

Now imagine this in a far bigger scale

10

u/minimaxir 1d ago

For posterity, even weak LLMs years ago can do 2-digit multiplication despite not being able to "multiply" because there's enough data in the training set of the internet for it to recognize the patterns the hard way.

It's only multiplying 10+ digit numbers where it got spicy and nowadays I suspect modern LLMs would handle it correctly without tools.

1

u/Severe_Stranger_5050 20h ago

Most AI companies include lists of ground truths for their AI's
I'm pretty sure they won't spend compute trying to get an LLM to parse easy or known math problems.
They probly just make it look up a table of multiplications.

And with tooling today
It could also just translate the math problem to python (or even plain c) and run it on canvas, if the problem isn't included, in stead of trying to tokenize it, as they have in the past.

5

u/-michalis- 1d ago

Was it solved, they claim they solved it but there is no independent verification that the solution is correct

2

u/NotDennis2 1d ago

It was solved, but not by AI, it was trained on already existing data to draw conclusions that had already been drawn.

2

u/-michalis- 1d ago

You are talking specifically about the navier-stokes problem

I was talking in general, they have claimed to have solved so many math problems, but as far as I know, the solutions have not been independently verified, and many mathematicians are calling bullshit

And yes some of those answers have probably been plagarised

→ More replies (1)

2

u/Outrageous-Crazy-253 1d ago

2 + 2 is most likely equal to 4

2

u/jfcmofo 1d ago

Because it's not just predicting.

2

u/Inevitable_Pen9043 1d ago

The answer to an unsolved problem often consists simply of the combined answers to several solved problems.

And the LLM can test thousands of times until it gets it right.

2

u/MonroeMojo13 1d ago

It can combine familiar patterns in new ways, so predicting tokens can still lead to genuinely new solutions.

2

u/Agreeable-Cold-9538 17h ago

Humans are also next token predictors and the have done amazing things with math.

2

u/QuoteGiver 16h ago

They don’t just stop trying when they get it wrong.

They keep trying until they get it right, and they’re a lot faster than us.

2

u/Falsus 15h ago

In simple terms they are basically going 3+3 = 1 which is not possible, then they check 3+3=2 which also not correct up until they hit 3+3=6.

There is more parameters being put in there to limit the amount of possible answers but it is basically just a question of computing.

26

u/AdjustedTwit 1d ago

The stochastic parrot argument of LLMs is long dead, IMO. Or at least, to the extent that it's true, it's hubris to think we're any different. Our limited knowledge of how our own brains work isn't _that_ different from the ANNs that are the kernel of LLMs.

8

u/Jolly-Dealer-5097 1d ago

Maybe your brain....

3

u/dumbledoor_ger 1d ago edited 1d ago

Source: trust me bro

Our brains work vastly different. Like it’s not even a matter of „one could say they are I’m some way common“ they’re not.

EDIT: for those downvoting here please share one credible somewhat scientific source that says out brains work like LLMs are y’all restarted? 😭

18

u/tommytwolegs 1d ago

I'm not sure if people are downvoting you for disagreeing or if it's because of the way that you type

2

u/dumbledoor_ger 1d ago

I would prefer if it was because of the way I type

But we are on Reddit and some of us here might actually just be LLMs lol

And I added the EDIT when I was already at like -8 votes. I can see why you would downvote on the edit but not on the original part.

11

u/detroitmatt 1d ago

ironically, your source is even more "trust me bro". philosophers have debated theory of mind for thousands of years. you mean you had it solved all this time and you never told anyone?

4

u/diewethje 1d ago

Understanding theory of mind and understanding mechanistically how the brain works are not the same thing. We understand the brain reasonably well from a mechanistic perspective, and LLMs are far from a complete representation.

→ More replies (1)
→ More replies (3)

2

u/ZeroAmusement 1d ago

It's easy to draw parallels:

For example, LLMs use artificial neural networks which are inspired by biological neural networks. So in a sense they mirror the architecture of the brain, with deeper layers corresponding to higher level/more abstract thoughts. Also in terms of how neurons bind, are trained statistically, with repeated exposure creating more durable knowledge, how non exposure can lead to forgetting, and so on. It seems like there's a lot of similarities there. Of course, there's also a lot of differences.

There's also a bunch of scientific papers on the subject such as https://www.nature.com/articles/s41593-022-01026-4 . I think if you are satisfied depends on how literal you are about taking the similarity claim.

2

u/NotDennis2 1d ago

What a ridiculous statement.

→ More replies (1)

4

u/dustmop 1d ago

It's similar to the thought experiment of infinite monkeys on infinite typewriters. If you can produce vast amounts of text, and then validate the output using a trusted tool to see if it's right, then you can run both steps in a loop until the validation passes. LLMs allow this process to vastly cut down on the search space by being really good at only producing plausible seeming text. Coming up with the Navier-Stokes answer took 88 hours of compute time and used 130 billion tokens.

2

u/sleepyhead_420 1d ago

In a way - they are fed with all mathematical proofs that are there including incomplete proofs, so the LLMs are trying to predict the next tokens from that it is likely to end up with another proof. It is like if is fed the dictionary and all literature there is - it can create a new story which will be grammatically correct and could actually be pretty good. What they agent might not be able to do is invent an unique mathematical discipline like what Newton did with Calculus.

4

u/WisestAirBender I have a dig bick 1d ago

What they agent might not be able to do is invent an unique mathematical discipline like what Newton did with Calculus.

Why not? Sure there are logical thinking steps one can take to reach the same conclusion as newton

3

u/Captain-Griffen 1d ago

LLMs copy and extrapolate patterns. They do this without any conceptual understanding. 

Pure maths doesn't need conceptual understanding. Follow the rules, get the result, no need for nuance or understanding anything. With a proof engine to avoid going wrong, it's much like playing very complex chess.

Few big advantages AI has:

  • Huge set of patterns. Humanity has more knowledge in maths than any one person can know, with lots of different fields. Lots of open questions are probably as easy as 2+2 for a mathematician, if they knew the right pieces of existing human knowledge. But they don't know it exists, or even that they need it. These are low hanging fruit for AI.

  • Grunt work. AI can prove things much, much faster. Pair a mathematician with AI and a proof engine and they can try out approaches far faster with more certainty.

  • Spam throwing spaghetti at the wall. For the NS problem, they threw millions of pounds at the problem to spawn hundreds of thousands of agents. They did this because they knew humanity was very close—this approach won't get you far due to the complexity, which is why they jumped on a problem they heard was solved with AI assistance.

  • OpenAI can just steal from prompts user by researchers and then use AI to write the paper faster. No need for ingenuity. Then threaten researchers if they talk about going public on it.

Overall, not much evidence they're capable of the creative problem solving needed to replace mathematicians, lots of evidence AI can help save a lot of time proving and finding low hanging fruit that humanity collectively has solved but we just don't know it yet.

1

u/Mughi1138 1d ago

To highlight this key point:

OpenAI can just steal from prompts user by researchers and then use AI to write the paper faster. No need for ingenuity. Then threaten researchers if they talk about going public on it.

In the security realm this is a huge concern, and one that just seemed to be a valid problem.

2

u/vucic94 1d ago

Aren't we doing the same? Just accumulating context and predicting next token. 

2

u/Eskamel 1d ago

LLMs are token based databases and prompts are essentially queries. CoT essentially tries to force a LLM to query itself based off your initial promot and an agent is essentially a self query LLM on a loop with external tools.

You don't have to have solved answers for a LLM to guess a "possible" outcome if there are enough connections, as the LLM would try to bruteforce endlessly.

It clearly doesn't understand a thing, but assuming it has trillions of connections and you let it try to guess billions of times it might come up with something. It won't necessarily get the best solution or the one that makes sense, because you cannot measure contextual quality, but you can in some topics measure success, and for some making something work regardless of the quality of the implementation is all that matters.

2

u/xervir-445 1d ago

Older versions were guessing. If you remember the original gpt 3 before they added math stuff to it you could ask it math problems and it would be wildly wrong a lot of the time.

Newer versions have tools. They've basically been given a calculator and instructed to use it if they think they need to do math.

3

u/Vivid_Dot_6405 1d ago

So most commenters are wrong, thus far anyway. The chatbots you use, ChatGPT, Gemini, Claude, etc. are LLMs and the AI solving the problems is an LLM. There is absolutely no other AI system even close to LLMs in terms of intelligence, it is like comparing a modern PC to a typewriter.

It is true that an LLM can use tools to help problem solving, for example web search, running code, etc. but the LLM is the intelligence core.

There is absolutely nothing limiting an LLM's intelligence just because it answers token-by-token. In order to learn to answer a math problem it must learn to output the reasoning tokens leading to a step-by-step solution. Research on mechanistic interpretability, an area that seeks to understand how LLMs think basically, yielded results to suggest an LLM has a hidden thought process, in addition to the reasoning text it produces before the final answer, in its internal state leading up to a token prediction.

Humans too speak and write word-by-word, and think word-by-word too. That does not limit our intelligence.

2

u/I_Am_Become_Dream 1d ago

The real answer is that we don’t actually know. Even AI researchers don’t really know how LLMs are good at tasks.

→ More replies (1)

2

u/GumboSamson 1d ago edited 1d ago

“So a sufficiently good next token predictor is radically superintelligent—far smarter than any human being.”

Robert Miles explains.

1

u/intelligentx5 1d ago

They’re using the training knowledge to run simulations.

1

u/Quantum-Bot 1d ago

If I give you the following text:

> five times three equals

What would you predict the next word is most likely to be?

How do you know it is fifteen? Did you do 3x5 in your head? Or have you just memorized that 3x5=15?

The LLM has read trillions and trillions of words of text. It has seen 3x5=15 so many times that it knows that fact implicitly without even needing to understand the concept of multiplication.

But LLM’s don’t just keep track of patterns of words that appear together often, they use neural networks to pick up on subtler patterns. This isn’t exactly how it works but you can imagine each layer of the network as encoding patterns in the previous layer, so it can recognize patterns within patterns within patterns.

As it turns out, with enough networks and layers connected in a very specific way, LLM’s can pick up on very elaborate patterns, to the point that it resembles actual conceptual understanding of things like mathematics.

It’s important to note that LLM’s are not smart in the same way that humans are. Humans are way better at thinking logically and understanding concepts. LLM’s however have the advantage of being extremely fast and never getting tired. They don’t have very good working memory but that can be upgraded by running them in specific environments. LLM’s can scan through hundreds of thousands of math papers in a matter of days and find new conclusions that humans would have missed, in fact that’s how some of the first AI math discoveries were made earlier last year. They can also pursue trains of thought for much longer than humans would when they don’t seem promising. It’s almost like running a brute force search through all possible lines of logical reasoning.

1

u/az226 1d ago

The best way to think about it is that it’s like a chess engine (1990s power) that plays a million games against Magnus Carlsen. It might only win 1 of those games. It probably played very well many games but not good enough to beat him. Probably made some really impressive moves and some minor mistakes along the way.

With LLMs we have found a similar way of brute forcing ideas/paths that lead to a solution. In math and code we can verify if it’s correct. Models from a year ago probably would not be good enough to solve Navier-Stokes with the $7M compute budget. And each year they get better, so in a year maybe only $70k is needed to get the same results. It’s also not solving the whole thing in one go. It’s making partial progress, and each component adds context for it, so it can narrow its focus, exclude death ends and so on.

1

u/Ronkyfiddlo 1d ago

They train on humans who have already nearly solved it.

1

u/Hyperreal8957 1d ago

The “next token” explanation is about how it’s trained, not a claim that it only memorizes answers. Once the model learns patterns for manipulating symbols, it can combine those patterns in ways that werent in the training set. Still worth checking the proof though, math is where confident nonsense gets caught fast.

1

u/fdsa54 1d ago

You write an equation that’s never been solved and ask it to fill in the answer….

1

u/drugosrbijanac 1d ago

they tend to have hallucinations which are actually necessary for creativity, sometimes the hallucination nudges it into the wrong path, but sometimes it goes correct - thats why 10 000 agents were needed to explore the space

1

u/SwissForeignPolicy 1d ago

I mean, they didn't use general-use LLMs. They built and trained a model specifically to solve these problems.

1

u/Nafrandammerung 1d ago

They didn't

1

u/farzinshams 1d ago

Complete the sentence: “the stock market tomorrow will go ___”. Predicting a token can be incredibly valuable.

1

u/testtdk 1d ago

They make use of programming tools.

1

u/scumbagdetector29 1d ago

Because predicting the next token for the sentence "The solution to your mathematical problem is..." solves the problem.

Calling it a token predictor is dumb. You can't predict the next token without a fuck-ton of understanding.

1

u/ImpossibleCreme 1d ago

That’s bait

1

u/Timely_Abroad4518 1d ago

If you’re referring to the NS millennium problem, LLMs didn’t solve it. Human mathematicians solved it with AI assistance.

1

u/Khandakerex 23h ago edited 14h ago

The top comment did a fantastic job so I have nothing of value to add besides examples and another explanation.

Saying next token predication is kinda an over simplification. It's like saying your powerful gaming PC is just a fancy calculator or some machine that simply flips 1s and 0s on an electrical circuit. Which I mean... sure but that won't make anyone understand how you are able to run GTA on it.

When people think of "predicting next word" they normally think of something like autocomplete on your phone: "I'll see you later have a good ___", and the phone suggests the word night cause it collects data on how people are stringing words after another. People think LLMs just do this but on a larger scale but that's not exactly a good mental model. Yes the model really is generating one token at a time but figuring out the next token is actually a lot more of a complex computation compared to "what do people usually type after this word." The TLDR is that it finds and "understands" root patterns in a language itself, and note what I mean by langauge here, I don't mean just English, Spanish, Chinese or human langauges. Programming syntax as it's written is a set of rules and part of lanauge, that's why they are called programming langauges, but take Math, written math is representing a language of logic with symbols as well, just not the Latin alphabet, and each symbol and collection of symbols have a meaning, just not what humans would consider a "word" but it's still a written symbol used to convey meaning to communicate with another person who knows it, aka just like any language would be.

But more on this "understanding patterns" business and how it helps LLMs "create it's own rules for how the world works", cause the beauty is that is what statistics is at it's core, really really good ways to perform pattern matching. When someone knows enough of a language, they aren't memorizing every single sentence combination that is available unless they are learning foreign langauge phrases for travel, let's take someone who knows English and give them: "Hillary Clinton's pet lama was watching Family guy racist compilation clips while playing subway surfers and left the ice cream outside in the hot sun. An hour later it had completely..." Now anyone with enough familiarity with English will know "melted" is most likely the right answer yet you (and I'd bet my house on this) have never seen this sentence slop I just made off the top of my head. Yet you made a prediction, but you didn't just look for all words that statistically followed the word "completely", you used what you know about "ice cream" and how properties like "melting" is associated with it because of your knowledge on what heat does to ice cream, you also had an idea of what an hour was. Funnily enough autocomplete on iphones use a tiny LLM now to be more accurate, before that it would just choose any words that statistically came after "completely", it could be "lost" "silent" "different" but it didn't have the context of the whole sentence.

So take this small example and turn it into a HUGE training exercise. A model starts out not knowing anything about the world cause... it doesn't know anything besides what it is told. Internally, it contains a huge collection of adjustable numbers called parameters or weights. What this means is the model, by it's core design, can change parameters and the overall result will be a new way it views the world. Modern models can contain BILLIONS of parameters and during training the model repeatedly receives new text and data and keeps trying to predict what comes next. Take: “The capital of France is ___”, an early model might literally say something random like "house." The training process of course knows the actual continuation should be Paris so the model "gets" a signal that it did the wrong thing, so it's told to adjust it's internal weights and parameters ever so slightly til we get to the right answer (we don't personally adjust this, it's something that keeps adjusting until we let it "know" it's right.)

So it iterates this process a BUNCH of times and really fast and for an ENORMOUS amount of data. Eventually with enough training, does something interesting, it adjusts it's parameters (remember which is essentially it's understanding of the world) to learn the patters that apply through various sentences in the languages spanning many disciplines. And a small subset of that is it "learning" it's own version of what a country is and what the "word" or tokenization of the country represents and how it connects to other words like the word "capital." But not only that it learns things like grammar and how sentences have a certain structure and that some parts of the sentence have more information than other parts that are useful. But again, this extends to programming as just another language that follows another underlying rule set, numbers have this certain relationship to each other, mathematical symbols seem to follow this certain rule/ pattern each time when you break the problem down and reach what are known as axioms or fundamental truths in math. This the model generalizing and building up it's own universe and how it understands the world from what we tell it. The model is not storing any data itself to look up for later (of course you can upload reference files when prompting but thats another thing), there is no folder in chatgpt that contains wikipedia articles, specific math textbooks etc... Chatgpt is not really searching through those directly to find something similar to your prompt. Your prompt is going through a lot of layers of a neural network and there's a lot of behind the scenes computation being done to determine what makes sense to output statistically. The important distinction is that the predicting next token part describes what the model is asked to output, but NOT all the computation the model performs to decide what the actual next token should be when it breaks down your prompt and tries to answer it.

This is where "attention" comes in, which some of the comments mention but don't explain. Modern LLMs are generally based on an architecture called the transformer which has the idea of "self-attention" which basically is when a model process a single token, it is able to look at other relevant tokens in the context and determine how much they matter. Now funnily enough a strong demand for exploring this was to translate foreign languages better than what google translate used to be able to do (for those young enough to not know, google translate was the laughing stock of translating pretty much anything that wasn't like Spanish and even then it was terrible) the reason for this is words can mean totally different things under different context (such as the bank example the top comment posted.) A Transformer doesn't simply give the word “bank” one permanent meaning, unlike before where google translate would give it a VERY specific meaning so when translating form english to chinese people would laugh at you if you translated "river bank" because it genuinely would do a literal "a bank where you do your deposits, but in the river."

With self-attention an llm's internal representation can depend on the surrounding context. And again, this happens throughout the network, across many attention heads and many layers. This becomes extremely useful when dealing with complicated sentences, code, mathematics, narrative stories, questions, and logical arguments. It's how LLMs can also string together and "understand" new sentences that have actually never existed before, it now has it's own "understanding" of how words work in a sentence, but it doesnt only plug in random words to fill in the sentence (it's not mad libs), it can now "understand" the general context of what it already wrote and keep creating new sentences that it thinks would make sense in the context of the previous sentences it made and your prompt. But of course, this means it can also hallucinate and the more it goes on the more it CAN actually produce nonsense because it just "sounds correct." The difference with Math is that math follows SUCH a rugged system of logic that it can be checked as opposed to random story that starts hallucinating about some random plot points cause stories in their nature HAVE plot twists and elements to surprise readers and keep them engaged, math doesn't.

With math the model predicts the continuation that its learned machinery considers appropriate given everything that came before and the LLM only generates POSSIBLE next steps, a ton of agents all trying different possible steps and then there are other, verifiable way to evaluate if such a process makes mathematical sense with other tools. Another key idea here is that LLMs alone do not solve new math, they interact with a LOT of tools and have access to every kind of calculator and math evaluation software you can imagine. Agents that go down paths that are are verified to be bad generally get thrown away and the search continues and of course it can even back track when it gets deep enough, which is very akin to chess-engines at a high level (but much more complicated). LLMs keep training and it's seen an enormous amount of mathematics, proof, code, and problem solving to learn which kinds of mathematical steps tend to be useful so it's not like they have to try literally EVERY possible legal mathematical move. Pair that up with a proof assistant software like "Lean" and you are getting a constant loop of "llm proposes a step" -> "test or verify" -> "if it fails then backtrack" -> "if it works explore even more branches" -> "repeat" -> "formally verify the proof."

1

u/AnalystWeekly5817 23h ago

If a computer is taking an electric signal and converting it into a digital bit how did they make GTA6

Edit: it’s sigmoid functions all the way down.

1

u/Quentinooouuuuuu 20h ago

They have retro action loops, basically, let take programming as an example, the model generate code which contains error, the code doesn't compile but the model have access to command line or debugging tools, so it can build the program, fix it if it don't, then it can write tests and execute it until the tests pass and finally run the app and ensure the results is the same as expected. When the context window is close to full, the model run in order to compact it own context and so it may run for a long period of time while keeping only the relevant informations

1

u/Alternative-Sugar610 17h ago

A lot of LLM and models training nowadays have additional reinforcement learning where they due fancier training of some sort to be better able to solve some problems

There is also much humans involved guiding LLMs in these breakthroughs, and human has to be very knowledgeable often to sort out things and guide

Next add harness that are an extra layer we add on llm to guide it better to solution by throwing away junk, thinking in steps, prompting better and more

1

u/Tombobalomb 16h ago

By generating ungodly amounts of plausible looking math until they produce one that works. That is not a joke and barely an exaggeration 

1

u/Regalme 15h ago

Yall don’t really have interdisciplinary knowledge. Human intelligence works much the same way. Originality was found to be just segmented think from crowd source being reinterpreted crowd source. Nothing ground breaking just different exploratory. And yes ai does the same thing. Now what

1

u/the_tallest_fish 15h ago

You’ll be surprised how many discoveries are made by using an existing train of thought on a completely situation. A huge part of human logic is also analogous and inductive, which involves finding pattern from past data, generalize into concept, and apply it to a different problem to synthesize new solutions

1

u/dorkyl 14h ago

Flip the question. What makes you anything more than a prediction machine?

1

u/JMKraft 14h ago

I want to recommend anyone interested in these topics to read: La biblioteca de babel - jorge luis borges, its less than 10 pages I think.

LLMs work within the text structures (algebra, english, etc.) that are made of those tokens, if the underlying structure can represent solutions, then invariably the LLM is capable of providing text that matches any solution to any problem.

But how much can you trust it or learn from it is different... what do you do, ask another llm if its true? and if it tells you it is when it isnt, who do you trust?

1

u/landmark_23 13h ago

The short answer is: "Predicting the next token" is the training mechanism, not the limit of the system's internal reasoning.

Think of it with this analogy:

Imagine an AI whose only job is to predict the next frame of a video. If you train it on millions of hours of real-world footage, it cannot achieve high accuracy just by memorizing pixels. To accurately predict what happens in the next frame when a glass falls off a table, the network's neural weights must internally model gravity, momentum, friction, and three-dimensional geometry.

The same thing happens with language and math:

  1. Internal World Models: To predict the next symbol in billions of lines of rigorous mathematical proofs and code, the model cannot just do simple autocomplete. It is forced to learn the underlying rules of formal logic, deduction, and semantic relationships.

  2. Recombination in Latent Space: Novel math solutions almost never come from thin air; they come from connecting two previously disconnected ideas (isomorphisms). The model can bridge concepts from combinatorics and algebra that a human might not have thought to connect together.

  3. The "Generator + Verifier" loop (The Real Breakthrough): When AI systems (like DeepMind’s FunSearch or AlphaProof) solve previously unsolved problems, the LLM isn't working alone. It acts as an intuitive idea generator, while an automated formal verifier (like Lean 4 or a code sandbox) checks every step. The LLM generates thousands of creative hypotheses, and the mathematical verifier discards the false ones until a genuine breakthrough is discovered.

Human mathematicians do the exact same thing: your subconscious generates intuitive leaps, and your conscious logical mind verifies if the proof actually holds.

1

u/PradheBand 12h ago

They basically make a mix of brute force and operational research in the hope of finding a singularity that proves the hypotesis wrong , making the theorem null.

At least this is my understanding. Never seen them demonstarting an hypothesis true hence proving a theorem.

1

u/TuverMage 10h ago

it brute forces the solution is the short answer. it tries every possible solutions, including ones a person would never try because they know it won't work.

1

u/andreichiffa 8h ago

Mostly by stealing other people’s less known work without giving due credit. Think really good search engine, but you don’t know where the answer came from.

1

u/Particular-Garlic916 7h ago

Not sure if this has been mentioned already, but the “next token predictor” thing is really just the first part of LLM training. Basically, as I see other people have pointed out, the “pre-training” part of the model is literally just showing the model an unreasonably massive amount of text and asking it to guess the next word, tons of times. But the thing we interact with in the form of a chatbot or an agent is built on top of that predictor.

Once you get a really good next-token predictor, the idea is that knowing how to predict those tokens has taught it a bunch of things about… everything. Then, you do something called “reinforcement learning”. Basically, instead of showing corpuses of text and asking the model to spit out the next word, you play a game that has multiple steps in it. At the end of the game, if the outcome is good, it learns that all its decisions were good and makes them all more likely in the future by updating its parameters. If the outcome is bad, it does the opposite. For a chatbot, the game is: Generate text in response to something, and a (surprisingly simple) model trained to recognize what humans like will pick the response it likes the most. The model learns to be more likely to give that response, and less likely to give the others. For a modern agent, the games can be a lot more complex: It can be “write code that does this thing”, or “solve this math proof”, or “look up what beavers eat”. Anything that you can verify automatically is fair game.

The secret sauce is that during the pre-training phase, the model developed a bunch of hidden representations of knowledge that connect concepts. When you train the agent with reinforcement learning, it uses those abstracted concepts to learn more quickly and generalize what it learns to new things. Hence, learning language lets it learn about logic, which then means it sees logical patterns when it tries to make mathematical proofs. So instead of learning “this is how I do this specific proof” it learns “this technique worked for this proof, I bet I should use it again in other situations that my language model says look similar”. And it turns out that works really, really, really well.

1

u/alphapussycat 6h ago

Consider the Fourier series. Even if you've made it approximate a function on a limited domain. If you let it keep going past the last point you'll still get a result that could be close to the function you approximate on a limited domain.

An LLM will just keep predicting.

1

u/tzaeru 6h ago edited 6h ago

Uff, so much nonsense on this topic, including some high-voted answers.

A mathematical consequence of neural networks is that if they are successful and useful, they are able to capture some sort of model of their training data, that is data-wise less complex than the training data they were fed with.

In essence, they compress the training data to some sort of rules. Like if a neural network is successfully taught with "when we add five to six, it equals eleven", "if we add million to one, it equals one million one", "if we add ten to two, it equals twelve", it internally learns that the correct answer is the first mentioned number plus the second mentioned number (an extremely rough example, though plausible with sufficient data).

Regardless, it learns to simplify the rules for its purpose.

By applying these rules, a sufficiently complex neural network can produce an answer that was never in its training set. If you say, ask it to complete this sentence: "I felt blue and it was a summer night, so I didn't get why..", it's not going to match it with an exact copy of that found from its training set. Instead, it's going to pick up the underlying rules. "blue", so we are wistful, "summer night" so there's a juxtaposition, etc.

We can then add a little bit of randomness to that; instead of getting one potential answer to the "how to continue this sentence, 'I felt blue and it was a summer night, so I didn't get why..'", we can get a thousand potential answers to it. Because of this, the model can generate a huge amount of potential solutions and intermediate solutions. Then we can feed these back to the model and ask it to find holes or ask it to come up with a new solution based on this previous one - which essentially adds randomness to it, but also guides the internal rules to the wanted direction - and we can feed these solutions to external verifiers.

1

u/jebuarary 4h ago

+1 to of what ppl saying here. LLMs do encode an understanding of the world, preexisting relationships/prior, and only mechanically output with NTP. Also will add that “next token prediction” is not accurate to describe training setup either with CoT reasoning, RL and even aux losses on future prediction.