Story Samurai

In this conversation, Sam Dhar explores the concept of AI through the lens of probability distributions, explaining how AI models amalgamate various information sources to produce outputs based on input data. He emphasizes the non-deterministic nature of AI, driven by its ability to choose from a vast array of information sources.
★ Support this podcast on Patreon ★

What is Story Samurai ?

Explore your curiosity - Interesting people with fascinating stories.

Life consists of three things:
-The stories we tell others
-The stories others tell us
-The stories we tell ourselves.

Speaker 1:

Sam, welcome aboard to the show. Thank you so much for joining us today.

Speaker 2:

Thank you, Ari. Glad to be here.

Speaker 1:

So, Sam, are all engineers gonna be fired at some stage? Is is AgenTic taking over the world? There

Speaker 2:

I would have to say yes and no. Because there's a there's a little bit of a possibility of workforce thinning over the next few years, but only for the short term. And over the long term, I don't think that's going to happen.

Speaker 1:

Okay. So let's, let's take a one bite at a time. Way you eat any good elephant. What is for those of us who are kind of not in the loop of AgenTic and what it's doing to to the industries, give us just a short intro on how the world has been changing over the last two years.

Speaker 2:

Absolutely. So what we've seen over the last five or three to four years with the advent of AI is like, there's this hype around AGI, but that's kind of an ill defined term. Then there's a constantly changing, constantly evolving technology that is evolving really, really fast and the landscape around geopolitics and the economy and everything else that is also trying its best to catch up, but it still kind of feels like a San Francisco consensus as Eric Schmidt's put, puts it. But long story short, what's happening is there's a new technology that is being introduced just like a bunch of different times, across history that this has happened when efficiency is being introduced on mass into the system. And because of this significant efficiency, a lot of things will change across the board and we're just kind of coming to terms with it.

Speaker 2:

So for example, the.comrevolution or the internet, when it first came about, it disrupted a lot of industries and a lot of, it was completely a bubble at a time, but the biggest players emerged and the ones that were kind of playing around the technology, but really not producing value disappeared. It's going to be kind of similar with AI. We've seen the bigger players emerge with really strong moats over the last few years, and now they're kind of taking along with them a lot of smaller players. And now it's time for the technology industry to evolve around this new way of working, which is significantly more efficient than we used to work before in the age of the internet. So it's very similar in terms of the trajectory.

Speaker 2:

And when it comes to agentic systems, it's just a newer, fancier way of using AI. I would say just general, like to integrate AI most effectively into the way we work as humans, to be able to actually make AI usable with all of its non determinism and all of its unpredictability. We've created something called agents and agents are, just for folks who don't know, agents are a nicer term to represent this concept of AI with a set of tools and a little bit of memory and abilities to review its own outputs before it can iterate over it and produce even better outputs over say 10 iterations and just slightly better when it comes to an AI system that is completely reliant on its non determinism to produce, you know, output. And now agents are just a better version of it, which with some extra tooling and the abilities to review its own output and improve on it. So yeah, that answer your question?

Speaker 1:

But,

Speaker 2:

yeah, that's basically what has come about in the last few years.

Speaker 1:

So this new technology has been introduced. And as you said, over the ages, you know, we've had the the printed press, we've had the wheel, we've had the Internet, we've had these innovations come, but the problem is it seems to be coming faster and faster. It took twenty years for the microwave to go from the labs to every house, but you know, Chattypeachy did that in what months? It's a pace of innovation that seems to carry with it some inherent risk. You said that in the short term we are looking at kind of widespread redundancy or maybe widespread negative impacts.

Speaker 1:

What do you think that's going to be?

Speaker 2:

So one of the reasons why I think there would be a workforce thinning in the shorter term is because of the usual way that this generally happens. There is a lot more efficiency that is being introduced way too fast. Everyone wants to use AI to be able to do their own work faster. And this is going to make a lot of, there, there are two possibilities essentially. One, we just operate 10 times faster because it's just everyone's 10 times more productive.

Speaker 2:

