The AI Fundamentalists

Utility functions: Building smarter AI agents from the fundamentals, part 2

Dr. Andrew Clark & Sid Mangalik Season 1 Episode 33

The hosts look at utility functions as the mathematical basis for making AI systems. They use the example of a travel agent that doesn’t get tired and can be increased indefinitely to meet increasing customer demand. They also discuss the difference between this structured, economic-based approach with the problems of using large language models for multi-step tasks.

This episode is part 2 of our series about building smarter AI agents from the fundamentals. Listen to Part 1 about mechanism design HERE.

Show notes:

• Discussing the current AI landscape where companies are discovering implementation is harder than anticipated
• Introducing the travel agent use case requiring ingestion, reasoning, execution, and feedback capabilities
• Explaining why LLMs aren't designed for optimization tasks despite their conversational abilities
• Breaking down utility functions from economic theory as a way to quantify user preferences
• Exploring concepts like indifference curves and marginal rates of substitution for preference modeling
• Examining four cases of utility relationships: independent goods, substitutes, complements, and diminishing returns
• Highlighting how mathematical optimization provides explainability and guarantees that LLMs cannot
• Setting up for future episodes that will detail the technical implementation of utility-based agents

Subscribe so that you don't miss the next episode. In part 3, Andrew and Sid will explain linear programming and other optimization techniques to build upon these utility functions and create truly personalized travel experiences.


What did you think? Let us know.

Do you have a question or a discussion topic for the AI Fundamentalists? Connect with them to comment on your favorite topics:

  • LinkedIn - Episode summaries, shares of cited articles, and more.
  • YouTube - Was it something that we said? Good. Share your favorite quotes.
  • Visit our page - see past episodes and submit your feedback! It continues to inspire future episodes.
Speaker 1:

The AI Fundamentalists a podcast about the fundamentals of safe and resilient modeling systems behind the AI that impacts our lives and our businesses. Here are your hosts, andrew Clark and Sid Mongolek. Hello everybody, welcome to today's episode of the AI Fundamentalists. I'm here with Sid and Andrew and we are excited for this episode because the episode before this, we set it up that we're going to be doing a series on mechanism design and the parts on actually building from the ground up safe agentic AI systems, what it takes, what it doesn't need to take, so to speak, and we'll get into that in these episodes.

Speaker 1:

But before we begin, one of the things that Sid and I were talking about before we started this recording we haven't talked a lot about the news, especially over the past few months. We've had such interesting guests and we, you know and quite frankly I don't know how much of our podcast can actually help some of the news that's out there today, you know. But we're excited because there are some things that are on our desk that are reading, that we're reading right now. Sid, I should ask you because I gave away my answer too early and I'm going to hold mine what's on your desk right now?

Speaker 2:

My desk is something very different. I've been reading a lot about like living in this very digital world and how that's affecting our like dopamine receptors and how it's affecting our ability to like, stay happy and be motivated and get stuff done that we want to get done. So, beyond just like productivity hacking, which I'm sure there's a lot of publications out there on, I think that we're learning that like it's becoming a hard world to be a human in and it's a hard world for young people to operate in, Saying nothing about like you know, how chat CPT has has made schooling very difficult. Kids are struggling a lot with, you know, with addiction to all these digital medias and you know what. What lessons have we learned from studying them that are applicable to us? What lessons have we learned from studying them that are applicable to us? So a lot of good research happening out there and that's been really fascinating to read and good to just reflect on.

Speaker 1:

Interesting and you know, andrew, before we started, I was telling Sid about an article I read and actually said this actually aligns with some of the things you may have been reading about emotions and the technical world and dopamine receptors and things like that. From a different point of view, one of the articles that I saw, or research that I saw I posted it on my LinkedIn was about you know, are we phoning it in if we're using generative AI? And like really like the lack of critical thinking To your point, like some about what's happening with youth, and like really anxiety and that that ability not to think, um, this was going through, this was going through and saying like you're not really phoning it in if you're applying the same principles that you would if you didn't have generative AI and you were putting together research. And it sent me down two different tracks. One are we putting in the processes of, like you know, you know, generative AI. It can, it's predicting what the next word might be, but it does not know what the future is, so you're always grappling with that whenever content is being produced.

Speaker 1:

