Modern AI systems, including language models, image classifiers, and regression models, do not produce single deterministic answers but instead build and sample from probability distributions. This distributional thinking reveals that generation is sampling from a landscape of possibilities, classification reads probabilities across all classes, and regression represents the center of a bell curve. Understanding that everything in AI—from token selection to image generation to reinforcement learning policies—is fundamentally probabilistic rather than deterministic is essential for becoming a strong AI researcher, as it helps explain why models sometimes produce unexpected outputs and enables better debugging and design of AI systems.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Everything Is a Distribution: AI Mental Model
Added:Hello everyone and welcome to the next lecture in the great mental models of artificial intelligence series. This is lecture number 10 and in this lecture I'm going to cover a mental model which is not just related to artificial intelligence but it is also very much related to the world which we see around us.
So in my experience while growing up I found it really hard to understand probability and probability distribution.
But then there was a particular time when I remember that I was interacting with the professor at uh IIT Madras and I remember this conversation because that completely changed the way I looked at probability and probability distributions.
Before that it just seemed like a mathematical concept to me. But upon interacting with him I realized that he actually viewed his entire world as a probability distribution which means that it was not just a mathematical subject for him but life as such was a probability distribution. So he mentioned to me that every day when we wake up in the morning we make several choices.
Um how do we essentially make those choices?
Because the way we make those choices is that our mind constructs a probability distribution and we go with that choice which our mind assigns the highest probability to.
Imagine uh you don't have Google maps and uh you have three routes to go to a destination.
Your mind will assign a probability to some route and you will go through that route because you think through that route the probability of getting there is faster.
If you look at Google maps the probability the probabilities will be updated in your mind. Maybe now another route takes you there faster and then you'll choose that.
Essentially every single decision which you take in life is a consequence of your mind assigning probabilities to events and then you acting on that probability.
We just feel that our life is purely deterministic.
But all the decisions are taken from something which is called a prior belief and then events alter that belief and then new beliefs form. But everything is a probability distribution.
And this is true in the case of artificial intelligence also.
So um there are really two ways to look at many concepts in AI. First is the deterministic way and second is the probabilistic way. One very simple example to kind of explain this is if you go to chat GPT right now and if you ask something like explain AI to me like I am five you'll see that there are tokens which keep on appearing one after the other.
One way to interpret is that every token which you see here every word is deterministic. You have one token, then you have the second token, then you have the third token. It's fully deterministic in nature, right? But another way to look at it is that the model at every time or at every token position has a probability distribution over all the possible tokens and it selects the token which it assigns the highest probability to. It's similar to choosing the best route to go to a destination. the example which we saw already earlier. Imagine that for this token or for this word the model had 100,000 choices and it chose this one because it assigned the highest probability for this token to be in the first position.
Here the model again had 100,000 choices. It chose this token or this word because it assigned this word the highest probability to be in this position.
So large language models and even text generation tasks can seem to be deterministic to a person untrained in probability.
But a person who looks at the world through probabilistic lens sees that generating anything whether it's a text, image or audio or video is just sampling from a probability distribution.
Once you have a probability distribution of generating underlying text, you just sample from it to generate one new token at a time. And this is a fundamentally different way of thinking. There's one way which is to see the world in a purely deterministic manner that's shown on the left. And there is one way which is the second way which is to see the world in a distributional manner or a probabilistic manner. That's the manner which I'm showing here on the right.
So before coming to looking at probability distribution in the artificial intelligence world, we need to understand what exactly is a distribution.
It's just a bag of possibilities and each assigned with a weight. Right? If you look at a dice and if you roll the dice, the probability distribution for is just 1x six, right? Each face has a probability of 1x six of coming on top when you roll a dice. So that's a probability distribution.
When I look at tomorrow's weather, I cannot say that it's 100% going to be sunny, right? If you see weather prediction, yeah, this is a weather prediction. And if you see, I cannot say with complete confidence that it's going to be sunny or it's going to rain, let's say. But this is a probability distribution that okay I can say with maybe 80% confidence that it's going to rain or 20% confidence that it's going to be sunny etc. Everything is a distribution.
Even when you say an average person is 1.7 m tall what does this mean? You take all the people in the world. You look at their heights and then you look at the distribution and then you look at the band of heights which have the maximum concentration of people.
So a number such as an average or a mean is is a is a lossy compression over the underlying truth. The underlying truth is the probability distribution itself.
So the number is the summary and the distribution is the truth.
Now if you see if you look at several examples of artificial intelligence right we can see that probability distributions come everywhere u softmax when you predict a certain token uh when you are when text generation models predict new tokens at a time they usually select tokens after the softmax is applied right so if a temperature is zero this looks like all the possible next tokens and then the model chooses the one which it assigns the highest probability to. If you change the temperature parameter, the probabilities it assigns to different tokens actually changes a bit and then the choice of the next token will change appropriately.
So the softmax algorithm actually shows up at several different places in it shows in classification, it shows in large language models, shows in several different areas and essentially softmax operates on um distributions.
One of the simplest ways to see where probability distribution comes up in artificial intelligence is actually classification.
So when you're looking at images of let's say animals and you are classifying what type of an animal it is, we don't just confidently say that it's a cat.
We assign probabilities. we assign probability to uh let's say I I can say with 70% confidence it's a cat 20% it's a dog 8% to fox and 2% to others so it's a probability distribution over the classes of animals which are in my data set it's not 100% confidence answer confident answer so when you look at convolutional neural networks to help classify images.
Yeah, see here you have this is a cup, right? But it's not 100% saying that it's a coffee cup. It's maybe 95% confidence it's a cup. If you have 10 output classes like lifeboat, ladybug, pizza, bell pepper, etc. All of those also have some probability. For example, orange has a slightly higher probability. But the highest probability is that this might be an espresso cup.
So again this is a probability distribution. Classification is a distribution problem.
Um as we have already seen for the case of uh language models and uh generation.
So any kind of generation can be viewed as sampling from a probability distribution. So even language models even image generation. Right? If you look at image generation, um the one way to think about it is that there is a distribution in pixel space or in image space where all the images live, right?
What an AI model or generator does is that it just learns this distribution and once we learn this underlying distribution of where natural images or real images are living, we will just sample from that probability distribution to generate a new image.
So every image a generative model has made is sampling from probability distribution. Every text which a generative model has written is sampling from a probability distribution of tokens. Essentially what I'm mentioning here for words or tokens is a very similar concept which applies to images as well.
Creating a new image using uh midjourney or stable diffusion. So let's say if you look at images created by stable diffusion technique if you take it any any image which is created by stable diffusion which is an AI generated image or let's say um I'll type here midjourney image this is an image which is created by AI right this one way to look at this image is that it just sampled from a probability distribution of images and that provides a whole new way of thinking. It's so powerful because once you notice or once you have the underlying probability distribution, you can generate you can generate infinite number of images from it because every time you want to generate a new image, you just have to sample from this probability distribution. That's it.
So one thing which I really want to emphasize in this lecture is that generation is actually an art of one way to look at generating is sampling from a probability distribution. So all of you who are into the field of generative AI, language models, image generation, diffusion, etc. don't just have a deterministic mindset. Think about things from the world of probability distribution. So until now we have seen that um language model text generation is a probability distribution problem.
Image generation can be thought of as sampling from a probability distribution.
Uh classification is distribution too.
when we predict a certain class of image, it's not just saying that this is my this is an espresso. I assign a probability to all the possible classes which might be the answer.
Then one surprising thing is that regression which is here if you see the dotted points are my uh ground truth and the line is my prediction. Right? So you might be thinking where does the probability distribution come here? But even here we have the probability distribution because when a model predicts let's say the price is $500,000 what it's really saying is that the price is most likely to be around $500,000 and less and less likely as you move away from it. So if you zoom into here if you take a look at this this circle is my actual data and this line is the prediction. What this line is actually saying is that at this x value, the probability that the output is closest to the ground truth is the highest over here at this y value and as I move away and away from it in the upward direction and as as I move away in the downward direction that probability actually decreases.
So even this is a probability distribution and to to to kind of look at it clearly if you see uh here near to the data the probability is maximum but as you move far and far away from the data the probability actually reduces and this can be thought of mathematically also we all have all of us have used the mean square error when we have looked at regression problems right the mean square error is just the distance between the prediction and the truth.
There is one more way to look at this loss function.
And I'm not going to go into too many mathematical details here. But if you assume that the data is a bell curve around the model's prediction like this and you ask the question what makes my data most likely and purely from mathematics you can get that minimizing the if you make if you minimize the squared error that's what makes your data most likely uh based on the model. So the mean square error is not an arbitrary choice. It is what fit a gshian looks like when you write it down.
Anyway, so there is a whole world which is hiding here. When you look at regression, you might think that regression is a purely deterministic problem, right? But it is actually not.
You can think about this for a moment.
Even regression can be looked at in terms of gshians.
This point here which is predicted by our line is the highest probability but of approximating the data. As you go away and away the probability reduces.
So even things which would have appeared deterministic are actually probabilistic in nature and uh you know until now we have seen probability distribution in the domains of language model uh image models then we have seen it in classification we have now seen it in regression but it shows up of course in reinforcement learning as well let's Say if an agent is learning to play a game of chess or go doesn't compute the right move.
It holds a policy which is a distribution over all the possible actions and then it samples from that distribution.
That is how the agent explores. The agent does not explore deterministically.
The agent explores through sampling.
A policy is a distribution over the actions and the agent chooses that action with the highest probability and this is of course related to the idea of bashian thinking. So if you think of your own knowledge in the world as a distribution that's a prior and as you grow in life as you have more experiences you that evidence starts to shift. So it changes your prior distribution usually makes it more sharper since you get more confident with time.
But anyways our whole way of thinking itself can be boiled down to a probability distribution. And as I mentioned this does not stop at artificial intelligence. Everything around us is a distribution. Whether language, quantum computing, quantum wave function, uh prices, dice, genetics, the whole AI world around us.
So the reason probability feels like the native language of so many sciences at once is that they are all describing the same thing. A world that does not hand you answers only spreads over possibilities. And that's how we operate in real life, right? No one really knows anything for sure. Everything is just a probability. So probability if you think in terms of distributions that's very intuitive.
This mental model I really want to emphasize a lot because not many people people think that probability distribution is a very hard concept and they won't understand it really. But it's not like that. If you just revise the concepts of probability uh or a probability distribution and if you start looking at life in terms of a probability distribution, I think you will become a much better AI researcher because probability shows up everywhere.
After all, AI is just modeling or going after finding patterns, right? And trying to mimic human intelligence and all of us do think in terms of probability distribution. So it makes sense that probability distribution is such an important mental model in AI.
So if if there's a weak AI engineer and they see a model only as a machine that returns an answer, they'll be surprised that it gives different answers each time. But a strong engineer sees the distribution behind every answer and none of it is surprising. Different reply, you sampled again confidently wrong. The distribution was peaked in the wrong place. If the output is wild, it just means you flatten the distribution before sampling. So if you think in terms of distributions, you'll just become a much stronger AI researcher.
Um as a rule or as a mental model, when a model does something you don't understand, don't ask what answer it gave. You can ask what distribution is it sampling from and why is it shaped that way. When you see an image generated by an AI model, think about the distribution from which that image is sampled from.
This is also called as distributional thinking. Deterministic thinking is comfortable. It's fine. But distributional thinking is hard. But it will make you a very strong AI engineer and AI researcher.
We have covered so many mental models in this series. Now and in all my lectures I try to keep it at a high level so that you are inspired by the concept and then you can dig deeper. For example, if you want to dig deeper into softmax go ahead and try to learn about it. If you want to dig deeper into how probability distributions are related to regression, go ahead and try to learn more about it.
So if you think if you want to learn more about policies and how an agent makes a probabilistic decision when learning to play chess, go ahead and learn about it. My job is to just show you that probability distribution shows up in several domains of artificial intelligence. So next time you're stuck at a problem or you're thinking of a new research direction or if you're working on a AI product, maybe this thinking can help you come out of it.
Also, next time you read a paper which is about distributions, don't be intimidated about it. Just boil it down to first principles. Boil it down to one of the mental models which we have learned. So things will stop being overwhelming and you'll if you start seeing patterns in AI around us, right? Every time you see a new research paper or a new news article, don't be overwhelmed. Just put put it into one of those patterns.
That's one of the main purposes of this series. Thank you everyone and I look forward to seeing you in the next lecture.
Related Videos

Expanding Stikbot thumbnails
leopoldshorts
2K views•2023-09-24

Digital Discrimination: Cognitive Bias in Machine Learning
redmonktechevents2974
4K views•2019-12-18

Evolutionary Approach to Clustering by Ujjwal Maulik
ICTStalks
279 views•2019-06-26

Rose Yu "Learning from Large-Scale Spatiotemporal Data"
networkscienceinstitute
2K views•2019-03-04

Stanford Seminar - Generalization through Task Representations with Foundation Models
stanfordonline
4K views•2025-07-14

Satellite-Based Wheat Yield Forecasting using GEE & Transformer Neural Network
gisrsinstitute
634 views•2025-06-15

Paradigm Shifts in Data Processing for the Generative AI Era: Robert Nishihara of Anyscale & Ray.io
GradientFlow
2K views•2025-01-02

How to Build Your Own GenAI-Based Knowledge Management System
2150GmbH
360 views•2025-06-03
Trending

WOW! Judge TURNS THE TABLES on Trump in His OWN $10B LAWSUIT!!!
MeidasTouch
197K views•2026-07-23

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23

Steam and Xbox Just Dropped The Hammer On PlayStation
OhNoItsAlexx
9K views•2026-07-23

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23