So everything just happens 10 times faster. Everything across the board. Say all of the industries that are not very tech savvy also start relying on AI to do a lot of their work, law, governance, all of these text heavy industries. If they also start using a ton of AI to do a lot of the work a lot faster, things would just operate a lot faster in the real world, which is great for everyone, but it appears that that's not going to happen anytime soon. Although within some of the industries, there will be a lot of automation and a lot of productivity gains that would cause the businesses to realize that we can do the same amount of work or operate at the same speed, but with a fewer number of workers.

Speaker 2:

And that is what I mean by workforce thinning. And that is something that happens often, like every time some of these bigger technological changes happen and it's the same with AI.

Speaker 1:

So, I mean, it, it's, it sounds clear from your narrative that there's going be winners and losers, right? There's going to be people who get these productivities on the personal level and there's going to be people who are you know within that group of the people that are you know unemployed or as you say, is the advice that you would give to you know a 20 year old or 40 year old anybody in any stage of their career to make sure that they're on the right side of this change?

Speaker 2:

Absolutely. That's a great question. One of the most important things that you've, I'm sure you've heard before is do not rely on AI when you're learning. At least in the early stages of your career, focus on being able to evaluate what AI produces. That is the one skill that you're going to need.

Speaker 2:

Sure. AI can help you to operate faster, produce work significantly faster. But if I often say like, can't ask a question in a language you cannot understand the answers in. It's the same thing with AI. You cannot rely on AI to do the work for you.

Speaker 2:

You have to be able to evaluate every line that, or every picture or every pixel that the AI produces. And so my advice generally to young people is be very cautious what you're doing with AI and, and only use it to enhance your own knowledge. Cause there are a few different things that you can do to evolve yourself along with AI. Learn, learn faster. Thanks to AI.

Speaker 2:

It's basically a very patient teacher that can guide you, including just evaluate multiple different strategies that you're trying to choose out of. And sure, in a lot of cases, someone who's 20 years of age and just starting out and has no idea how to evaluate strategies. Well, that's something that AI can also help you learn by just asking questions like why is this strategy better and why would, what are some other options that we could take here? Is there something completely out of the mix that you can suggest that might also be helpful here? You keep iterating and answering and learning at the same time.

Speaker 2:

Yeah. To answer your questions, learn, know how to evaluate before you use AI.

Speaker 1:

So there's a very interesting underlying premise of the technology. We got calculators, right? People were upset about the fact that there were actually people who would do calculations for you would be out of a job. And you know, so we lived through that, but calculators work. If you put one plus one into the calculator it always gives you the answer too.

Speaker 1:

We have something right you called it non deterministic in AI where you know if you want to be dramatic about it you know I had a CTO says that AI lies to us right? So it doesn't always give you the answer. I had a psychologist say that AI is a psychophant, right? It tells you what you want to hear. You know, there's something about this technology which is different than technologies that have come before.

Speaker 1:

And you're pointing that out and saying, hey, you know, we need to work with it in a certain way, in a careful way, we need to actually interact with it. What does that look like? What are the life skills that we need to build and not just completely rely on AI? How do we build that? I'm an 18 year old, should I still go to university?

Speaker 1:

Should I study just with AI? Are there certain courses and techniques or methods that I should learn in order to know how to do this properly? How do I future proof myself as a youngster?

Speaker 2:

Sure. So first I'll answer an interesting parallel that you pointed out, is how calculators came about doing some of the hard work that you would have to do as a human and taking that on and doing it deterministically. And that is a great observation because that really ties into what we're talking about with AI. Calculators were something that eventually became computers and computers evolving out of calculators is really interesting because we wanted something that can do one thing deterministically over and over again, every single time it's the same exact thing. It's an algorithm.

Speaker 2:

It follows it to the T and it produces output. Now what's happening is a very different thing. We're going backwards. We're saying, all right, we have figured out how to build this age of digitization, the digital age that we're living in, and we know how to replicate things infinitely. We know how to get things across to any corner of the world, like in an instant, but now we want something that can understand our nondeterministic.

Speaker 2:

So we're going backwards and creating a technology that is similar to us, similar to us than, than computers. So we're kind of building within these deterministic systems and a similarity, a similar system to ourselves. So that is an important distinction to remember because that is why this technology is so much different from anything else that has come about in this tech era or the tech.

Speaker 1:

And it's worth mentioning, sorry to interrupt that the basic mathematical principles that make AI work or really what we should call them as neural networks or generative neural networks were modeled after the structure of the brain. So we set out to build something that would work like a human brain and it took us many years, more than twenty Exactly. Kind of figured it out. So we have something that is nondeterministic because that's how the brain works. Right?

Speaker 1:

People don't always get the answer correct. And we built that. And, and you're almost proposing. Go ahead.

Speaker 2:

And we built it to address a a gap in the system, which was our own in nondeterminism, and we wanted it to be able to get it. All of this language that we speak in needs to be understood and, like, computers don't understand it. So another interesting thing that we built before was computer programming languages. And now we're going backwards. We're going back to English and and, like, natural language to be able to talk to computers.

Speaker 2:

And with that comes, comes this, like you said, just the nondeterminism, which is similar to us than what computers were initially built for. And so the interesting thing here in this new trend is we introduce non determinism into the system and now we're trying our best to control the non determinism when it was the first, like was like the definition of

Speaker 1:

stupid, right? We built non deterministic when we had deterministic and then we built non deterministic and now we're changing or trying to make the non deterministic deterministic in a way but we want to keep all the advantages that it understands our own non deterministic so it kind of feels stupid in a way but but in essence what we're trying to make them is enable them meaning the deterministic animals be able to communicate with non deterministic creature which is human beings and still give really deterministic or more so valuable results. And that's a really hard thing. So let's talk about why we're failing to do this. What are hallucinations?

Speaker 1:

Where are agents failing today? We can talk about coding or vibe coding a little bit. Where are engineers coming to vibe coding or agents and they're like, okay, this doesn't work.

Speaker 2:

Hallucinations aren't like, I like to keep put this in the premise itself because they were by design, the thing that we wanted to build into the system. Now, hallucinations specifically are this, these sorts of like information mimicry when there is none, when there isn't like, there is no real thing, but it is producing it just to mimic how information would look like if it was there. And I like to point this out to everyone that I've talked to AI. If you really wanted to understand it from a determined, from a mathematical lens, it's very similar to a probability distribution, like kind of like a, an amalgamation of all information sources in the universe, subsumed into one model, which produces output based on whatever is fed into it based on a probability distribution and all of these information sources, it chooses out of one out of those 15 or 100,000,000, different information sources by seeing the input that it receives. And so the idea that it has to choose out of out of all of these information sources to mimic one is what drives its nondeterminism.

Speaker 2:

It has, let's say you ask it to be, hey, you're a software engineer. Tell me how to do this. Now it has hundreds of software engineers, hundreds of thousands of software engineers, texts that it has been trained on and has to choose one out of those hundreds of thousands of software engineer texts that it has read and trained on. And that's where this nondeterminism is first injected. And every once in a while, it just does not know, like, where, how to answer a question, because the question itself is sometimes a trick question.

Speaker 2:

So what it does in those situations is it makes up an information source and pretends that it has the information that it needs when it doesn't because it's never seen it before. The whole That's idea of

Speaker 1:

what my five year old does as well. I'll just point out that that's a very human characteristic.

Speaker 2:

Yep. Yep. And I, I love that you're, you're getting it exactly what I'm trying to say, because it's, it's a difficult concept to, to grasp. A lot of people like to believe, oh, maybe AI is sentient or maybe AI is just actually intelligent. It's not really intelligent.

Speaker 2:

It's a mimicry of intelligence because it has seen a lot of text that has been produced by intelligent people. And there's an interesting trend that you'll see where we call it hallucinations, but it's inherently a quality of of just modern AI, to be able to control it. So I work at Galileo. We're like the top evaluations platform for AI. So we rely on hallucinations to exist, to be able to fix them.

Speaker 2:

And there's a, like, there's an entire business, like an industry around this concept of catching these problems and hallucinations and inaccuracies and context irrelevance in model responses. And it becomes a major problem because even if it's like 1% of the time, 1% of like hundreds of millions of customers interacting with your systems daily can be a lot of people going through those problems. And the the kinds of things that we use to detect those problems are also inherently nondeterminist. So we, in a lot of situations, we use LLMs to detect problems in responses from LLMs. And I've done this in my scientific work too.

Speaker 2:

I'm evaluating a paper, and I ask AI, hey, point me to all the problems in this paper. And it gives me some very hard, clear examples of things to look out for, and I know how to evaluate it. But for example, I didn't. I would pass it into a different model and ask feedback on the feedback that I received from one model. So you go back and forth and it actually helps identify and rule out some of the accuracy problems and, contexted relevance and things like that.

Speaker 2:

Very interesting ways that we're trying to solve it.

Speaker 1:

It almost sounds like, you know, you have a couple experts and just thinking through it with a few experts, not just one can give you a better result.

Speaker 2:

Yep. Absolutely.

Speaker 1:

So, so I want to break some, some kind of myths or maybe what people think about AI. If AI is working poorly, is the answer just to give it more data specifically in the agentic context?

Speaker 2:

If AI is acting poorly or?

Speaker 1:

Yes. So we're asking AI a question. It's not getting the right answer. Is, you know, programmers working with LLMs and such, is the answer always just to give it more data? Is, is larger context context always better or is sometimes smaller context?

Speaker 2:

So more recently there's been bigger, more solidified way to understand the AI stack. They're calling the AI stack. There are a few different ways that people try to address these problems. Just, you know, AI not working as you would want it to. So what are some of the different ways that you can fix it?

Speaker 2:

And the layers in the AI stack start all the way from the infra layer. So you have like a bigger model running on a bigger piece of hardware that can alleviate some of the things. Like I said, the amount of information that these models contain in within themselves is it only tends to be growing. So that's the infra level. The next one is And

Speaker 1:

I'll the just point out that at that level, you as a user have no control. That's the training level.

Speaker 2:

Yes. You could have five GPUs or you can have one big GPU. And that's the decision that you have to make to try to see how much faster you can get the same quality response or how good the quality could be if you just went with a bigger model with a faster infrastructure that it's running on. But some of the ways, and then the second comes in the actual model itself. You switch to a different model, maybe that helps.

Speaker 2:

The third layer in the AI stack is the data layer. And that's where the rag systems and all of the agentic tooling sets. So you add some more tools so the agent on top of it can actually query some more data and then review its own output, make some decisions intelligently, and then maybe make some more tool calls, things like that. Fourth layer being orchestration. So where all of this comes together, essentially what tools do to call, how to bring everything together, essentially what you would call context engineering.

Speaker 2:

So that's where you can also do a lot of cool things to be able to improve your experience with the AI. And the final one being the app itself, the way the information is presented to the user, all the things that you can see on the, on the, and then also integrations like that. All of those things kind of come at the app level and infra model, orchestration data and the app, these five layers doing a little bit in each of these can go a long way when it comes to improving AI experience for the users.

Speaker 1:

So I wanna I wanna zoom into context engineering. That was the one I was kind of leading you towards. What does that mean? And I would argue almost that that's the most useful one when you kind of think about just everybody using AI on every day because that impacts on how you almost engineer or create the context that goes into the agent, the information that you give the agent. So kind of help us understand what that means and what are the levers that we pull when we're doing context engineering.

Speaker 1:

Mhmm. Mhmm.

Speaker 2:

Yeah. That is the, honestly, the most complex of all of these five levels of abstraction that I described. Currently, there's a lot of research and a lot of different strategies that are being tested to be able to build context most effectively. And there's an entire effort to actually expand the context windows, but then there's the other, effort, which is to make the best use of the context and to be able to summarize efficiently to have the most important pieces of information in the summary. So I would say there are some common tricks to try to manage context better, but, but that is one of the most complex pieces of the puzzle now.

Speaker 2:

And who would have thought? Cause once it used to be called prompt engineering. You put a bunch of different details in the prompt and you expect the model to know and remember everything. And it has interesting with the advent of agents context is just always too short. The window just has to be longer and longer.