The other track that I'm going down, that I went down with this, is the parallels between the academic community and marketing maybe in particular, b2b marketing in just how much we have to do to vet anything that's written research collated, aggregated into some factual defense of that research. We go through similar things when we're planning for brand. When we're planning brand messaging product messaging, solution messaging there's views and there's moats. All of the detail is in the moats and you have to vet that that's growing in an appropriate manner to make sure that the view stays consistent or, like you can see, the vision of what you're actually trying to prove with that research or those facts. A long-winded way, I got a lot out. I probably got a lot more out of that post than the researcher actually intended, but it's true, like we're critical, thinking is in chaos right now in many worlds. I want to ask what's on your desk, but I know that you're going to have thoughts about this as well with gendered AI, so go ahead and pick which one you want to start with.

Speaker 3:

Yeah, well surprisingly and we did not plan this, but, as Sid, I've been reading somewhat similar to what you're doing as well. So I just finished. Know, I'm a runner so I kind of biased towards some of that stuff. But there's a one of a great coach out there, steve Magnus. Um, he has a book called win, the inside game, which is very much kind of along these lines of you know how to survive in, like, the crazy world we're in now. So it's written from the perspective of like a runner and some of the coaching and things he's done. But it's very much about you know, like how to unplug, how to like keep up with the like the torrent of chaos and things like that. And like you know not define yourself necessarily with you know your job or like outcomes are happening and things like that. Another good book that I read last year so I just finished that one, but last year was Ryan Holiday.

Speaker 3:

I mentioned, I think, think, him on some of his books before, but stillness is the key. You know. It's really like, as we're seeing, with more the ai and the more craziness and the more like you have more things on the treadmill you have to keep up with right in the rat race. It's like how do you actually unplug more and sometimes like the less is more and like we're in this constant like cycle. You have to do more and more and more, but actually like the more original thinking and more things is more stepping away and doing less. And how do you get the discipline to like not do things and be in stillness and and things like that, so that that reminded me of the ryan holiday book when I was just finished up the steve magnus.

Speaker 3:

But this year I've really been trying to like some of these conversations we've had here is really trying to go more back into, to reading and more like trying to do more of the unplug and just read more classics and things, because the more we get into the whole ai world and things, the more of like understanding the humanities isn't like you were talking about as well of like how, like getting that back and thinking the more macro and abstractly and like remember people that don't understand history are doomed to repeat it, that kind of thing. So really been trying to get back into that as well as getting into some textbooks. I'm reading a mathematical econ textbook, so that kind of is obviously biasing a little bit of our conversation, the last one, this one in the preceding series. But I think, strangely, the three of us kind of had the same sort of things we're looking at and I promise you this was not planned, this is just us riffing off the cuff, but it's kind of interesting how we all triangulate around the same thing.

Speaker 1:

The things that we've been talking about over the past year, like things are finally coming to roost because it's coming from many different directions. You've got companies that are really figuring out that like oh AI, like generative AI, ai or making all my things. Ai is not an easy lift, and I'm not even saying that people thought that it was. I just don't think they really realized how hard it's going to be. Case in point, the series that we're going through right now. But I also think that it's giving people time. Because it's slowing down or because that lag is starting to hit. It is making people ask more questions than they did when the hype cycle first started. So it's right that we're probably all circling around the same things from very different perspectives, because everybody's starting to come into that's all starting to come into play.

Speaker 3:

Yeah, it's really this perspective and that's what I'm trying to get more of is like that perspective, because the media is just getting more like more acceleration, more like things and like more minutia and what really like. I've been also going back and reading the original GPT-1 paper and things like that and even the most recent GPT-4 system cards and things like this. What's really crazy is even open eye what their researchers are actually saying their system does, which, by the way, has zero on their testing, 0% full performance on an agentic workflow, versus what all the analysts and everybody in the media is saying that these systems are happening. It was also like, oh, no one's hiring anymore. Everybody's getting replaced by AI and all these crazy things. I use GitHub Copilot every day. I'm still waiting for it to be able to write a program without needing a ton of edits.

Speaker 3:

Like the amount of what the rat race that you hear versus reality. And like all this Gen AI craze. Like we're not going to just have a Moore's law. Like, fundamentally, don't think and this is I'm not alone in this Like we're going to somehow reach this intelligent system with the current paradigm by just throwing more data at the problem data. So it's gen ai data feeding into gen ai data now, uh, you know, there's even studies and models decaying on some of these things. So it's just crazy like you.

Speaker 3:

Actually, this is where the perspective of step back and see like a lot of this is just media. Let's freak everybody out. Let's everything, everything you're going to lose their jobs. It is going to replace everything.

Speaker 3:

Let's you know, versus like getting that perspective and getting back into the classics and literature and trying to do that unplug, because the more you're like stuck in the rat race, the more like you know the paranoia and like the feeling about all these things and like there's more to keep on top of and like every little generative AI update that everybody does every two weeks is somehow going to magically change the world. Versus like, if you actually macro step back, it's not that big of a deal. In the ground context and the biggest problems we have of how to actually use AI or how to like, no matter what new system comes out, companies are still struggling how do I apply this, how do I build it? How do I architect it? How do I make it safe? Like we're still dealing with the same problems of years ago, but it's somehow we're juxtaposition. It seems like we're the same spot we were years ago versus other times. It sounds like in the media, like we're so different every week.

Speaker 1:

Keep up with the changes, but I don't know. It's just kind of an interesting juxtaposition right now. Yeah, you know what else is interesting about the timing of this episode? It's almost summer, or for some people it actually is, and with summer there's travel, and with travel we get into our episode for today, the subject that we're going to talk about.

Speaker 2:

Utility functions. We're going to be talking about utility functions today, the subject that we're going to talk about Utility functions. We're going to be talking about utility functions today and we're going to talk about them in the context of our travel agent. So we'll take a step back, like you're just queuing up, and let's really think about what this travel agent is, and I think it'll really slot in nicely with the stuff we've been talking about lately. So we're trying to make an agentic travel agent. The goal is that it shouldn't get tired, it should be infinitely scalable and should be able to meet customer demands.

Speaker 2:

What does this agent need to do? You can think back to old episodes. There's four main things that we expect it to do Ingest data, reason about the data, execute on that data and then take feedback on that data and then take feedback. So for our situation, we're looking to ingest hey agent, I want to travel here on these dates and here are my preferences for the amount of luxury I want, the speed of the travel and the value of the travel. It'll then need to reason to determine the optimal travel schedule, execute an actual itinerary, creating flights and hotels and maybe even a document, and then, at the end, receive feedback from the customer. Do they like the itinerary? Do I need to make any adjustments? So a real end-to-end agent that would exist in the real world, which means all of the messiness of hotel markets and airline markets and managing preferences autonomously.

Speaker 3:

Yeah, and that's really what this whole agentic, which I actually love the concept of agentic, by the way, which is a multi-step systems that are accomplishing tasks right. So, like the whole premise of what we're working through is, the hard way of doing agentic is. I don't think that the LLM tool is what you always want to do, or there could even be, you know, neurosymbolic type representations of maybe some of the semantic. You know people want to talk in natural language, but then the actual computations can be done relatively simply, more deterministically and very much something that has a lower governance surface area. And, in any case, even if you decide you want to be using a generative AI solution, understanding the basics and how things actually fit together and what's actually happening under hood, I think is critical as, like, the fundamentals really matter and understanding the perspective and how things fit together. But, honestly, for this use case and as we're going to walk through, it's going to be a lot less expensive to run, it's going to be a lot potentially more accurate and we're adding actual method, like a theory-based rooting, for how are we doing this?

Speaker 3:

Not just LLM swag it see, whatever it comes up with on a route, but actually like how you get from A to B today with your smartphone and Google Maps is mixed integer programming, as an example. So, like the route optimization theory, how does your Amazon package get here? None of that is done in Gen AI. That's all done by these operations, research methodologies that we'll be exploring more route optimization and things but today we're going to start looking at the what are we optimizing around? And there's, of course, there's going to be like budget constraints and things. It's really a linear, linear programming We'll discuss that more in depth in subsequent episodes as well like framing of how we actually solve the problem, which this.

Speaker 3:

These are these techniques mathematical optimization that have been around a long time. But as a recovering economist, as I like to call it, I have. Economics are near and dear to my heart, so call it I have. Economics are near and dear to my heart. So what we're really going to be doing and I think it fits well for this use case is utility functions. So so do you want to talk us through a little bit of like what is utility function? Kind of like where some of the background is for it.

Speaker 2:

Yeah, of course, and so we want to think about this utility function. Let's say, in the context of our travel agent, if you had an LM to do the same job, your utility would just be like do I like the words that are coming out of your mouth or hypothetical mouth in a text box? But the travel agent needs to have some notion of what is good and what is better and what's even better than that. That's where our utility function allows us to have a deterministic measure with guarantees, with theoretical backing, allows us to have a deterministic measure with guarantees, with theoretical backing. So, at a high level, this utility function will allow our agent to exist in the real world.

Speaker 2:

If we were a machine learning engineer on the other side, we might be trying to solve the global state of every single agent and build this wonderful network that's going to do everything for us. But we want to build an agent that we can just plop into the real world and have it make this itinerary for us without having to own the entire marketplace of travel agencies. So we need this agent to be able to include personal preferences and to operate independently. This addresses a lot of the weaknesses in LLMs, in that they don't always understand multi-step. They're not good at understanding we'll say theory of mind in this sense, meaning they don't have a good sense of how other agents will react in the market. They only have an understanding of how they work in the market. Having these types of systems that incorporate these types of features allow you to more accurately model and get your desires out of the model.

