Learning Library

← Back to Library

From Monolithic Models to AI Agents

Key Points

  • 2024 is being hailed as the year of AI agents, marked by a transition from single, monolithic models to modular, compound AI systems.
  • Stand‑alone models are limited by their training data, cannot access personal or sensitive information, and are costly to fine‑tune for new tasks.
  • A practical example shows that answering a personal vacation‑days query requires integrating a language model with a database lookup, turning a generic response into an accurate, user‑specific answer.
  • Compound AI systems combine multiple components—different model types, search queries, output verifiers, and other tools—to solve problems more effectively than a lone model.
  • Designing such systems is faster and more adaptable than traditional model tuning, allowing rapid customization for diverse applications.

Full Transcript

# From Monolithic Models to AI Agents **Source:** [https://www.youtube.com/watch?v=F8NKVhkZZWI](https://www.youtube.com/watch?v=F8NKVhkZZWI) **Duration:** 00:12:18 ## Summary - 2024 is being hailed as the year of AI agents, marked by a transition from single, monolithic models to modular, compound AI systems. - Stand‑alone models are limited by their training data, cannot access personal or sensitive information, and are costly to fine‑tune for new tasks. - A practical example shows that answering a personal vacation‑days query requires integrating a language model with a database lookup, turning a generic response into an accurate, user‑specific answer. - Compound AI systems combine multiple components—different model types, search queries, output verifiers, and other tools—to solve problems more effectively than a lone model. - Designing such systems is faster and more adaptable than traditional model tuning, allowing rapid customization for diverse applications. ## Sections - [00:00:00](https://www.youtube.com/watch?v=F8NKVhkZZWI&t=0s) **From Monolithic Models to AI Agents** - The speaker explains how AI agents arise by integrating large language models with external data and processes, shifting from isolated, hard‑to‑adapt models to compound systems that can handle personalized tasks like vacation planning. - [00:03:04](https://www.youtube.com/watch?v=F8NKVhkZZWI&t=184s) **Modular AI Systems and Control Logic** - The speaker explains how combining diverse models, verification components, and programmatic control logic—exemplified by Retrieval‑Augmented Generation—creates adaptable AI solutions that are faster to implement than traditional model tuning. - [00:06:12](https://www.youtube.com/watch?v=F8NKVhkZZWI&t=372s) **Core Capabilities of LLM Agents** - The excerpt outlines three fundamental functions of large language model agents—reasoning to devise and follow plans, acting by invoking external tools or APIs, and utilizing memory to store and retrieve intermediate information. - [00:09:20](https://www.youtube.com/watch?v=F8NKVhkZZWI&t=560s) **Calculating Sunscreen Needs for Vacation** - The speaker describes a multi‑step process—fetching vacation days, estimating sun hours from forecasts, consulting health dosage guidelines, and computing bottle counts—to determine how many 2‑ounce sunscreen bottles to bring, showcasing the modular problem‑solving power of compound AI systems. ## Full Transcript
0:002024 will be the year of AI agents. 0:04So what are AI agents? 0:05And to start explaining that, 0:07we have to look at the various shifts that  we're seeing in the field of generative AI. 0:10And the first shift I would like to talk  to you about 0:13is this move from monolithic models to compound AI systems. 0:26So models on their own are limited by the data they've been trained on. 0:31So that impacts what they know about the world 0:34and what sort of tasks they can solve. 0:40They are also hard to adapt. 0:42So you could tune a model, but it would take  an investment in data, 0:46and in resources. 0:51So let's take a concrete example  to illustrate this point. 0:55I want to plan a vacation for this summer, 0:58and I want to know how many vacation days are at my disposal. 1:06What I can do is take my query, 1:10feed that into a model that can generate a response. 1:19I think we can all expect that this answer will be incorrect, 1:23because the model doesn't know who I am 1:26and does not have access  to this sensitive information about me. 1:30So models on their own could be useful for a  number of tasks, as we've seen in other videos. 1:35So they can help with summarizing documents, 1:38they can help me with creating first drafts for emails 1:41and different reports I'm trying to do. 1:43But the magic gets unlocked when I start building systems 1:47around the model and actually take the model and  integrate them into the existing processes I have. 1:52So if we were to design a system to solve this, 1:56I would have to give the model access to the  database where my vacation data is stored. 2:03So that same query would get  fed into the language model. 2:07The difference now is the model would  be prompted to create a search query, 2:13and that would be a search query that  can go into the database that I have. 2:18So that would go and fetch the information  from the database, output an answer, 2:23and then that would go back into the  model that can generate a sentence 2:28to answer, so, "Maya, you have ten days  left in your vacation database." 2:33So the answer that I would get here would be correct. 2:42This is an example of a compound AI system, 2:45and it recognizes that certain problems are better solved 2:48when you apply the principles of system design. 2:55So what does that mean? 2:58By the term "system", you can understand there's multiple components. 3:02So systems are inherently modular. 3:04I can have a model, I can choose between tuned models, 3:08large language models, image generation models, 3:11but also I have programmatic components that can come around it. 3:15So I can have output verifiers. 3:18I can have programs that can that can take  a query and then break it down 3:21to increase the chances of the answer being correct. 3:25I can combine that with searching databases. 3:27I can combine that with different tools. 3:30So when we talking about a system approaches, 3:33I can break down what I desire my program to do 3:36and pick the right components to be able to solve that. 3:40And this is inherently easier to solve for than tuning a model. 3:45So that makes this much faster and quicker to adapt. 3:54Okay, so the example I use below, 3:58is an example of a compound AI system. 4:00You also might be popular with retrieval augmented generation (RAG), 4:05which is one of the most popular  and commonly used compound AI systems out there. 4:11Most RAG systems and the example I  use below are defined in a certain way. 4:18So if I bring a very different query, let's  ask about the weather in this example here. 4:23It's going to fail because this the path  that this program has to follow 4:28is to always search my vacation policy database. 4:32And that has nothing to do with the weather. 4:34So when we say the path to answer a query, 4:37we are talking about something called  the control logic of a program. 4:43So compound AI systems, we said   most of them have programmatic control logic. 4:49So that was something that I defined myself as the human. 4:55Now let's talk about, where do agents come in? 5:00One other way of controlling the logic  of a compound AI system 5:04is to put a large language model in charge, 5:07and this is only possible because   we're seeing tremendous improvements 5:11in the capabilities of reasoning   of large language models. 5:15So large language models, you  can feed them complex problems 5:18and you can prompt them to break them down  and come up with a plan on how to tackle it. 5:23Another way to think about it is, 5:25on one end of the spectrum,  I'm telling my system to think fast, 5:30act as programmed, and don't deviate  from the instructions I've given you. 5:34And on the other end of the spectrum, 5:36you're designing your system to think slow. 5:40So, create a plan, attack each part of the plan, 5:44see where you get stuck, see if you need to readjust the plan. 5:47So I might give you a complex question, 5:49and if you would just give me the  first answer that pops into your head, 5:53very likely the answer might be wrong, 5:55but you have higher chances of success  if you break it down, 5:59understand where you need external help to  solve some parts of the problem, 6:02and maybe take an afternoon to solve it. 6:05And when we put a LLMs in charge of the logic, 6:08this is when we're talking  about an agentic approach. 6:13So let's break down the components of LLM agents. 6:19The first capability is the ability to reason, which we talked about. 6:24So this is putting the model at the core of how problems are being solved. 6:29The model will be prompted to come up with a plan  and to reason about each step of the process along the way. 6:35Another capability of agents is the ability to act. 6:39And this is done by external programs  that are known in the industry as tools. 6:45So tools are external pieces of the program, 6:48and the model can define when to call them  and how to call them 6:52in order to best execute the  solution to the question they've been asked. 6:56So an example of a tool can be search, 6:59searching the web, searching a database at their disposal. 7:03Another example can be a  calculator to do some math. 7:08This could be a piece of program code  that maybe might manipulate the database. 7:13This can also be another language model that  maybe you're trying to do a translation task, 7:18and you want a model that can be able to do that. 7:21And there's so many other possibilities of what can do here. 7:23So these can be APIs. 7:25Basically any piece of external program  you want to give your model access to. 7:30Third capability, that is  the ability to access memory. 7:35And the term "memory" can mean a couple of things. 7:37So we talked about the models thinking through the program 7:41kind of how you think out loud  when you're trying to solve through a problem. 7:45So those inner logs can be stored and can be  useful to retrieve at different points in time. 7:51But also this could be the history of  conversations that you as a human had 7:56when interacting with the agent. 7:57And that would allow to make the experience   much more personalized. 8:01So the way of configuring agents,   there's many are ways to approach it. 8:05One of the more most popular ways of going about it is through something called ReACT, 8:11which, as you can tell by the name, 8:13combines the reasoning and act components of LLM agents. 8:18So let's make this very concrete. 8:21What happens when I configure a REACT agent? 8:23You have your user query that gets fed into a model. So an alarm the alarm is given a prompt. 8:31So the instructions that's given is don't  give me the first answer that pops to you. 8:37Think slow planning your work. And then try to execute something. 8:44Tried to act. And when you want to act, you can define whether. 8:49If you want to use external tools to  help you come up with the solution. 8:53Once you get you call a  tool and you get an answer. 8:56Maybe it gave you the wrong answer  or it came up with an error. 9:00You can observe that. So the alarm would observe. 9:02The answer would determine if it does answer the  question at hand, or whether it needs to iterate 9:08on the plan and tackle it differently. Up until I get to a final answer. 9:17So let's go back and make  this very concrete again. 9:20Let's talk about my vacation example. And as you can tell, I'm really excited 9:25to go on one, so I want to take  the rest of my vacation days. 9:29I'm planning to go on to Florida next month. 9:32I'm planning on being outdoors  a lot and I'm prone to burning. 9:35So I want to know what is the number of two ounce  sunscreen bottles that I should bring with me? 9:43And this is a complex problem. So there's a first thing. 9:45There's a number of things to plan. One is how many vacation days 9:49are my planning to take? And maybe that is information 9:52the system can retrieve from its memory. Because I asked that question before. 9:56Two is how many hours do I plan to be in the sun? I said, I plan to be in there a lot, 10:01so maybe that would mean looking into the weather  forecast, for next month in Florida and seeing 10:06what is the average sun hours that are expected. Three is trying maybe going to a public health 10:13website to understand what is the recommended  dosage of sunscreen per hour in the sun. 10:17And then for doing some math, to be able  to determine how much of that sunscreen 10:22fits into two ounce bottles. So that's quite complicated. 10:25But what's really powerful here is  there's so many paths that can be 10:29explored in order to solve a problem. So this makes the system quite modular. 10:33And I can hit it with much more complex problems. So going back to the concept of compound AI 10:40systems, compound AI systems are here to stay. What we're going to observe this year is that 10:44they're going to become more agent tech. The way I like to think about it is 10:49you have a sliding scale of AI autonomy. And you would the person defining the system 11:02would examine what trade offs they want in terms  of autonomy in the system for certain problems, 11:09especially problems that are narrow, well-defined. So you don't expect someone to ask them about the 11:14weather when they need to ask about vacations. So a narrow problem set. 11:19You can define a narrow system like this one. It's more efficient to go the programmatic 11:24route because every single query  will be answered the same way. 11:27If I were to apply the genetic approach here, there might be unnecessarily 11:32looping and iteration. So for narrow problems, pragmatic approach can 11:36be more efficient than going the generic route. But if I expect to have a system, accomplish very 11:43complex tasks like, say, trying to solve  GitHub issues independently, and handle 11:50a variety of queries, a spectrum of queries. This is where an agent de Groot can be helpful, 11:54because it would take you too much effort to  configure every single path in the system. 11:59And we're still in the early days of agent systems. 12:02We're seeing rapid progress when you combine the  effects of system design with a genetic behavior. 12:08And of course, you will have a human in the  loop in most cases as the accuracy is improving. 12:13I hope you found this video very useful, and  please subscribe to the channel to learn more.