News for hackers. Stuff that matters.
Re:Markov Chains Are the Original Language Models by tanepiper on Thursday February 01, 2024 @10:19AM (#39216867)
This is what I've been saying to people, LLMs aren't much smarter than a Markov Chain - a lot of twitter bots and earlier chat agents were driven by them.

What I do see though is the infrastructure around LLMs making a difference.

Re:Markov Chains Are the Original Language Models by bongodongobob on Thursday February 01, 2024 @10:59AM (#39217303)
I've never seen a Markov chain do anything like GPT4. I'm not sure how you can say with a straight face they are basically the same.
Re:Markov Chains Are the Original Language Models by thwarted on Thursday February 01, 2024 @11:21AM (#39217610)
A LLM is a Markov chain with billions of associations and weights. A Makov chain is an LLM of maybe a few dozen associations and weights (so an LM, without the first L).

The difference is in the data structure and the size of the atoms/n-grams. The data structure Markov chain implementations use is not efficient for billions of parameters, either in storage or in processing. But the idea is the same: give a likely next token given the last n tokens. The value for n is a narrow window for Markov chains and an extremely wide window for LLM. LLM are able to maintain massive amounts of state compared to a Markov chain implementation.

Re:Markov Chains Are the Original Language Models by mewpmewp2 on Thursday February 01, 2024 @12:10PM (#39218305)
Idea behind complexity can be very simple, but at scale work yield in very different results.

To compare Markov Chain with an LLM is kind of like to compare a single cell organism to a human being because we both are based on cells.

Re:Markov Chains Are the Original Language Models by BlueTemplar on Thursday February 01, 2024 @01:19PM (#39219261)
As already mentioned, Markov chains were already used in practice as (poor) Turing tests (IMHO working best in art projects, and sadly, spam).

Sure, today's LLMs blow them out of the water, but the difference was much less striking with neural networks even as late as 2010.

Re:Markov Chains Are the Original Language Models by bbor on Thursday February 01, 2024 @02:34PM (#39220177)
That’s interesting you put the date at 2010! When I learned machine learning in ~2016-2018, markov chains were THE fundamental problem tool of NLP still. Neural networks were all the rage ofc, but still… could you tell me what tech/change you’re thinking of?

For example, I remember /r/SubredditSimulator blowing my mind, and I’m pretty sure that was markov chains

Re:Markov Chains Are the Original Language Models by BlueTemplar on Thursday February 01, 2024 @05:02PM (#39222075)
Yeah, my bad, I took a guess here, from what I remember about when neural networks became the hot buzzword (again, after the 1970's Perceptron ?) - sounds like I missed, since the transition was slower than I thought ?

P.S.: "2010" was probably from this great Ars Technica article :

https://arstechnica.com/gaming/2011/01/skynet-meets-the-swar...

It's not clear to me whether neural networks were already involved (though there's already some self-learning there), you can see a few Ars and YouTube comments mentioning them, though "genetic algorithms" seems to also have been a popular buzzword ?

P.P.S.: This is about StarCraft 1 (ONE), not to be confused with DeepMind's Alpha Star wiping the floor with a pro StarCraft 2 (TWO) player in 2018.

Re:Markov Chains Are the Original Language Models by marcus0x62 on Thursday February 01, 2024 @12:25PM (#39218516)
“A human brain is just like a dog’s brain, only with more neural pathways.” True, perhaps, but largely pointless: at some point neural complexity results in a difference of kind, not of degree.

I’d argue the same is true of LLMs vs simpler models like Markov chains.

Re:Markov Chains Are the Original Language Models by andoando on Thursday February 01, 2024 @03:48PM (#39221231)
I think this vastly underplays animals intelligence though. There is so much focus on creating human level intelligence, but where is a robot that can learn to navigate the world like a dog or cat can?
Re:Markov Chains Are the Original Language Models by marcus0x62 on Thursday February 01, 2024 @06:38PM (#39223081)
It was an analogy about how stupid it is to say a markov chain is “just like an LLM.”
Re:Markov Chains Are the Original Language Models by candiodari on Thursday February 01, 2024 @01:23PM (#39219315)
But a human brain is also just like an elephant or whale's brain except with 1/5th of the neural pathways at best, probably less.

There's a qualitative difference too.

Re:Markov Chains Are the Original Language Models by causalmodels on Thursday February 01, 2024 @12:08PM (#39218274)
An LLM is a Markov chain in the same sense that a cat is a tiger, technically true but it misses the qualia.
Re:Markov Chains Are the Original Language Models by candiodari on Thursday February 01, 2024 @01:26PM (#39219358)
It's not. There's fundamental architectural differences that couldn't be bigger.

A better comparison would be that it's like a windup toy versus a group of humans moving an entire civilization. They both move along a distance, but just listing the systems that the human group has that the windup toy doesn't is too long to fit on a page.

Re:Markov Chains Are the Original Language Models by Jensson on Friday February 02, 2024 @02:14AM (#39225986)
> It's not. There's fundamental architectural differences that couldn't be bigger.

LLM architecture is a markov chain to the core. It isn't a lookup table like old markov chains but it is still a markov chain: next word prediction based on previous words.

Re:Markov Chains Are the Original Language Models by fjkdlsjflkds on Friday February 02, 2024 @05:01AM (#39226996)
Thanks for repeating this.

Seems like most people fail to understand that LLMs (as they are implemented these days) are markov chains by definition, regardless of how much "better" they are compared to "Dissociated Press"-style markov chains based on lookup tables.

> A Markov chain or Markov process is a stochastic model describing a sequence of possible events in which *the probability of each event depends only on the state attained in the previous event*.

Is the process calculating a probability distribution over "next token", based on a bounded-size context of "previous tokens"? Yes? Then it is a markov chain, by definition.

It's like saying that a "human" is not an "animal", since it is so much "better" and "capable" than (other/usual) animals. The more you argue, the more I'll be convinced that you either don't know what the definition of a "human" is, or that you don't know what the definition of an "animal" is (or both).

Re:Markov Chains Are the Original Language Models by candiodari on Friday February 02, 2024 @06:53PM (#39236140)
This is the magical human intelligence/“AI has no soul” argument just presented in reverse. It totally ignores that human minds are emergent: no single part of your brain, nor it’s connection to the outside world are intelligent.

Despite this it’s equally obvious that the intelligence IS in the human brain, inside the skull. Shoot the right parts (frequently done by accident, so many subjects for research) and the intelligence is gone. It IS possible to radically change behaviour of a human by destroying part of the brain. There is no external soul that manages things behind the scene. Human intelligence and our souls are emergent. The are “software”, not hardware.

All the criticism against AI you make therefore applies equally to a human mind. Yet obviously it shouldn’t. To be more exact: it fails to differentiate between human minds and AI. Behaviours could emerge at any time in AI, even in transformer networks. Hell, transformers are famous for their emergent behaviours. Yes their components are obviously not intelligent. Neither are your components, or mine.

Yes the machine has no soul. The problem is: neither do you.

Re:Markov Chains Are the Original Language Models by CamperBob2 on Thursday February 01, 2024 @12:12PM (#39218332)
It's not just window size. It's the difference between syntax and semantics.

A Markov model, by definition, works only with literal token histories. It can't participate meaningfully in a conversation unless the user happens to employ token sequences that the model has seen before (ideally multiple times.) An LLM can explain why it's not just a Markov model, but the converse isn't true.

Now, if you were to add high-dimensional latent-space embedding to a Markov model, that would make the comparison more meaningful, and would allow tractable computation with model sizes that were completely impossible to deal with before. But then it wouldn't be a Markov model anymore. Or, rather, it would still be a Markov model, but one that's based on relationships between tokens rather than just their positions in a linear list.

Another analogy might be to say that a Markov model can implement lossless compression only, while a latent-space model can implement lossy compression. There's a school of thought that says that lossy compression doesn't just require intelligence, it is intelligence, and LLMs can be seen as an example of that equivalence. Not saying I agree with that school, or that you should, but as someone else pointed out, comparing Markov chains with LLMs are at best like comparing goldfish brains with human brains.

Re:Markov Chains Are the Original Language Models by theGnuMe on Thursday February 01, 2024 @01:24PM (#39219343)
>high-dimensional latent-space embedding to a Markov model

That's what we call a hidden Markov model.

>There's a school of thought that says that lossy compression doesn't just require intelligence, it is intelligence, and LLMs can be seen as an example of that equivalence.

SVD is used to implement lossy compression as does JPEG encoding... these algorithms are in no way intelligent.

Re:Markov Chains Are the Original Language Models by geoelectric on Thursday February 01, 2024 @02:01PM (#39219755)
They’re doing highly specific tasks where the intelligence can come from the designer of the algorithm.

In particular, JPEG has intelligence encoded about how graphics are displayed, what detail we won’t notice is missing, and what artifacts we won’t notice are present, much like the psychoacoustic models behind lossy music compression schemes like MP3.

But we had to feed an encoder that by way of algorithmic design. It’s hardcoded intelligence, like any other function, but with a lot more outside knowledge required to do it right than a sort or swap.

I’d call an LLM a more general problem solver. It can write cogent limericks, convincingly screw up math, summarize papers it’s never seen before, generate book plots or character arcs based on specific requests, translate to a language you just made up and explained in the prompt, etc.

The intelligent bits are emergent and can do something reasonable with novel input, even if it doesn’t closely resemble the exact material it was trained on.

The comparison would be a process that could lossy-compress any kind of sensory media possible with no perceptible loss, based solely on its training on human capabilities and how the reproduction devices work—i.e. it could create the JPEG algorithm, not just perform it.

Re:Markov Chains Are the Original Language Models by CamperBob2 on Thursday February 01, 2024 @01:35PM (#39219461)
SVD is used to implement lossy compression as does JPEG encoding... these algorithms are in no way intelligent.

You'll have to take that up with people above my pay grade. It's not that simple, apparently. Call me when a Markov model can explain why it's equivalent to an LLM.

Re:Markov Chains Are the Original Language Models by pyinstallwoes on Thursday February 01, 2024 @03:22PM (#39220893)
I like: Intelligence is compressing information into irreducible representation.

Which leads to a wonderful tongue-in-cheek contraindication: representation types such as a particular model, when it’s complexity increases, especially via edge cases, it is then a result of agentic anti-intelligence.

That is to say, anything that increases in complexity without being refactored is a sign of a lack of intelligence or worse.

And any sense of information that is impossible to be reduced further while maintaining equal or more expressibility are signs of maximum agentic intelligence.

Re:Markov Chains Are the Original Language Models by PheonixPharts on Thursday February 01, 2024 @11:02AM (#39217346)
LLMs are Markov chains in latent space, it's the latent representation that give them their power, but ultimately there's not as much difference as one would suspect.
Re:Markov Chains Are the Original Language Models by esafak on Thursday February 01, 2024 @05:19PM (#39222240)
They're different because Markov models are stateless whereas LLMs are stateful.

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

Re:Markov Chains Are the Original Language Models by Jensson on Friday February 02, 2024 @02:16AM (#39225996)
Current LLMs are stateless as far as we know, their state when computing a new token is only the preceding text tokens, they don't store any metadata or save state from the previous calculations.
Re:Markov Chains Are the Original Language Models by adamnemecek on Thursday February 01, 2024 @11:03AM (#39217373)
No one has spent 100M on training Markov chains.
Re:Markov Chains Are the Original Language Models by Al-Khwarizmi on Thursday February 01, 2024 @12:04PM (#39218210)
Not 100M I guess, but this is fresh from today's arXiv:

"Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokens"

https://arxiv.org/pdf/2401.17377.pdf

Re:Markov Chains Are the Original Language Models by edgyquant on Thursday February 01, 2024 @11:59AM (#39218150)
For the first few years of smartphones markov chains were used for autocorrect.
Re:Markov Chains Are the Original Language Models by hiddencost on Thursday February 01, 2024 @11:33AM (#39217767)
Google did it. Amazon did it. Plenty of others did. What do you think they were doing before recurrent neural networks?
Re:Markov Chains Are the Original Language Models by ben_w on Thursday February 01, 2024 @01:40PM (#39219528)
100 million USD?

No.

I'd believe $40 for the energy cost, $120 for very slightly increased wear on their hard drives, and $400 for one engineer's 20% time project for one week.

And that's if it was trained on Google's entire internet cache rather than, say, just a Wikipedia snapshot from 2004, which sounds like the kind of thing that Google might have set as a pre-interview coding challenge.

Re:Markov Chains Are the Original Language Models by Sohcahtoa82 on Thursday February 01, 2024 @01:06PM (#39219101)
The trick with Markov chains is that you don't need to.

Markov Chains are dead simple. There's not really a "training" as much as it's simply reading data and collecting statistics.

They're so simple that you can probably build one nearly as fast as you can read the training data.

Re:Markov Chains Are the Original Language Models by ben_w on Thursday February 01, 2024 @01:33PM (#39219444)
I think it would take some spectacularly bad engineering to be that wasteful. It would need to be so inefficient that getting ChatGPT to write the code won't be bad enough.
Re:Markov Chains Are the Original Language Models by esafak on Thursday February 01, 2024 @05:20PM (#39222256)
It would make no sense; they are not powerful models worthy of the spend.
Re:Markov Chains Are the Original Language Models by k__ on Friday February 02, 2024 @08:07AM (#39228104)
Fair, but maybe it's more of a computer science-cy type of comparison?

We say systems can perform the same types of computations if they're both Turing complete. Yet, we wouldn't implement everything in every "language" that is Turing complete.

Perhaps, every LLM could be represented as a Markov chain, and for some it even makes sense (e.g., easier to train, easier to reason about), but in most cases it's a bad idea (e.g., expensive, bad performance).

Re:Markov Chains Are the Original Language Models by coldtea on Thursday February 01, 2024 @10:27AM (#39216947)
>This is what I've been saying to people, LLMs aren't much smarter than a Markov Chain

They're based on the same principles, but extend quite beyond that, and are way smarter than Markov Chains.

So, it's not just the infrastructure that's makes the difference (if they were only as effective as Markov Chains, then having the same or even more infrastructure wouldn't make any difference).

Re:Markov Chains Are the Original Language Models by axchizhov on Thursday February 01, 2024 @11:51AM (#39218037)
Yeah, and Markov chains aren't much smarter than... matrix multiplication. A lot of stuff have been built with it, but these pesky c++ libs like lapack — such a bother to use! Imagine a world where a good infrastructure have been built around it — matrix multiplication certainly would be a blast!
Re:Markov Chains Are the Original Language Models by edgyquant on Thursday February 01, 2024 @12:00PM (#39218158)
What are ANN but fancy matrix multiplication?
Re:Markov Chains Are the Original Language Models by ASalazarMX on Thursday February 01, 2024 @12:34PM (#39218643)
And a reason why GPUs are well suited for AI. 3D transformations are also fancy matrix multiplication.
Re:Markov Chains Are the Original Language Models by SomeoneFromCA on Thursday February 01, 2024 @03:38PM (#39221111)
ANN are non-linear. Much more powerful.
Re:Markov Chains Are the Original Language Models by CamperBob2 on Thursday February 01, 2024 @11:41AM (#39217910)
This is what I've been saying to people, LLMs aren't much smarter than a Markov Chain

And that's why people have been nodding, smiling politely and reaching behind their back for the doorknob.

Re:Markov Chains Are the Original Language Models by hiddencost on Thursday February 01, 2024 @11:32AM (#39217753)
The whole point of Transformers is that they broke the Markov assumption (i.e., that the next token probability is strictly conditioned on a window of N preceding tokens).
Re:Markov Chains Are the Original Language Models by pclmulqdq on Thursday February 01, 2024 @11:38AM (#39217870)
That's not actually true, they still have a fixed history window. The idea that transformers capture through the attention mechanism is that not all past tokens are created equal, and that the importance of tokens in that history window depends on what they are.
Re:Markov Chains Are the Original Language Models by sudosysgen on Thursday February 01, 2024 @12:07PM (#39218261)
They also scale differently - Markov Chains scale exponentially with the size of the window, while transformers scale quadratically. So in fact transformers are really more exponentially more efficient, though without bound on resources their capabilities are a strict subset of that of Markov chain.
Re:Markov Chains Are the Original Language Models by theGnuMe on Thursday February 01, 2024 @01:27PM (#39219370)
Look into variable order Markov models.
Re:Markov Chains Are the Original Language Models by guluarte on Thursday February 01, 2024 @11:07AM (#39217446)
me too, current LLM are markov chains with context
Re:Markov Chains Are the Original Language Models by chpatrick on Thursday February 01, 2024 @11:31AM (#39217740)
"humans aren't much smarter than goldfish"
Re:Markov Chains Are the Original Language Models by GuB-42 on Thursday February 01, 2024 @12:49PM (#39218861)
The big difference is the "deep" in "deep learning".

As the article says, Markov chains can be thought of as linear operations, which are very limited, and the reason early neural networks weren't taken seriously. Notoriously, you couldn't implement a XOR operation using these early neural nets.

It all changed when we got to multi-layer perceptrons, with backpropagation. The key here is the transfer function, which is non-linear, which allows the network to do infinitely more what you can achieve with simple linear combinations. And it is also differentiable, which allows for learning using backpropagation. This is the theoretical foundation behind LLMs, diffusion models, classifiers, etc... Essentially everything we call "AI" today.

So, yes, by being non-linear, LLMs are deeply smarter than Markov chains (pun intended).

Re:Markov Chains Are the Original Language Models by ben_w on Thursday February 01, 2024 @01:29PM (#39219394)
> This is what I've been saying to people, LLMs aren't much smarter than a Markov Chain

Then you're doing some combination of grossly overestimating the latter and/or underestimating the former.

A Markov Chain is a (small) language model with a context length of 1, never more, that's a definitional requirement of a Markov process.

Re:Markov Chains Are the Original Language Models by jltsiren on Thursday February 01, 2024 @04:19PM (#39221608)
Markov chains are defined in terms of states, which are not necessarily the same as tokens.

As an example, de Bruijn graphs have been widely used in bioinformatics. There are many definitions, but the key idea is that nodes are strings of length k, and there may be an edge from u to v if the length k-1 suffix of u is the same as the length k-1 prefix of v. It's trivial to turn a de Bruijn graph into a Markov chain with a context of k symbols.

If you have the Burrows-Wheeler transform of the training data, you can use it to simulate a Markov chain over a de Bruijn graph with any context length. You can also change the context length on the fly. I toyed a little bit with that idea when I was a grad student ~15 years ago, but nothing really came out of it. Building the model was already cheap back then, while getting data was the real bottleneck.

LLMs are basically lossy approximations of Markov chains. If you have a small accurate approximation of a larger model, the approximate model probably has the ability to generalize. And it turns out that good generalization over textual data looks like intelligent behavior.

Re:Markov Chains Are the Original Language Models by ben_w on Friday February 02, 2024 @07:40AM (#39227909)
> Markov chains are defined in terms of states, which are not necessarily the same as tokens.

While true, I don't see how that helps? The example isn't particularly illuminating, yes you can make a Markov chain that encompasses all possible states in principle, but in practice you can't do that with a language model because you can't list all possible states (they mostly don't exist in the training set but even if they did there's no room to store them) and instead have to make a system which is, for lack of a non-anthropomorphic verbs, "trying to guess" the state — most of the cool stuff in the LLM is the system doing the guessing[0].

> If you have the Burrows-Wheeler transform of the training data, you can use it to simulate a Markov chain over a de Bruijn graph with any context length. You can also change the context length on the fly. I toyed a little bit with that idea when I was a grad student ~15 years ago, but nothing really came out of it. Building the model was already cheap back then, while getting data was the real bottleneck.

To me, the Burrows-Wheeler transform looks like a way to generate a compact tokenisation that doesn't make presumptions about data structure — while I think that's a good idea (and much better than the naive English language tokenisation of "anything that's not a letter or apostrophe" which IMO probably harmed early NLP), I don't think it's a good argument for drawing similarities between Transformer models (or even RNN models) and Markov models

> LLMs are basically lossy approximations of Markov chains. If you have a small accurate approximation of a larger model, the approximate model probably has the ability to generalize. And it turns out that good generalization over textual data looks like intelligent behavior.

I wonder if you're using "approximation" to mean something different than I would understand the term?

You can map a Turing machine to a sufficiently large Markov chain whose probabilities are always 1 or 0, but that has the same problem: Turing machines and LLMs aren't lossy approximations of Markov chains, they're at least generalisations that only look the same when you construct an extreme form.

Hopefully we both agree that it would be very weird to argue that "the language centres of human brains are basically just approximations of Markov chains"? Even though we can probably sufficiently well describe each neuron within a brain by a Markov chain?

[0] This reminds me of my issue with John Searle's Chinese room argument: Searle denies the system truly understands Chinese because the human reading the books and following the instructions doesn't know Chinese, I would argue that the intelligence and understanding is encoded in the books, and that the entity lacking understanding is the substrate upon which the instructions are processed.

To argue "the system as a whole can't be said to understand because the human doing the data processing doesn't understand" seems to me to map to saying "humans can't be said to understand because the brain cells doing the data processing don't understand", or even "… atoms conveying electrochemical signals across synapses don't understand".

But I'm clearly digressing now, so I'm glad I put this in a footnote…