Speaker 3:

And how this goes and I said I think that's a great point of like this is any machine learning. It's more of that global best fit line, can you know, can be nonlinear, things like that. But as we discussed in our last episode, we kind of set up the mechanism design and we're building a mechanism here for how the system will interact. Where we had the Vickery, clarkclark-groves potential mechanism where you have these rational self-actors with private preferences and essentially you want to have all of their different preferences just need to aggregate into the overall social welfare function where we have that equilibrium of everybody's dominant strategy of telling what their actual preferences are. So that's what we're layering in. Utility is that next layer down. Essentially we'll get into the economic, microeconomic theory and consumer's choice theory, a little bit of what is utility functions, how kind of they work, some of those more microeconomic underpinnings, but essentially what they are is they're customized loss functions. The machine learning parlays per individual. So Sid will have and when we do our like write-ups, sid has a different utility function than I do on on like, does he like when he travels? Does he prefer more luxury? Does he perform more fastest way possible or does he like a good deal. Susan will have it and these are. You have different weights you could have, so Susan will have a different one, I will have a different one. We all have slight different preferences and we have those individual.

Speaker 3:

We're going to be self-rationalized when we are comparing our travel itineraries. What's best for me might be different than best for Susan, best for Sid. We're going to be abstracting away. We're not going to be looking at the hotel providers or the hotel or the airlines, because, based on our Vickery Clark mechanism design, vickery Clark Groves everybody's rational self-interest to be in the mechanism. So we're going to just assume that side of the house. We're not going to be looking into production functions. It's in their self-interest there, you know, I want to optimize revenue. They're giving us a price which we're going to be taking at a quantity. We're going to be taking as exogenous a system which means we're taking it for granted.

Speaker 3:

We're not going to be modeling that here just for sake of our simplicity. We're going to see like, how do we wait and how do we determine that optimal basket of goods for us, of the optimal travel plan? And this is where it can be super customizable. It's something that we can be super simple of like one to 10, sid, susan, andrew, what's your preference across these things?

Speaker 3:

Take that information in and use it along with budgetary constraints and route constraints to find that optimal solution for you that also layers into the Vickrey-Clark-Groves mechanism and provides those individualized loss functions.

Speaker 3:

And then, when you actually do math it out, it's a three-dimensional thing with a different as long as you have budgetary constraints. This is when it gets into that linear programming, which is a simple, solvable solution, often solvable not always, but we will walk through what that whole mechanism looks like over time. But it's a methodologically driven approach that solves a problem and it's not as computationally intensive and it also it's very interpretable and explainable down to the individual, localized, of why this made a decision and it's constrained, so you know what the outcome is going to be at all times. So that was a little bit of a ramble but a little bit of a setup of like, why we're taking this approach and how it fits into the broader mechanism design we discussed last time, and we'll be slowly going through the different component parts and then having the full at the end, end to end mechanism design specification as well as Python code showing how to execute this.

Speaker 2:

Yeah, that's perfect, and I think that leads up really nicely to this discussion of like. If we think about my preferences versus Andrew's preferences and we're trying to make some function, some loss function, that's going to be able to manage that and give us what we want. We need some way of measuring that, and so the standard way of saying this in the economics world is utility right. Utility is a way of viewing the world where you want to maximize your personal utility, maximize you getting what you want. We might measure this very abstractly as utils right. If I get more utils out of some bundle of a flight and a hotel and a restaurant and I really have a good alignment with that then I'm going to get more utils than a bundle that I don't care about. And so we want to think about utils as being measurable in, we'll say, one of two major ways Cardinal meaning, just like I like it or I don't like it. I strongly prefer this, I strongly don't prefer this, or even ordinarily, which is I think I like this, like 10 out of 10, I really like this, One out of 10, I don't like this that much.

Speaker 2:

With those things in mind, we could easily conceive of a curve, we'll say, between the flight I buy and the hotel that I buy, where, as you move along this space of buying different hotels and buying different flights, there's going to be this curve or this line that describes bundles that are basically the same to me. Right? Maybe this bundle is a really good flight, but not so good hotel. This is a really good hotel and not so good flight. And this line or curve describing these ranges of things that are basically equivalent to me is called an indifference curve.

Speaker 2:

We would then be able to evaluate new bundles as being above or below that curve, meaning, is this better or worse? And we measure that through our, in this case, ordinal utility, which is basically my one out of ten preference. If you can imagine that this function actually exists in a third dimension on top of it. So if on x-axis is just flight, if y-axis is hotel and z-axis is preference, you'll actually find that there's a 3D gradient that we can move along, sounding a lot like a loss function. And moving on that loss function, we'd be able to determine the marginal rate at which someone would be willing to accept a change in one hotel for a different hotel. Right, as you get closer to someone's true preferences, they're not going to care so much. But as you're very far from someone's preferences, they really, really want to get the arrangement and the bundle that they want to have.

Speaker 3:

Sid. I think that's a great explanation of kind of like how utility functions work at a high level and kind of into the indifference curves and marginal rate of substitution and it's really that like how complimentary is it a good versus substitution. That's all that unique ability that you'll have and I think it was a great explanation of kind of like how that would work. And then next episode we'll really get into how would you solve that problem a little bit. But this is where you really get that diminishing marginal utility or marginal rate of return. You've probably heard some of those concepts as well.

Speaker 3:

As you have the different solutions, like is it an interior solution? Which means that's really like the bundle is somewhere in the middle of that curve, in that three-dimensional curve of your optimal and remember everybody's optimal is going to be different. It's also going to be constrained by budget and there's the budget set which is essentially, if you think you know outward within this three-dimensional plane, is like you can figure out how much like my budget might be lower than sid's budget. So sid has more optionality than I do, as an example on that plane. And an interior solution means there's there's like a combination of those versus. You might just say I can barely afford to do this european trip. I need to have the cheapest flight possible. That's actually a corner solution that's going to be at the very edge, right. So you have these different, uh combinations of how these, these baskets can essentially go together.

Speaker 1:

For the layperson or the newbie listening to this podcast is this, you know, as I've tried to book flights and hotels and everything like that, is this what people are proceeding as oh, I keep searching and the rate goes up, or the fare goes up, or it changes and you know, or they'll keep logging in or they'll keep resetting their search and they keep going. Is that something that also has an effect? Or on some of the conditions, when you're talking about something scientific, as loss functions or these indifference curves?

Speaker 3:

That's a great point and this is the part we said was exogenous, which is external to the system. For sake of illustration here, that would be a good thing to dig in longer term. So airline, it's called dynamic pricing in airlines and they take a lot of different factors. So it'd also be like what's the amount that? So it's their utility function is usually optimizing revenue. So they're going to use, like consumer feedback and things Like if you, they're going to look at your cookies, how often have you done it? Like trying to discern hey, are you a consumer which is usually more price sensitive In economic terms? We call that elastic. You're going to be more elastic to the amount of flights you buy. Versus a business traveler. They're more just going to like hey, I got to go to this meeting, I'm just going to swipe my credit card the first rate. I see, I don't care Versus consumers, they'll play with a little bit.

Speaker 3:

So there's a whole bunch of pricing theory called dynamic pricing that they use, which is that elasticity of demand and economics as well as how much can we? What's? What is your utility function as a consumer? How can we maximize our revenue and use, get the amount, most amount of money out of your pocket. And that's the whole dynamic pricing.

Speaker 3:

It's a fascinating topic and that's why, for sake of this, we're focusing on from our side, like we're assuming that price is being put into the mechanism of our marketplace here and we're just focusing on the consumer, for our example. But I think that's a great thing to talk about and thank you for bringing that up. But it is very complex because of all of different like the dynamic pricing based on all the different factors that they have, like how many seats left on the plane, what are the gas price, fuel prices, what can do I think I can get, if I keep playing with Susan, do I think I can get her to book or not, like those, all those other factors. And it's very proprietary by the airlines too. It's not like some, like there's, of course, like people know how these things work, but every airline is going to have their own separate optimization they use.

Speaker 1:

Okay, so things.

Speaker 2:

Okay, so things that we will get into much later in, maybe even later episodes. But for everyone listening, pay attention closely now, because you're going to need this For sure. Yeah, and you can think about it like exactly like Andrew's saying right, like we're playing against the market. In that situation, in this situation, we're just pretending the market is like a spreadsheet and it's fixed and we're here today. But that's not too weird, because if you say hey, I need to take this travel tomorrow, then you don't have time to like do this dynamic pricing game and the market is effectively what you see right now the four properties just to reframe uh, from what what we were talking about, from like last week, for this specific, we started this step one of reframing.

Speaker 3:

It is we have the four conditions for the, the mechanism we're going to be using, which is everybody is telling their dominant strategy, which is regardless of anybody else. When we talked about, like Sid did, a great example of, like the prisoner's dilemma and the Nash equilibrium and things Dominant strategy is the best strategy to fight anybody else. So we are assuming, like, as Sid said, it's a deterministic. We are price takers here, like the airlines are already just putting in their best price in this mechanism. As, susan, you rightfully mentioned. That is not a great assumption. This is the problem with some of these models you have to make assumptions somewhere. But what I like is you're making an explicit assumption that you can change over time, versus you're like the LLM is deciding whatever it feels like at any given time. We are defining the assumptions and those assumptions can change and we can also, in this, every agent telling their dominant strategy.

Speaker 3:

Airlines could be putting in a different price every few minutes of their dominant strategy, but the fact of us building this mechanism, they don't get to do as much of personalized pricing potentially as they did if you go to the website.

Speaker 3:

Individuals agents are incentivized to align with system objectives where everybody optimizing their rational self-interest of the most money they'll pay their preferences. It fits best with the whole mechanism we're building as well as everybody is incentivized to voluntarily participate. So the airlines see that they will make money, like maybe they only hey, I have open seats, I'm only going to put book out the next couple of days when I have a lot of open seats. I'm not even going to put the flights that I think I can do the dynamic pricing on. I'm not even going to participate with those. That doesn't help me to participate in this mechanism. Maybe this is more of a budget mechanism, but they're going to give us the flights they want to participate in and then the system has constraints that everybody has to be making money. The system has some sort of a profit for facilitating the transaction, so there's no loss occurring.

Speaker 2:

And so, with all that in mind, I think we can now take the step of thinking about that budget that we're talking about. Right, let's pretend that we're this average consumer and we just need to just buy, you know, get this ship done in $2,000. When we're considering the types of things that we're going to be buying right, our restaurants, our hotel, our flights we need to find a way to harmonize their utilities, because we need to purchase all these things on one budget. We don't want to say that the flight is $300 and the hotel is $500 because maybe you're willing to take a bit of a hit on the flight to get a better hotel right? That wouldn't match with our personal interests and we would be missing out on a lot of utils. So we might consider a couple cases. So in one case, we have truly independent goods, right. Where you eat and where you stay don't matter to each other, right? So we can consider these things independently, right? What I buy here and what I buy here doesn't matter, as long as they both fit in the budget. We might also consider the utility of a substitute right For me personally, my ranking may find that Southwest and Delta are pretty much interchangeable, so if you need to swap a flight to Delta to get me there a day faster, then I'll accept that.

Speaker 2:

We might also then consider the idea of a complement, which is that some utilities that are purchased come at the cost of other utilities.

Speaker 2:

If I buy a flight to Aruba, I need a flight from Aruba, right? These things are naturally intertwined and so you can't buy one without the other. And in the last case, for how we might think about these, if we have good one and good two, where good one gets better and better and better the more money you put into it, it up until a point a diminishing return. Let's say, a hotel as you spend, you know, 500 on a hotel versus 1000 in a hotel, you'll get vastly more luxury, but 1000 versus 1500, you're not getting as much marginal luxury out for the dollar that you put in. And so we can balance that cost with, say that, a good that does have really good returns as you put money in, so that last $500, let's not spend it on the hotel, let's spend it on this airline where it's going to make a difference. So these are four cases of utilities that allow us to integrate the purchasing of two separate goods that we have to get along the way here.

Speaker 3:

So that's a great explanation of the different components. That are some of the considerations. And then one of the things you touched on, that last bit that you showed of the difference relationships between the marginal utility which is really the derivative of the rate of change, between how you're looking at those different baskets on the indifference curve. It's called quasi-linear, it's one of the common. There's different types of standardized utility functions but essentially how this works and it works well for those, when you're doing a utility function it needs to be differentiable. You can take the derivative of it and then you need to have some sort of convexity, concave, some sort of relationship there, very much like a loss function, quasi-linear. What that means is essentially you have it's kind of like a generalized linear model where you have the different. You could even have a function of utility. For our case it's like the luxury, your preference on luxuries, one to 10, your preference on budget and your preference on speed, and essentially those have to be so when we create our ordinal utility function. So let's say that the max utility you could have is like the. You have the 10, 10, 10 across the board In our toggle switches. We'll recommend you don't put 10 on everything, because that means it's just a weighted average. We'd prefer you to have some sort of a more of a relationship. But how Sid mentioned the different diminishing utility. This is where the consumer choice theory and like macroeconomic backing and, as Susan mentioned, some of that dynamic pricing, we could build intelligence into the system to see like, hey, customers really have a diminishing margin of utility for how they look at luxury. Now everybody's going to have their completely customized function. But you could also have a standardized, like hey, maybe we square luxury. Or maybe, as long as you add the functions together, you could say luxury for you is squared. Maybe we take the square root of luxury for me. Like you can, as long as everybody's functions don't even just have to sum up to between three and 30 of the ordinal utility, you could actually have some sort of dynamic functions as long as you add them together. So this quasi-linear structure is commonly used in utility functions to give us more optionality for how we construct them. But if you think about it, you could cube, you could something, you could have a lot of these different things. You could have a very dynamic of like when we're comparing utility functions we're seeing how do we maximize Sid's rational self-interest versus Andrew's. So like comparing the top line of my utility versus Sid's isn't as important as comparing Sid's baskets across all the options he could have. So optimizing Sid's optional utility, my option utility for everybody's rational self-interest, and so that's kind of like the mechanics behind.

