logoalt Hacker News

“Next-token predictor” is the wrong mental model for LLMs

96 pointsby garrinmyesterday at 5:09 PM220 commentsview on HN

Comments

sreekanth850today at 4:52 AM

I'm not a medical expert, Human brain also doing similar prediction if I'm not wrong, Also, people those who talk about the deterministic nature, LLM doesn't need to be deterministic, infact our brain is not deterministic too. its the harness and the tools that use LLM should be deterministic.

Systemerror7A69yesterday at 7:28 PM

To be honest, I believe I get the point the article is trying to make, and to an extent I agree, but I also think the point is not really made very well.

The core of the argument as I understood it is that LLMs aren't just using existing data is training but also new ones. That's fine and good, and you can't simply assume an LLM is simply mashing together all it's data to give you an average of all that got fed into it - but at least I would still call it a "next token predictor"

It's not using just training data, but what it's doing is predicting the next token to get to the solution. As far as my amateur knowledge goes, LLMs still roughly go token by token, deciding which one fits best given the context.

It's just not predicting based on it's training data, but predicting based on RLVR & more, trying to get to the optimal solution ( as much as the solutions CAN be optimal)

And I honestly think keeping this very much in mind is helpful in understanding and dealing with LLMs.

show 6 replies
bluegattyyesterday at 7:32 PM

'next token predictor' is a limited mental model but it's actually much better than any others.

'pattern matching' is a better intuition that 'reasoning' even though I think nominally, using the term 'reasoning' is perfectly fine in that context. It's just a loaded word that brings too much to the table.

'It hasn't seen the pattern' is a better description of the limitations of AI because it really just doesn't generalize very well at all. The adaptations described in the article don't change that.

Those are mutations, not expansions of capability.

show 1 reply
mofeienyesterday at 10:26 PM

Describing it as a "next-token predictor" in the sense that this would mean it's fundamentally limited to just a fraction of an inferential step is doubly wrong:

1. In order to select even the first word of a meaningful sentence, it already has to have structure and meaning of what follows captured somewhere inside, mostly in it's weights/activations or indexed by it's state vector.

2. What you see when you use an LLM is not next-token prediction directly next to the prompt, but instead following a block of varying length of next-token prediction that happened to make progress on the problem in your prompt, and which just summarizes the results.

show 3 replies
Planktonneyesterday at 10:11 PM

I'm not going to stop describing things accurately because someone generated an article that continually undermines its own main point. Limiting the way we talk and think about LLMs to a very narrow set of terms doesn't help us.

EDIT: gentler phrasing

show 2 replies
seba_dos1today at 4:12 AM

> So while a post-trained LLM still has the shape of a next-token predictor, emitting tokens one at a time, it no longer learns only by predicting existing text. It also learns from new sequences produced through its own exploration.

Of course it does. That's how you get good next-token predictors.

> Calling the second system a “next-move predictor” would be strange.

No, it wouldn't, even in this idealized case that has barely anything to do with how post-trained LLMs work.

You're objecting to some hidden assumptions you make about the meaning of words that aren't there. "Next-token predictor" does not imply what you think it does.

stanleykmyesterday at 7:10 PM

> Calling the second system a “next-move predictor” would be strange. It is not trying to predict what move appeared next in a dataset. It is trying to choose a move that wins.

i dont understand the distinction here. does working backwards from a set of win states instead of working forwards from the current state somehow change whether it’s a prediction or not?

show 3 replies
jvanderbotyesterday at 7:02 PM

A better statement might be:

    Current agentic systems may be *built* from next-token predictors which are conceptually simple, but because of agentic frameworks, recursive invocation, tool use, and *heavy* investment in reinforcement learning in these contexts and for specific applications, they can no longer be thought of as "Merely" next token predictors.
Modern agentic work is probably more of a "emergent system from simple rules and complex interactions" paradigm than a genuinely new technology.
show 2 replies
teekertyesterday at 9:38 PM

