about
The Matrix: A Bayesian learning model for LLMs (arxiv.org)
139 points by stoniejohnson on May 4, 2024 | hide | past | pdf | 10 comments on HN

In plain words: A new model treats a text generator as a big table of next-word chances, with a starting guess updated as text arrives. It shows large models learn this way, explaining why bigger ones pick up patterns from prompt examples, matching measured next-word probabilities.

Abstract · Beyond the Black Box: A Statistical Model for LLM Reasoning and Inference

This paper introduces a novel Bayesian learning model to explain the behavior of Large Language Models (LLMs), focusing on their core optimization metric of next token prediction. We develop a theoretical framework based on an ideal generative text model represented by a multinomial transition probability matrix with a prior, and examine how LLMs approximate this matrix. Key contributions include: (i) a continuity theorem relating embeddings to multinomial distributions, (ii) a demonstration that LLM text generation aligns with Bayesian learning principles, (iii) an explanation for the emergence of in-context learning in larger models, (iv) empirical validation using visualizations of next token probabilities from an instrumented Llama model Our findings provide new insights into LLM functioning, offering a statistical foundation for understanding their capabilities and limitations. This framework has implications for LLM design, training, and application, potentially guiding future developments in the field.

Siddhartha Dalal, Vishal Misra
arXiv:2402.03175 · cs.LG, cs.AI · submitted Feb 5, 2024 · updated Sep 24, 2024
abstract · pdf · html

add comment on HN
Also discussed: May 2024 (3 points, 0 comments) · Apr 2024 (1 point, 0 comments)

Conclusion from the paper is:

In this paper we present a new model to explain the behavior of Large Language Models. Our frame of reference is an abstract probability matrix, which contains the multinomial probabilities for next token prediction in each row, where the row represents a specific prompt. We then demonstrate that LLM text generation is consistent with a compact representation of this abstract matrix through a combination of embeddings and Bayesian learning. Our model explains (the emergence of) In-Context learning with scale of the LLMs, as also other phenomena like Chain of Thought reasoning and the problem with large context windows. Finally, we outline implications of our model and some directions for future exploration.

Where does the "Cannot Recursively Improve" come from?

Looks like someone edited the title of this thread. I assume "Cannot Recursively Improve" was in the old one?
Yeah, looks like it. This is better!
Theoretically this sounds great. I would worry about scalability issues with the Bayesian learning models practical implementation when dealing with the vast parameter space and data requirements of state of the-art models like GPT-3 and beyond.

Would love to see practical implementations on large-scale datasets and in varied contexts. I Liked the use of Dirichlet distributions to approximate any prior over multinomial distributions.

I didn't read through the paper (just the abstract), but isn't the whole point of the KL divergence loss to get the best compression, which is equivalent to Bayesian learning? I don't really see how this is novel, like I'm sure people were doing this with Markov chains back in the 90s.
in fact it is nothing new.
The title of the paper is actually `The Matrix: A Bayesian learning model for LLMs` and the conclusion presented in the title of this post is not to be found in the abstract... Just a heads up y'all.
I don’t really care, I just want some vague reassurance that we’re probably not on the verge of launching Skynet…
Completely editorialized title. The article talks about LLMs, not transformers.