Speaker 2:

But yeah, there are some very interesting initiatives that are being tried out, to build and maintain context over time, but it's definitely one of the more complex areas.

Speaker 1:

For example, just to make this for, for everyone and every day, when you're using ChatGPT, if you throw too much information at it, it will shout at you that it's, the chat is basically finished. It's out of context. And if you give it too much information, then it seems to work less better. It actually can go in many different directions. So you kind of see its non deterministic behavior more highlighted, but if you give it narrow context, you tell it to do something very defined, very directional, it actually gives really great answers.

Speaker 1:

So it seems to be that in many cases narrow context is actually better than wide context which is kind of counterintuitive because the whole reason that generative AI works is because they threw a lot of data at it so we just thought okay let's continue to throw more data at it and it will work But it seems that when you're using the the models as opposed to when you're training it, it's the complete opposite.

Speaker 2:

Yep. I completely agree. What you pointed out earlier in the call was the fact that we throw more data at it, give it more clearly defined information, and it would produce better results. And that's not always the case. And I like to also mention or call this concept a complexity pyramid, because what happens is if you have the ambiguity in your request is too high, it has to make a lot of decisions starting from that point all the way to a working solution all by itself.

Speaker 2:

And each of those decisions that it's making, so you say, Hey, build me a to do list app. And it has to figure out all of the various decisions at every level all by itself. Like what is it for mobile? Is it for web? Okay.

Speaker 2:

Let's say I create a, I make it for the mobile, like what kind of frameworks I would use? So all of those decisions are all made at runtime, all in this one big prompt. And it always ends up going in all of these various different directions. As opposed to what has come about as like, pretty common practice across the AI coding industry at least is you plan. You plan out exactly how you're going to do something.

Speaker 2:

And then you iterate over the plan before you're completely certain that this is all of the decisions that I need initially to get started at this level. And that has worked wonders for me. And to be honest with you, I don't just use AI for my programming workflows. I actually use AI for, for my legal, for my taxes, for, for everything by essentially planning around all of the nondeterminism to make sure that the model is clear. And I have a checklist to evaluate its outputs do you evaluate from the plan itself.

Speaker 1:

If AI is working properly, if you're not an expert in that domain. So it tells you, hey, these are the legal recommendations, this is the contract, but you're not a lawyer, how would you evaluate something that you have no expertise in?

Speaker 2:

Exactly, and that is a real problem and you have to be very careful while trusting anything that the AI says. It it has happened to a lot of high profile court cases where

Speaker 1:

lawyers lawyers. Yeah. They do have the expertise. Exactly.

Speaker 2:

So you just have to be really, really careful to evaluate every line that is produced out of these models and which is where AI evolves as an industry comes in. You integrate one of these evaluation platforms and you make sure that you kind of track what parts or what responses are problematic and you fix those. Many of the, in many of these cases though, adding a simple line into the prompt itself, watch out for this problem, actually tends to fix a lot of these hallucinatory issues. But again, you can never fully trust it because you add one line to watch out for a specific issue and it seems to miss something completely else or takes it in different contexts. So there's always evaluate, evaluate, evaluate.

Speaker 2:

That's the name of the game. And like you said, with someone who actually has expertise in the thing that you're getting evaluated.

Speaker 1:

So, Sam, this has been wonderful. We're almost out of time. I have a question. Right? I have younger kids, 13 and younger.

Speaker 1:

I look at the future and I just don't know what are the jobs, roles, professions that are gonna exist. I mean, I kind of feel like, okay, anybody who's doing physical labor is probably not going to be affected in the short to medium term. But how do we, how do we plan? What should we send our kids to study? What's, how do we know what the future is going to kind of make them future proof?

Speaker 2:

So I I've written a piece. I published a piece recently called the end of the digital age. And in it, I argue that because of digitization of all information, of the advent of the internet, we were able to build these systems we call now, we call AI. And one of the major problems that we're still kind of in the middle of is attribution. AI mimics people's skills that they've built over decades, and now there's zero attribution.