It’s written in Claudish, or perhaps a human who has been reading too much Claudish recently. I am starting to become allergic to Claudish. Not there fully yet — but it’s at a tipping point genuinely worth exploring and worth being precise about.

show 1 reply
drivebyhootingtoday at 1:39 AM

That chess analogy deeply confused me. Chess engines don’t compute win probabilities and choose the highest move.

I don’t think a chess engine is an apt analogy at all. In a chess engine, there is a concrete search tree and although it emits one move at a time, it’s actually picking the entire branch (of course, with iterative deepening as the game progresses).

There is no obvious place in transformer models where the entire trace was already computed prior to a single token being chosen. It’s possible, maybe even likely, that the whole trace exists internally as activations. Multi token prediction and diffusion adapters point to that being the case. But to my knowledge no explanation has been given for where in the model the future plan is stored.

a3wyesterday at 10:15 PM

The errors LLMs typically made for me were looking for "schmutz" as a jiddish word, got "schmuck" on my screen. Thought why the stupid mistake? The next-token predictor model perfectly explains it.

Or starting with "yes". And this early locking in was a total lie, in the discussion that became "yes, might appear that way, but totally no since reasons". So it should have written "No", topmost, but could not self-edit that.

But nice that this gives it a more nuanced view, I might have to update my priors.

imenaniyesterday at 8:27 PM

I don’t think next token prediction is a particularly good description of pretraining either.

The intermediate representations at each position are being optimised not only to help predict the next token, but also to help predict all subsequent tokens within the training context.

You can see this directly in backpropagation: the gradient reaching a representation at position i sums contributions from prediction losses for subsequent tokens, not just from the loss for token i+1.

show 1 reply
ozgungtoday at 1:23 AM

“LLMs are just X”, mostly with X = “next token predictors” is a common pattern to dismiss the power of AI with a very shallow understanding of how they really work.

It’s not wrong, but because LLMs are generators, and generation is a kind of prediction. And current mainstream models are autoregressive, which means they generate things one by one in order. But these trivia doesn’t tell us anything interesting about how they work or their limits.

It’s like saying a Boeing 777 is just a rotating machine, and it flies by just rotating some fins. Well yes, but no. With that level of simplification we’ve just ignored 150 tons of advanced engineering and physics. Similarly with token generator simplification we ignore a few trillion parameter Transformer. That transformer is more complex than a Boeing 777, and we don’t really know how it works.

A tiny ML model can do “next token prediction”. This is not as simple as that.

show 1 reply
jmullyesterday at 7:40 PM

It's a weird article. Despite the title and some of the text, much of the article makes the point that LLMs are next-token predictors, where the predictions are based on both training data and various reinforcement learning techniques.

show 1 reply
vivzkestreltoday at 3:07 AM

- It is a next token predictor OP https://blog.florianherrengt.com/how-llms-work.html

- deal with it and stop whitewashing, greywashing it

js8today at 3:21 AM

The "next-token predictor" is taking a design stance (see Dennett). But to take the intentional stance is more interesting in case of large language/reasoning models.

show 1 reply
huurtehoogyesterday at 7:19 PM

Text renderer, whatever. Doesn't matter how you think of them, they are very interesting technology that is being misused and misconstrued in the name of something that has nothing to do with technology: political economy.

The greatest trick the rich ever pulled was making us think that the economy is about technology, and not politics.

show 1 reply
emteltoday at 1:03 AM

I would say that it is not even wrong. You say it’s a next token predictor. I say it isn’t. What observable behavior of the system can settle our dispute?

I fail to see how any possible output could cause either of us to change our mind.

show 2 replies
arjietoday at 1:04 AM

They are indeed "just next-token predictors". But rockets to orbit are also "just forward and upward goers". And Steph Curry is "just next three-pointer scorer" and so on. And as the article points out, chess engines are also "just next-move makers". A flawless oracular trading system is "just next trade maker". It turns out that "next n doer" is a true model that illuminates little.

hellohello2today at 3:33 AM

LLMs write one word at a time, and I do too.

It is really not that complicated: words are chosen to lead somewhere.

