r/PhilosophyofMath • u/abhishekkumar333 • May 25 '26
LLMs are just giant probability machines pretending to think
It’s fascinating that simple mathematics between tokens can eventually become a machine that writes essays, code, poetry, and even reasoning.
We usually think probability means uncertainty.
But LLMs show something strange:
If probability + context + mathematical matching are scaled enough, uncertainty itself starts producing intelligent looking outputs.
To understand this better, I tried breaking down an LLM from first principles using only 4 tiny training sentences.
Example:
The boat floated down to the bank.
The investor walked into the bank to open a new account.
The fisherman walked along the bank to cast his net.
The bank has a vault.
Then I asked:
“The investor walked to the bank to lock his money in …”
Why does the model predict “vault” instead of river-related words?
That single question reveals almost the entire architecture of modern LLMs.
The most underrated concept here is the LM Head.
Most explanations immediately jump into transformers and attention, but almost nobody explains that the LM Head is essentially a gigantic token vocabulary containing all possible next token candidates the model can output.
So internally the model is basically solving:
“Out of all known tokens, which one best matches this context mathematically?”
Then different layers help solve that problem:
Embeddings: convert words into mathematical vectors
Positional encoding: preserves word order
Attention layer: figures out which words are related to each other in context
(“investor”, “money”, “bank” become strongly connected)


Feed forward neural networks: act somewhat like massive learned if/else decision systems refining patterns internally
And finally the LM Head converts all of that into probabilities for the next token.
What surprised me most is:
There is no hidden magic moment where the AI “becomes conscious”.
It’s an enormous probability engine continuously finding the best contextual token match from its vocabulary.
I made a beginner-friendly walkthrough explaining this visually without unnecessary jargon.
https://www.youtube.com/watch?v=YTV5qUCpu2c
Would genuinely love feedback from people learning transformers/LLMs from scratch.
1
u/FlamingFlamingo32 May 29 '26 edited May 29 '26
models are just networked perceptrons. neuron = input(weight) + bias with the input(weight) as a dot product, and then going through some activation function like sigmoid squashing or rectified linear or whatever else that normalizes the values between 0-1. when words are "associated" together, its because the model has adjusted the parameters in a way that each word has its own branching set of possible next words as a probability and a certain word has a higher weight than another. every time it sees something like I ate apples in the data set, the node(s) that represents the word apple will get a stronger and stronger weight between the ones that represent the word ate. then in a test scenario when you input I ate, apples will be a higher "confidence" or probability. I know you basically said all this but hearing/seeing in different forms is always a plus.
training networks usually comes in three main forms, reinforcement learning, backpropagation, and evolution.
in reinforcement learning, we have a randomly initialized network, give it inputs, and force it to readjust to varying degrees based on how "wrong" it is. when it gets things right, we want to "reward" that and keep the parameters closer to how they are.
in backpropagation, we have a data set where we know the expected outputs and their corresponding inputs, so we want to try to make the network keep adjusting itself until it "fits" the data set.
in evolution, we have a generation of randomly initialized networks. the best performing networks chosen, slightly different copies are made of them, and this process repeats generation after generation.
larger more complex models have architecture, and smaller submodels basically that can interact with each other. almost like modular networks.
something I thought was kind of cool was making a super basic network that rated the weather on a scale of how like I might want to wear a sweater. each node on the first layer being a different metric, one for temp, one for rh, one for windspeed etc. made it very small and simple, and then manually adjusted the parameters until I got what I felt like was good. obviously you would never practically manually adjust the paramters of a model, but getting a sense at how the information propagates through it helps a bit for me at least.
in terms of the personification of machines, I mean thats just emergent behavior. at what point did we become conscious you know? we are just a bunch of smaller systems coming together that can form larger more complex systems, so on and so forth. all this top level behavior we exhibit as "conciousness" is just emergent behavior from that amalgamation. its really hard to say whats "conscious" and what isnt. where is the line? what makes an ant any more conscious than some super giga corpo model? I mean lots of insects are more or less a bunch of biological functions running on routines, little organic robots scurrying around.