Speaker 2:

So there, there is a lot of very, I would say contentious and like lots of back and forth in the courts around the copyright of the information that AI is trying to mimic. So this, you could take this as like a silver lining that one AI will at some point be contained and which to me, at least it seems like, which is the reason why they're trying to progress so fast. By the time these court cases are done, they would already have stolen and trained on all of this information of the world that we produced over decades as humans. And now they have these systems and, and this argument that, oh, now everyone depends on it. We can't just make it illegal because yeah, we stole it, but Hey, so it's already too late for that.

Speaker 2:

And the positive outlook that I was trying to tell you about was over time, human skill will try to move more and more away from digitization itself. So there's a chance that if all photographers and all reporters and everyone starts using something that is non digital, that is actually hard, tangible things. It would make it really hard for AI companies to be able to train on it. Over time, we either move completely away from the digital world, or we just use a ton of encryption, a ton of paywalling, or just build our own small LLMs for AI to be able to access some of the information that we're talking about building in using our personal skill. And your question about what are some skills that are worth building in this age of like, you know, in this digital age?

Speaker 2:

Cause yeah, I can always replicate it and do better and without attribution. So how do you even plan for it? The easy or the difficult answer right now is we don't know, but the silver lining is there are people trying to figure out way forward from here. So either the copyright cases actually come to a point where we know that there will be attribution or we just stop putting up our information, our pictures, our any of our skilled work on digital platforms. So it cannot be copied and mimicked by AI.

Speaker 2:

And those are the two trajectories we will see evolving over time.

Speaker 1:

It seems to me that, you know, at the end of the day, there's human fundamentals that we're never going to leave, right? People are going to continue to get sick. People are going to continue to fight among themselves and probably nowhere in the short term you're going to have a digital lawyer actually show up in court, know, in front of a jury of your peers, that's probably not going to happen anytime soon, know, maybe in the movies, maybe in you know fifty years, maybe sooner, we don't know. But there seems to be like these, the fundamental human condition is not going to change so I'll share with you that you know I'm pushing my daughter to actually learn, lean into the arts because I think having that creative spirit and innovation is going to be something of value and my son is learning law. So you know, think of those two things and maybe many others like healthcare are probably going to be safe in the short to medium term.

Speaker 1:

But you're right, nobody really knows because we're seeing computer science graduates go and work in Walmart was a recent news article that came out. So I I think there's concern across the board.

Speaker 2:

Yep. Yep. Absolutely. And as you pointed out, some of these high stakes industries would be the last to be replaced by AI if that ever happens, thanks to the nondeterminism. Completely agree.

Speaker 2:

My brother, who's an anesthesiologist, always worries like what if, you know, robots and AI get so much better from now that they replace the necessity for his skill. And I always tell him the problem is not the inaccuracy that AI comes with because AI could probably do better over time. The problem is accountability. When something actually goes wrong, let's say with air travel or with, anesthesiology or what have you. Every once in a while, things go wrong, people need someone to take accountability for it and it cannot be AI.

Speaker 2:

So, and that's already been seen in autonomous driving vehicle companies where entire companies were shut down because of one human being killed because of their accident. So something

Speaker 1:

You there you think there's gonna be a shift in our our mindset? Because, you know, when we look at the number of accidents that we have through human beings driving and then we compare it to robots potentially driving, it's gonna be much lower and yet we're horrified when that miniscule comparative percentage happens. Do you think we're just gonna change our minds and be like, you know what? Machines also have accidents, but it's way better than human beings driving.

Speaker 2:

Yep. I I I personally feel like it's never going to, be a place where we would be able to accept a lifeless machine killing a human being and be okay with it. It's already been being debated as like a thing that we should completely block out from wars, you know, drones that actually kill humans. And so that being okay when it comes to people driving on the road, I think that was extremely unlikely for humans to ever let that slide.

Speaker 1:

Sam, what an absolute pleasure. I think we take away from this that there are many more questions than we have answers to. I appreciate you coming on the show today. Thank you so much.

Speaker 2:

Thank you, Ari. Wonderful talking to you.