atleastoptimalyesterday at 7:20 PM

"Next-token predictor" is one of those phrases used most of the time with a motive to downplay the abilities and faculties of AI models. It is intended to trivialize LLM's and imply that there is some fundamental limit on their capacities.

Relying on it as a mental model for what LLM's are minimizes the emergent properties of scaling. It's like imagining that unicellular life could never eventually evolve into complex multi-cellular organisms because individual cells are just "survival and next-mitosis optimizers"

show 7 replies
godshatteryesterday at 10:20 PM

I think the author is arguing against the idea of a next-token predictor as something that simply uses the weights in the neural net which record the probabilities of tokens following other tokens as a valid definition of what an LLM is. Essentially a massive extreme markov chain.

With reinforcement learning and probably attention and other tricks that affect the weights based on things that aren't strictly in the training data, so the argument goes, you can end up with tokens following strings of tokens that would not be possible to be output with the training data and original weights alone. So describing it as solely a next-token predictor is incorrect based on this framing of it.

But that's just my take on this, I'm still trying to wrap my head around it all.

show 1 reply
xg15yesterday at 7:22 PM

> make_more_likely is, of course, doing a heroic amount of work here.

Indeed it is, and so is even just the inference method. I think it's worth remembering that both involve running the input tokens through a gargantuan neural network with (often) billions of parameters that only gain semantic meaning during the training process itself.

> it is trained to predict next tokens as they occur in its training data.

What I found important to understand is that not even the pretrainig is a deterministic process that only depends on the training data - as you would expect if the model just captured statistical properties of the data.

Gradient descent starts by setting all the parameters of the neural network to some initial values - usually by setting them at random, according to some distribution. Then during training, it gradually nudges them towards values that somehow make them useful to calculate the desired outcome of the network.

This means that by taking the exact same trainset and the exact same model architecture, you can still get models with different internal structure. The result doesn't just depend on the training data, but also on the order of examples, learning rate, the parameter initialization, etc etc.

tantalortoday at 2:43 AM

> Calling the second system a "next-move predictor" would be strange.

That is EXACTLY what I would call it. I don't understand why not.

softwaredougtoday at 3:30 AM

Aren’t humans just “next motor action predictors”?

gblarggtoday at 1:02 AM

If you get down to it, any system that produces output is a "next token predictor". Every compiler, every tool that generates output. Even a web render engine is: next pixel predictor.

simonwtoday at 1:14 AM

I really like the pseudo code example on this post - one of the clearest simplified explanations I've seen of how inference and training work.

andaiyesterday at 11:30 PM

>Calling the second system a “next-move predictor” would be strange. It is not trying to predict what move appeared next in a dataset. It is trying to choose a move that wins.

Sounds like the next 1000 years depend on how carefully we define "winning".

danielmarkbruceyesterday at 7:48 PM

The biggest problem is the word "predictor". Once you get into post training with RLHF and RLVR, it simply isn't doing that. It is not predicting anything. It's producing tokens, but it isn't predicting them. The chess analogy in the post is a good one - it's closer to searching for a set of moves that give a result than predict. It's search for a set of ideas, represented as locations in very high dimensional space, that when put together in the right order lead to a result.

Dlemloyesterday at 7:06 PM

It's the fitness function: Make a model which is capable of predicting the next token. The next token of what? EVERYTHING.

So what does this lead to? To a generic intelligence which is capable of responding/answering everything.

If overfitted, the model just remembers every possibility in the world but this is not possible anyway so it will start to identify patterns and rules and will use them instead.

Basically 'compressing' every possibility to every question someone could ask -> compression leads to intelligence.

kingjimmyyesterday at 10:58 PM

The chess analogy is not great since there is a defined heuristic in chess for "winning" or "optimal board state". A system doesn't need pretraining if they can fit the rule.

olooneytoday at 2:46 AM

Here's my take on the "next-token predictor" idea, from a much longer article I wrote recently:

https://www.oranlooney.com/post/rose-petals/#language-models