Speaker 3:

And then it's gonna be subject to the budget constraints of how much money I have will be different than Sid that he's willing to put in, as well as the location will have different cost structures and the amount for hotels and things. So like that's that kind of dynamic problem. You can see we're setting up that. It's solvable. It's like rank order the flights that meet that criteria. First we take out any flights that don't meet the locations. Like those determined it must be these things. Or I only have $2,000 for this European trip. So any bucket of goods that is over 2,000, like if there's a flight that's over 2,000, it's not even going to look at it. That five-star luxury hotel, one night, $2,000, not even gonna look at it. So like you narrow down that basket and then you can go start iterating through those baskets and there's solvers for this that are very well established to see my bucket versus Susan's, versus Sid's, based on the availability of what I have.

Speaker 3:

And then my specific utility function, which we said could be quasi linear. It could be between three and 30. It could also be that more like non-linear structure to that, as long as it sums up. But that's essentially behind. And then just in subsequent episodes, like next episode, we can work on some of the solvers of how we'd actually look at all that possible basket. But as long as we have that differentiable structure and we have defined kind of how these things work together and this is when we do our write up we can define this. But that's kind of like conceptually how this works together and you can see that it's customizable versus like an LLM. That's just kind of like hey, here's whatever we think it's going to be as well as it's tractable mathematical-wise and it's theory-driven and we can layer in more economic and consumer choice and data-driven utility functions. Over time we can learn our own utility functions.

Speaker 2:

Yeah, I think that that's all exactly spot on right. As long as we have these utility functions defined and they work, we can use them to basically mathematically solve these problems, the same way that maybe in high school you learned about supply and demand curves right, Finding these optimal points of outcomes. And yeah, to the final point that Andrew said, if at the end of the day you do all this work and you write the curves and they're not going great, these curves can be learned right. And that's where our machine learning expertise can come back into play, where we can learn everyone's individual preference, given some input data, given people that are similar to you, to give us generalizable individual utility functions, and that sets us up very nicely to basically have a solvable problem.

Speaker 3:

And this is where there's very the field of mathematical optimization but specifically, like in our example, it's gonna be fully linear programming. You can, but you'll be able to like these are existing techniques that were developed to help with like logistics problems in World War ii. I think we've talked about linear programming on this podcast before, but that's where we'll go in exact like structure of how to solve this and we will touch that in our next podcast as well as like that ranking in the middle of how do you actually take that, the bucket of the different different things, and solve it. We've kind of done the theory of high level, the utility functions, how we're setting it up, but then there's actually like the if, then statements of how we solve through it as well as there's other options we could be using as well outside of linear programming. And, quite frankly, I'm not sure what's the best method for us to use yet, but that's kind of the fun is we'll figure it out together.

Speaker 3:

Is there's like shortest route route theory and like graph theory as an example. So that's when you really think about. You know how maps work, you can put that into a graph and a graph is just like the nodes and vertices can go together. You've probably all seen like the social media you know my Facebook friends type network connectivity, but that kind of a concept can be used for this type of a thing as well, if you think of, like airline routes and things, and then there's shortest path problems, traveling salesmen. There's a whole methodology there too.

Speaker 3:

So, like we've so far, these first two podcasts really worked on the theoretical underpinning of a mechanism, of how the parts fit together. We're now the customization and the terministic nature but not necessarily terministic, but the nature of the individualized consumer with, just with, optimizing their rational self-interest given their constraints, with utility functions of the setup. Now we'll kind of talk into the solving and then we'll be able to put all the pieces together into how we could solve a multi-step system, explainable with not a ton of compute power, and then we can evaluate of like. Also, the governance surface area is much, much, much, much lower than if you're going to just put an LLM and say make me a multi-step system.

Speaker 1:

Yeah, on that point, since we're going to be going through some of the in future episodes, we're building on this incrementally, at this increment, at this point, two things we want to drive home. One, two things we want to drive home. One, why you've touched on it a little bit why would you not want to apply llms here? Or you, why you absolutely could not, at this step, like, even conceive of llms in this part of the process. And then number two you also hit on it the governance surface area, whether it's covered now or, like at this, at this point, as people are taking this in on utility, what would you say?

Speaker 3:

It's a great question. I think that's what we'll keep addressing both of those throughout all the podcasts but really hope that we've illustrated a little bit of like you could use an LLM, and a lot of people are doing it. The issue is there's deterministic information Like I need to go from, like Aruba, as Sid said, on I have very specific dates from very specific times and I have a very specific budget and I have my credit card information thing. So there's a lot of things that you don't want it like hallucinating on, like the best LLM still hallucinate 10% of the time. So there's a lot of that like input field information. You could also just have a basic form. You need to have that make sure that information is correct. So there's that. There's like those state-based things. Then they're like does it know enough about me? I don't want open AI knowing all these preferences about me versus me just objectively saying what my preference is. You could add all this in a prompt but again, then you don't know how is it actually calculating it? So you're doing the multi-step of ingestion. You have the basic credit card type execution. Remember, at the end of this, which we haven't really talked about here is, once we determine the optimal solution, we have to execute it. That's the whole part of what makes it agentic versus normal is if you could just open AI today like chat to BD, hey, make me a travel plan and then you go and you manually book it.

Speaker 3:

The part that people are most excited about with agentic is it's the autonomous agents doing things. So you're like all of this, like I'm putting information in, I'm telling it to figure something out and it's going to go execute on my behalf and that's those are a lot of steps that aren't deterministic, versus you just say here's my credit card information, here's my passport number, go execute. That's just a regular API programmatic call. That doesn't need to be sure, have a-pilot, help you build that, but that doesn't need to be something that's.

Speaker 3:

There's a lot of these steps that could just be very deterministic and as well as like how do you actually solve that? So, like we're looking at, if you do it this way, only this model specifically, that would be pretty easy to find what's happening, would be the only non-deterministic modeling component versus the rest are just software engineering. That's where it's basically and it's very interpretable of what we did in the governance surface area. We know what to monitor. We know how to set it up. We know exactly what our algorithm is doing versus the kind of like very black boxy and now multi-step black boxy, where we don't even know what point something might fail.

Speaker 2:

Exactly. And just to reiterate an older point, the LLM is not optimized to give you the best flight. That's not what it's trained to do. This system would actually be designed from the bottom up to maximize your preferences and give you exactly what you want, and that's why the utility function is giving us a lot of value here.

Speaker 3:

Thank you, sid, love it. Thank you for jumping back. I get too mathy sometimes. Exactly, the LLMs are really functioned to act and sound human and predict the next word. And, susan, you mentioned that at the top of the program. That's what they're designed to do. People just like the human interactivity, which you can still have a chat type interface and it not be an LLM. But what we're really highlighting is all of this how do I actually solve the problem in the middle? I really don't trust this system. That's good to predict the next word, to optimally solve the problem for me. It will return something, but I don't know if it's going to be right. I don't know where it's going to fail. How do I troubleshoot it? Versus like I'm actually creating an and we were just simplifying things here but like actually creating an expert system to maximize my utility in a flight oh, by the way, it's also going to be accurate.

Speaker 2:

It's not going to transpose credit card numbers and things like that, and I'm not concerned about anybody learning off of me or anything either. It's very, very specific. Yeah, and to some extent that's the difference between, like, getting the laundry machine Everyone wants the laundry machine, they want the agent, they don't want to have chat CPT and you say, like I need to clean my room. It's like this is how you clean your room. They want the execution, they want the execution to work how they expect it to work. I think I'm excited to tackle the next episode, where we're going to talk a little bit about the linear programming and actually solving these utility functions. Right here, we just described what they are and why they're useful and, going forward, we're going to see how we can actually use them to solve these kinds of problems.

Speaker 1:

Excellent. Well, sid and Andrew, thank you so much for your time today and walking us through this step on utility functions Everybody. If you have any questions for us. Like I said, we're going to be stepping through this episode by episode, so if you have questions, let us know. We are happy to address them at the top of the next episode. Thank you for listening and until next time.

People on this episode

Podcasts we love

Check out these other fine podcasts recommended by us, not an algorithm.

The Shifting Privacy Left Podcast Artwork

The Shifting Privacy Left Podcast

Debra J. Farber (Shifting Privacy Left)
The Audit Podcast Artwork

The Audit Podcast

Trent Russell