It’s popular to dismiss LLMs as “just next token predictors.” This is technically true, but also kind of misses the point. Markov chains, RNNs, and transformers are all language models that can be described as “next token predictors,” but they don’t all work equally well. A better question to ask is: “What is this model’s inductive bias?”

A Markov chain (an -gram model) assumes the next word depends on the previous words, and that each possible combination of words has a completely independent parameter. (Andrey Markov proposed using this language model over a century ago, making it the granddaddy of modern LLMs.) So, for a vocabulary of size , there are parameters to learn. For even a smallish like 5, that already explodes the hypothesis space beyond what can be learned from even a huge text corpus like the entire internet. And, simultaneously, having a context window of only the previous 5 words is grossly inadequate for modeling real-world language. Like our FCNN above, this model suffers from having an inductive bias which is too weak.

RNNs tried to fix this problem by compressing the entire history into a single fixed-size state vector, updated one token at a time. But that compression is itself a brutal assumption: everything worth remembering about the past must survive being squeezed through a tiny bottleneck at every step. In practice, RNN models quickly lose the plot after a handful of sentences. Locally, the text they generate looks grammatically correct and meaningful, but zoom out a little and they’re basically nonsense generators. Like our naïve linear model, this model suffers from having an inductive bias which is too strong.

Transformers manage to hit a sweet spot: by keeping the recent history around as a working memory, and attending to different parts of it at different times, the transformer’s bias matches real structure in language: the referent of a pronoun, the subject of a verb, the parenthesis waiting to be closed. Not only that, but the particular structure of the transformer, basically a weighted sum of semantic vectors from the context window, has empirically been shown to somehow be a “good enough” match for the structure of real-world language found in the wild.

Transformers aren’t “smarter” than other possible language models, they just happen to land in that Goldilocks zone where their inductive bias is just right.

Sprotchyesterday at 7:10 PM

I understand how a computer can know that a chess move is more likely to lead to a win, and therefore “correct”, but I don’t understand how it can know that a token is correct. Can someone explain?

show 5 replies
poloticsyesterday at 7:08 PM

yep "next-embedding" predictor is more correct, and not just at the end but through the layers, and folding back dimensions into that one next token is one small final step, and next-embedding could be named "next-meaning" as well, and we're getting there...

this sentence above would made a longer article if I bothered to so blog as is being blogged here

miraculixxyesterday at 11:16 PM

I like to think of LLMs as informed dice throwing

Geeeyesterday at 8:05 PM

It's a next-token computer. It computes the probabilities for the next token.

gunalxyesterday at 11:39 PM

I mean. Fundamentally they are just autoregressive next token predictors. Fundamently fou can simplify to f(x) -> x+y where x is input tokens, y is the next token and f() is the model function. Yes the model function is complex but still.

qudatyesterday at 9:26 PM

Shrug. My intuition is LLMs predict the new word based on a tensor vector space of patterns using arithmetic and similarity scores.

What’s not intuitive to me is that through pattern matching it’s able to express logic and reasoning.

DonHopkinsyesterday at 8:54 PM

Calling an LLM a "next-token predictor" is like calling a TomTom a "next-turn predictor." It confuses the serial format of its instructions with the computation producing them, while ignoring the map, the route, the destination, and the goal -- as well as the people, businesses, traffic, and points of interest that make the map a model of an inhabited, changing world.

chrisjjyesterday at 7:15 PM

Better title: Continue thinking of LLMs as Next-Token Predictors

Because no, post training doesn't change that.

show 1 reply
hirvi74yesterday at 7:14 PM

Sure, I get the gist of the article. I have never liked the reductionist argument that LLMs are nothing more than next-token predictors. By that rational, the human brain is really not that much different. When I am having a conversation with another person, I do not usually have every word I will respond with stored in my limited working memory. My output is often predicted based on the previous word I spoke.

show 2 replies
Der_Einzigeyesterday at 7:11 PM

slop slop and more slop

show 1 reply
ankithgyesterday at 11:43 PM

[flagged]