Scaling Generative AI: Batch Inference Strategies for Foundation Models
Summary
- Scalable foundation models: Databricks enables efficient batch inference patterns for processing large volumes of data through LLMs and text-to-image models.
- Cost optimization: Techniques for parallel processing, chunking, and token optimization help organizations process massive datasets without breaking budgets.
- Production patterns: Architecture best practices demonstrate how to balance compute resources between CPU preprocessing and GPU inference for any scale of data.
Scaling Generative AI: Batch Inference Strategies for Foundation Models

Talk by Andrew Shieh, Software Engineer, Databricks ; Ankit Mathur, Engineering Lead, AI Serving, Databricks
Curious how to apply resource-intensive generative AI models across massive datasets without breaking the bank? this video reveals efficient batch inference strategies for foundation models on Databricks. Learn how to architect scalable pipelines that process large volumes of data through LLMs, text-to-image models and other generative AI systems while optimizing for throughput, cost and quality. Key takeaways: Implementing efficient batch processing patterns for foundation models using AI functions Optimizing token usage and prompt engineering for high-volume inference Balancing compute resources between CPU preprocessing and GPU inference Techniques for parallel processing and chunking large datasets through generative models Managing model weights and memory requirements across distributed inference tasks You'll discover how to process any scale of data through your generative AI models efficiently.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
Chapters
0:00Introduction to batch inference2:40Real-time vs batch strategies7:14Technical architecture12:37Retail analytics demo21:06Automating pipelines with DLT25:39Multimodal capabilities29:34Agent Bricks and key takeaways
FAQs
What is batch inference for foundation models?
Batch inference is a pattern for processing large volumes of unstructured data through foundation models like LLMs and text-to-image systems. It enables cost-effective, high-quality analysis of massive datasets.
How does Databricks optimize batch inference pipelines?
Databricks provides efficient processing patterns including parallel processing, chunking strategies, token optimization, and techniques for balancing CPU preprocessing with GPU inference.
When should I use batch inference versus real-time?
This video outlines batch inference scenarios including non-time-sensitive predictions, cost optimization, and bulk processing on the Databricks Data and AI platform. Batch enables efficient resource utilization and lower costs. The decision depends on latency requirements and business use cases.
Which platforms support batch, streaming and real-time inference?
This video shows that the Databricks Data and AI platform supports all three inference patterns in unified architecture. Organizations can choose appropriate patterns per use case without maintaining separate systems. This flexibility enables optimized solutions for diverse requirements.
Full transcript
0:00 Introduction to batch inference
Long time. Uh just some quick intros. I'm the tech lead for our model serving platform at data bicks. Uh have been there for around six years. Yeah. And. I'm also on the foundation model serving team at data bicks and been mainly working on batch inference recently. So we're going to try today to go quite a bit deeper on the technical side uh of how we built out this batch inference platform why we built it that way um and how it can be used in a in a practical demo uh within data bricks.
So uh all live hopefully it all works. Um so let's get started. What kinds of use cases exist? Like why did we build this? We feel fundamentally that the amount of unstructured data in the lakehouse that's completely unprocessed is extremely high. That's text. It's all sorts of other stuff like from claims, PDFs, contracts, just generally data that's been piling up. And the reason that people haven't built, you know, structured tables from it or even analyzed it necessarily is because the cost of analyzing that data with high intelligence has historically scaled with human time.
So it's really expensive to analyze thousands or tens of thousands of PDFs that are coming in every day. Uh as an example, one of our customers looks at clinical trial data that comes in. They're analyzing tens of thousands of results that are published across the entire world every day. And there's just no way that they could have scalably had humans read that really really detailed information. So with foundation models, one of the big transformative moments that honestly I think most people don't really focus on when they look at things like chat bots is that now we have the ability to analyze this data in a really high quality way.
Uh in a manner that actually scales from a cost perspective, you know, with the amount of data that's coming in. So now if you have 10,000 documents coming in, you can extract insights from that data. And that's why we built this batch inference product because we want to make that easy to do. Right now with the products that are out there, it's either really hard because you have to use a real-time product in a batch manner or uh it's very hard to get accurate results or put it into an ETL pipeline that you already have which makes it further away from ROI because usually this kind of data you don't just want to like process it with a foundation model.
Once you have that text out from it or that insight out from it, you want to have that inform some downstream business outcome. So you want those things to be in the same platform so that you can actually just connect those things together pretty seamlessly. What's different about real time versus batch. Uh they're actually quite different, right? Like real-time products are used in interactive surfaces. Batch products on the other hand are primarily used in offline processes.
2:40 Real-time vs batch strategies
So the re the the way I like to think about it is that the latency of an individual request doesn't matter as much in batch mode. But in real time obviously if there's a human on the other end you really really care that every request is returned promptly. Um in batch mode what you really care about is the time to completion for the overall job. How long is it taking to process my new batch of data? So that's what you would optimize for if you built a batch system.
Uh you also in real time right you want low per request latency in batch mode you want to optimize for high throughput real time honestly there are not that many really highscale real-time applications that are using genai in today's world a lot of folks have you know chatbots that are helping them internally that's awesome it's providing a lot of productivity but if you look at the real-time scale that folks have built for in technology in the last 10 years probably only track GPT and Google and a few other folks with a lot of mind share have really high scale but with batch if you reuse the same infrastructure there is a tremendous scale of data that you need to do a tremendous scale of inference just within all of your enterprises so you can really really quickly get to problems that occur at scale when you start to solve things with batch systems uh with real time in order to provide latency guarantees you often overprovision uh with batch what you really want is you want all the compute you that we can offer you for as little time as you can get it uh to process your full job.
So you know what's what's one way that you could do batch inference? There are other competitors of ours who do batch inference. For example, how do they do it? Uh one thing you can do is you can take your data that's sitting somewhere in your lakehouse. Uh you can download it somewhere as a file. Then you can go and like upload that file to a batch endpoint somewhere. Uh obviously that uh service doesn't exactly know how long it's going to take to process it.
So sometimes they give you something like a 24-hour SLA uh and then you actually take that and then you would have to reingest it back into your table so that you're able to generate insights and kind of continue with your ETL workflow. Now a lot of the folks we've talked to have SLAs's way shorter than 24 hours. We've heard 8 hours, 2 hours, 1 hour, 30 minutes and this kind of product shape does not really fit in with that.
But even more critically, as you kind of saw on stage, we're really doubling down on governance because we see that as a really important thing across all of these different enterprises, in order to do this workflow, you basically have to take your govern data out of the lakehouse, take it into a file somewhere, and then upload that to a different place, and then reingest it. So, you're fundamentally breaking governance by downloading this data and extracting it from this place.
So we wanted to take a different approach here because we really feel that like that better matches what customers are need within enterprises. Uh and so really what we want to let people do is pick a model, prompt it and run SQL which is already what they're doing. Uh a vast majority of people within enterprises who are doing data analysis have used SQL before. Uh and also there's a set of folks even outside of data engineering, financial analysts for example, who maybe only use SQL within data platforms, but they're really really effective at it.
It's really critical to their job. So we want to give all of those people the power to use AI in a way that works for them, right? I think this morning said like we want to let people use it with natural language. I think that's the next level from this. But even beneath that, we just want to give people tools that meet them where they are in terms of their ability to use them. So, we want you to be able to write SQL like this.
You know, this looks probably like a select statement that you've seen anywhere else. You know, select, you use our operator called the i query. You point it at a model that we're hosting. You give it a prompt. You point it at a table and you go. That's it. So, what does it take to go build this kind of an experience? Because that is a kind of a very different product shape and it has implies a different set of systems problems.
When you do that, right, you want that data to end up in your table. You don't want to be able to access rows that you don't have access to. If I run the job, maybe it has different results than what does. And you want this to complete at high scale uh so that you're able to actually effectively uh run your the rest of your pipeline which was already maybe running. So Andrew, do you want to talk a little bit about this?
Yeah. So let's dive a little bit under the hood of what's going on when you run batch inference on data bricks. So we sort sort of split this out into three main components. The first is the batch reference client then the coordinator and then the actual genai compute and how we can orchestrate this at really high scale for your data. So first I want to introduce AI functions. So AI functions are just spark functions that have been built for batch inference.
7:14 Technical architecture
Uh there's nothing really new that uh the end user has to learn here. It's built on spark which is already really good at processing data at high scale and it's also pretty easy to use and people who use SQL or pispark are already familiar with this. And so let's just take what we have already with Spark and then optimize it for back inference. So that means we should scale up based on successful inferences, be able to scale down if we're getting a lot of errors.
Uh and then also be able to handle singular failures with retry so it doesn't block our data pipeline. So when you run your SQL query such as uh this part on the left side of the screen, the Spark driver is going to read your query, plan the execution out, and then when it's ready to start the actual inference, uh it'll create the Spark exeutors on the Spark compute cluster. And then over time if your data is at really high scale this might not be enough concurrency.
And so what the Spark driver can do is adaptively scale up the number of Spark executives and make sure that we're sending with pretty high throughput uh to the actual GPU compute. So that's a little bit about the client. Uh let's talk next about the coordinator. This is kind of the central piece that can ensure that we can uh always have performed batch inference even when there's a lot of different workloads at the same time.
So there's kind of four key areas that we really want to prioritize within our coordinator system. uh among many others. But the top four that we definitely want to make sure that we do are first are completion. If you run a batch job, you expect to complete in a reasonable amount of time. Second is really on immediiacy, which means that your workload should just start running immediately. You shouldn't have to wait, you know, a couple hours, maybe even a day to get your data uh up and running.
And then third is predictability. We really want to make sure that uh the coordinator can run a workload today uh and then if that same workload is run tomorrow, it's going to take a similar amount of time. This makes it much easier for our end users to estimate uh kind of the data processing workflow. And then lastly is really just delivering good utilization so that we can have really high throughput so that the end result is going to be um really great customer experience.
And so on the right side you can sort of see how we have architected this uh from an engineering standpoint. We have our main compute scheduler and it's able to get all the signals it kind of needs. We have this batch workload life cycle manager which gives it a overview of all their current workloads kind of what their current attributes are. Uh so it can use that to make allocation decisions. Second we have what we call like a compute rate limiter which can really enforce the amount of compute that's been given to each workload.
Uh but then also discover when new workloads might want to start and then also which workloads might need more compute. And then lastly is really just monitoring our available capacity and making sure that we are always able to serve all the workloads that are coming in. And just really quickly like one of the things that for those of you have worked with objective functions, right? Like here you have four different goals that actually are in like are a little bit in conflict with each other.
If we didn't care about for example completion times and utilization, we could easily deliver predictability and immediiacy by giving people the smallest amount of compute in our backend. uh but since we have to balance all of these different concerns that makes the job of this scheduleuler quite a bit harder. So now lastly jumping on to the actual genai compute uh one of the key things that we have to note is that in the genai world requests are no longer funible that is one request is going to cost may be very different from the next request that comes in and that's because output tokens are actually going to be a lot more expensive than input tokens.
So this graph here on the right kind of plots the number of input tokens, output tokens, and then the overall throughput that you're getting. Uh you can see kind of just at a glance here that output tokens are going to be much more expensive. For example, if you take that bottom right corner where you have 20,000 input tokens, maybe only 100 output tokens, you're in this 75 to 90 throughput range. Uh but if you contrast that with, you know, maybe a fewer number of absolute tokens, but in a different ratio, let's say 2500 input tokens and 2,000 output tokens in that top left corner, now you're looking at only 15 to 30 throughput.
And so that makes it really hard to plan uh if you're only going based off the number of requests that are coming in uh in terms of what throughput that you can guarantee. So one of the key things that we did here is that we actually split up our compute into what we call these geni VMs uh which is a normalized unit of compute that offers some throughput guarantee based on the request shape uh and the model. So in that first example in that bottom right uh low number of output tokens maybe that will only take one geni VM to process to get some throughput amount. uh and maybe we have to allocate for example three or four genivi VMs uh to the one with a lot of output tokens to get that same throughput but this way we can always ensure that we're giving each workload a consistent experience uh and we can properly balance uh the throughput so actually bringing that to the system diagram of what that looks like you can see here that we have each compute replica which serves some foundation model and we split that into some amount of geni VMs and we're actually able to allocate just some amount of these VMs to each batch infrance workload.
Uh, and because it's a multi-tenant compute pool, we can also ensure that batch jobs can always start immediately and there's minimal overhead. This means that kind of the one of the main features of batch inference is that because you need a lot of compute for a short amount of time, we're able to guarantee that just for that amount of time and we don't have to the customer no longer has to deal with the overhead of, you know, managing their own infrastructure.
Yeah. So, we're going to do a little bit we're going to try to jump back and forth between the slides and the actual product here today. uh because this is something that you all can use in your workspaces today already. Um and so we're just going to put ourselves for this for the duration of this talk in the shoes of this you know fake retailer. I used chat GBD to come up with this name and it was quite good so I just put it on here.
12:37 Retail analytics demo
Uh Lakehouse laces. Uh so let's pretend like we've recently launched a new shoe model. We want to understand exactly what our customers are thinking about it right be data obsessed with the data that we have. But like I mentioned, you have a ton of text data coming in, right? For example, you might have customer reviews which are coming in at high scale. You know, you aren't obviously aren't going to go read each individual review, but you do want to generate insights from them.
Uh we want to understand like what are the main things about this shoe that you know resonate with buyers so that we can then kind of focus our product efforts in that direction. Um and then ultimately we want to help people figure out if this is even the right product for them, right? Can we make our own product better by using Genai? So, we're going to build this into a dashboard that tracks this and updates when reviews come in.
So, let's jump over here. I'm going to skip a few steps, which is specifically just getting the data into data bricks, right? Let's pretend I do have a delta table, uh, which is, you know, called customer reviews historical. And as you can see here, like, you know, the AI has come up with a description for this, uh, which is kind of nice, but it's very, it's, you know, very standard kind of data set. You have things like customer ID, product ID, uh and critically you have the review body.
So let's just explore this data like what's in here. Uh if you take a look at it, right, we can just run this and see, okay, well there's like headlines, there's review bodies, that's that's useful for what we need. We probably want to take a look at these reviews first. Uh so let's filter for this specific product that we care about. Remember I said that uh we actually wanted to use a specific product. It looks like we have hit perfectly the restart time of this warehouse, but since it's serverless, it seems to have come back up pretty quickly.
Um, cool. Okay, so I have these reviews, but honestly, I don't know what to do with this because there's a ton of data here. Uh, and I want something that's like more readable for myself. So, really quickly, what you can see is that what these foundation models allow you to do is insert foundation uh genai to help you in in specific things. Like for example, here I actually want to show you like I'm I'm able to use Llama 70B and I'm asking it I want to I'm going to show you a review for a shoe.
Does it even sound like it it could be about a shoe or a boot? Because some of these reviews honestly look like they're not super relevant to a shoe. I mean, most of them are. Uh but some of them might not be. For example, like the fourth or fifth one here seems to talk about a phone charger. Yeah, bad charger. Stay away. Okay, that's like kind of annoying for me to have to analyze. And the last one is about a hat, which is not quite the same product that we're attempting to sell here.
So, we don't want that into here. So, all we need to do is just run this, right? And what this is doing is because it's natively tied into SQL, there's no like you didn't have to jump out or go anywhere, right? You're just asking the model to actually write your filtering clause. Uh, and since it's running at high throughput, it was able to actually finish that thing pretty quickly. And now we're pretty confident, at least a little bit more confident, that we have a set of reviews that are relevant. uh previously if you had to go figure out which ones are relevant you might have to go train an entire model on relevance get a data set that shows which ones are relevant which ones are not this is the flexibility that these foundation models are kind of bringing to your workflow uh and so now like let me take it a step further uh we actually have these builtin functions called AI summarize and AI analyze sentiment and what these just do for you is they actually abstract away which model it is so it allows us to be flexible over time and pick the best model for this kind of a use case as well as the prompt.
So we kind of work with our research team uh to come up with a good prompt for these for these particular functions. And so when I when I do this, okay, awesome. So I still have my reviews, but I have this very simple summarization. Uh I have a sentiment analysis and I was able to do that really quickly without launching any new models. Awesome. Can I take it a step further? Um so now we might for example want to actually really read the reviews, right?
Maybe you know sentiment is a highle concept. A summary is also a high level concept. Is there something in here that helps me figure out exactly what's going on? And maybe right like I want actually want to use this to inform something in my application uh which might for example show a recommendation or or flag that this shoe has a particular tendency. Uh and honestly applications struggle to read like raw text. So we actually have this feature within our AI query which is really powerful that's called response format and what that does is it allows you to specify to us a JSON schema and behind the scenes we constrain the probabilistic outputs of the model to the schema that you've specified and so you always get that exact schema.
You don't have to beg over the prompt to emit give me JSON back in exactly this format and then sometimes it doesn't do it. Um and so we're able to do that here. Uh and so this will run it'll run on this specific product ID. It finished super fast and as you can see right like now I have this JSON which uh is telling me something else and I can uh use this JSON in a downstream part of my application. Uh this is a super powerful capability especially for example for folk we have folks who use this to run in uh batch jobs that they then process in their actual customerf facing applications.
So they send these JSONs back uh as responses when they query the lakehouse. Um so yeah like you know we have uh a lot a lot more stuff in here but uh maybe let's hop back to the dashboard. So we were able to now with all of this information really quickly stand up a dashboard that has all of those queries I just showed you backing the actual results. So we've got this specific product ID. We know when the latest review is.
Uh we know stuff about its star rating. Um as well as a lot of the sentiment analysis that you know you might want to understand for a specific product. Uh do you want to cover some of the Sure. Yeah. And then so alongside kind of what we've done so far with our data. You can see that um powering this is just the data that we've stored uh with all the analyzed data here. Uh but one thing we can really do here is take this data and actually generate a review summary.
For example, you might have seen this on Amazon above the reviews where you know what are customers saying at a glance. So you can do the exact same thing very simply just writing out a a quick prompt. Uh and then on the historical data that we we've collected you can see here we actually show that within our dashboard. Uh right here you can see that you know customers are pretty satisfied with their lakehouse laces boots and they praise you know certain features of it.
And so maybe we want a question about okay what specific features uh do customers really like? So you can see that we've you know created a table based on uh you know specific feature and the comment type. But this might be a little bit hard to understand at first. So let's turn this into a visualization that can really show um how powerful AI has been for this feature. So maybe we want a visualization something more like a bar chart. uh and then we want to kind of understand like what are all the different features that uh customers really like and who like how many customers are talking about each one.
So here we can see all the features that um we've broken down into and then maybe we want to just see do people generally have positive or negative sentiments about them. So let's take this feature sentiment here. you can see um the different processes here. And then let's turn this into a visualization that's a little bit easier to understand. So here we have it. Um the colors are a little bit messed up. You can see red actually means positive.
But from this at a glance, you can just see that, you know, customers are are really liking the comfort of the shoe, but maybe they have a little bit more qualms about the break-in. Um and so if you actually like, for example, click on this, you can see in the table here, you know, what are the exact comments that people are leaving about the break-in? And this is all powered by AI. We didn't have to sift through this to figure out, you know, what the right features are and then what customers are saying about this.
Uh it was all powered just by uh running a couple AI queries on our on our data. And so now we have a dashboard, but one thing that we might want to improve is remember that you know the latest review is only from 2015. Maybe what if we had new data coming in. We don't want to have to run this whole process every single time, you know, quarterly or on a yearly basis. Um there is a better way that we can do this uh using DT which an will introduce right.
So some of you may have heard of DT. It's like uh basically something that allows you to leverage the change data feed capability in Delta tables to incrementally process only the new data that's come in. Uh and so all you need to do to create a DT pipeline is you go to the side here. It I think it's called LakeFlow pipeline now as well. So uh new name but same capability. Um and all you need to do is create this pipeline here.
21:06 Automating pipelines with DLT
Uh now what goes into this? So I actually took that table that uh you know put together with customer reviews and I created what's called a streaming table from that. And once I've got a streaming table, I now have an asset that I can use in Delta Live Tables. And so uh all you need to do to uh create a DT is you actually just create this notebook uh that creates a materialized view. And here I'm able to actually like use that same exact function that a that uh talked about pull out that JSON into a structured format.
Uh I also have the same summary summarization analyzing of sentiment and uh you know it's only working for this product ID. I have that filter that I talked about which is a genai filter that checks for relevance. And all I do now is I put that in this pipeline. It I mean you literally just point the pipeline at that notebook. All of a sudden I have this pipeline. I can schedule it as some as I I'm scheduling it to review every one hour.
And so now my dashboard can just point at the outcome table from this TLT and immediately it's now updating every hour with new reviews as they're coming in. And we're only running AI query again on the new data, the new reviews that are coming in. So it's we're, you know, that's going to help you control the costs so you don't have to refresh the whole table all the time. Um, so for example, uh, let's say I was to just add a few rows, right?
And I run this. Uh, now, uh, see, hopefully it runs. Yeah, cool. So, I added a few reviews. So, I'm simulating something that's happening in my product. Uh, I can verify, okay, those seem to have been picked up within the table. Uh, because now it's like 2025. Uh, and when I run the DT again, I'm just going to do an kind of offcycle run here. uh all of that gets picked up, right? What happens is the underlying DLT uh will refresh the streaming table which will pull the new data from the underlying table and as long as our uh dashboard is correctly set up, we should be good to go.
Uh it looks like we are still waiting for some resources though. So, in the meantime, um, as this is running, well, let's actually go fix our dashboard. Our dashboard is still pointing at kind of the historical data. And so, all we have to do to update it is, uh, very simple. If you go to the data tab, um, I save this one here. This is our our new, uh, updated table. Uh, all we have to do is just update these tables.
Publish this. And then as our new data is being run uh you can see it's refreshing now. I see. Okay. Awesome. We got the resources. I think it needs to actually finish first. Okay. Um Okay, awesome. So, it finished now. So, I think we should hopefully be able to refresh this dashboard. This dashboard, right? Cool. Okay. Now, you can see the latest reviews from 2025. Today uh all of our dashboard metrics have been updated seamlessly to reflect that.
If we went down looked here, if there had been a lot of data that had come in that had suddenly changed, you could have seen that in the data now. Um and so by in like the reason we highlight the fact that you can build a dashboard from this and that you can use it in DT is that's kind of only possible because it's already integrated in SQL. Uh and so that kind of means that by solving those systems problems that we had earlier referred to, you're able to now use it in these kind of very dynamic ways uh that resemble how you might use for some something for example in real time but not exactly.
25:39 Multimodal capabilities
Cool. So let's jump back here uh and talk a little bit about some additional capabilities that we've worked on. Well, one of the things we looked at is not all the data is text data, right? Like if I'm actually running a shoe business, like I probably have a product catalog that's full of these images of new shoes that I'm selling all the time. I probably have PDFs that are invoices. I have audio, I have video. How do I process this?
So this uh starting today, we're actually releasing this feature that allows you to do everything we just talked about, but with images as well. And so it's the same interface that you had before, but these models are now the ones that are multimodal capable. For example, Llama for Maverick now can take data from the lakehouse which is in a UC volume call it with this new function or like an existing function that's been upgraded for uh pulling in images called read files and all all of a sudden you can go and filter out images as well.
So just speaking a little bit to how these transformers have evolved over time to actually do this workflow. Uh you may have heard of the term tokens, right? Obviously text can be translated to tokens by a tokenizer. What happens with an image? So with images, you actually typically need to do some pre-processing to get them into a similar format. Uh we do that for you behind the scenes. Uh and then we use a vision encoder uh with which is baked into the model that basically finds the right tokens given the embedding space of the model and then we merge those tokens together and run the inference to the same intelligence engine that you had before.
Uh and so this is kind of the architecture that uh a lot of the popular models are using today like lama 4, claude, etc. Um, so this is a super powerful capability that these foundation models have now unlocked. So let's say we wanted to make it easier for people to find the right shoe. Like we have product images. Let's let people figure out like let's let our own internal folks uh kind of use this multimodal batch inference to look at our product catalog.
So here we actually have a SQL query that's going to work, right? And so um you we're doing something very simple. We're just looking for the category of a shoe that we have within the this list of like a roughly 400 images that we have currently within our product catalog. Um, you'll notice that nothing changed about the API. The prompt is kind of just informing what's going to come into this thing. Uh, and all we're doing, we're using this response format to give us the right structure, which is just a shoe category.
And maybe we'll process this in a different application at some point. Um so just skipping ahead a little bit here to what what actually comes out of this uh you'll actually what we'll see is that we'll actually see these paths with which are in uh UC um the modification time a preview of the content and then this JSON summary which features all of these these you know categories of different shoe categories that you have and you know just taking a glance at it it looks pretty reasonable uh I mean this is not too hard of a task honestly u but it's super powerful because otherwise how would you have like let's say it didn't come in with metadata, how would you have generated that metadata otherwise?
You probably would have needed to go get a segmentation model or something like that's able to do this classification. Now, you can kind of just do it in a few lines of SQL. But what I find really powerful about this abstraction is the flexibility that these models have. Uh let's say I now wanted to say, well, this didn't even come in with a product description. How do I like I want to put it on the website, but I need to show the user something about what this shoe is.
All I can do, all I need to do here is ask the model for a description. Hey, give me a two sentence description about like what is this shoe? Why is it special? Uh and then you run this again. Uh and now the model's actually going to do that as well. Uh so you take a look here. Uh you actually have these reasonably good product descriptions like uh let's take a look at the this is a funny flip-flop, but like these vibrant green flip-flops feature a you know blue and b uh bold blue and yellow strap, right?
This is something you could plausibly read on a website for a shoe. Uh, and we've kind of really quickly been able to generate that in this capability. Cool. So, that was our multimodal demo, but you just saw all of this talk about agent bricks. So, tell us about how this works with all that stuff. Sure. So, agent bricks is kind of like one of the new products that we've announced in the AI uh space within data bricks.
29:34 Agent Bricks and key takeaways
Uh, what it really allows you to do at a glance is, you know, declare a task and it'll create an endpoint for automatically uh and it will do all this cool auto evaluation, generate synthetic data, and then autooptimize your your agent under the hood. Uh so what's really cool about this is that it actually works natively with AI functions and batch inference processing. So I'll walk you through a little bit more of a demo here.
Uh we're going to focus on this one, this use case for information extraction where we have, you know, maybe a lot of news articles and we want to figure out some sort of uh financial information about the companies mentioned in these articles. Uh and so with that, what we can also take advantage of is document intelligence. This is another new feature that we're launching uh using the AI parse document uh AI function.
This really allows you just to input a bunch of PDFs of your choice. Uh for example, maybe articles and then we can actually parse that out and then you can use that downstream for later processing. And so I want to talk a little bit about what's going under the hood when we're supporting these data intelligent models. And so one cool in uh one of the cool features that we do for some of the models uh and some of the techniques is this thing called PEP which stands for parameter efficient fine-tuning.
Basically at a glance what it allows you to do is achieve comparable quality on a fully fine-tuned model uh but only using a subset of the model weights. So it's a lot going to be a lot cheaper and it's a lot more efficient to serve. So in this example here, you can imagine that maybe you have to retrain this whole blue box which is like the base weights but instead of that we can just take these red adapters which are a lot smaller in in space and can achieve comparable quality on uh on your data.
And so when it looks like uh going back to kind of like the compute side that of things uh what we can actually do is take advantage of this new uh this auto sharting technology which allows us to assign these adapters to our compute replicas dynamically uh and handles all the ingress routing for you. And so what kind of you get as a result is this really fast dynamic scaleup that can handle your workload size uh and is also data intelligent allowing you to serve your agent bricks model.
Just a critical technical detail here as well is that when you use a uh something like PEF, there's actually a material throughput impact. So the endpoint that you get out of that is usually supposed to be lower throughput. Uh because you know when you have a lot of adapters being paged in and out, it's really expensive for the server and slows it down. Uh what's critical here with this autosharding thing that we've launched is that because we're able to like reshard where the which adapters are assigned to which servers, we can isolate the ones that are getting a lot of throughput.
So for example, if you're running a back job with 100,000 rows or something, we can isolate that continue to deliver high throughput and low latency, which otherwise we would have really struggled to do because if you were if you were statically sharded to some node, that poor node will, you know, kind of just cap out at some point uh and then your throughput will be affected. Uh but because we're able to like kind of look at our suite of workloads and dynamically react, we can deliver lower P90 latencies both in real time and batch for these PEF models.
Yeah. So now doing a quick demo uh showing an agent bricks. Um so you can see here I've already configured uh a agent bricks. Can you zoom in a bit please? Yeah, I've already uh built an agent bricks uh endpoint to use. You can see I've preconfigured it. There's some uh some articles that I've already pre-populated here. Um and so what we can actually do is go to this use tab. You can see that it's actually created an endpoint for us.
And so we can use this endpoint within AI query. Uh and so you can integrate directly into your batch processing. So taking this notebook, you can see I have the same endpoint here. You can see I can run just AI query uh on that input here. So for example, we can run here and one of the great things as well about um AI functions is that uh we've integrated kind of observability directly into the product. And so for example, if your run is taking a long time, you can click in here and always explore a little bit more about your query.
Anyways, looks like our query has finished. And you can see that it does give us a response with the structured output that we want. Again, this is kind of the information extraction workflow. So we're able to identify you know what company if there is a company in this article as well as like maybe some events or actions that might have influenced it and so just to make that more concrete I have earlier created kind of this table of these results and um we can uh just to isolate some some rows with some data that data that we might be uh want to explore further.
You can see here these are actual companies and they have some events or actions that might have influenced you know their financial performance. And just like with the previous examples, we can always run further um analyses on these using for example AI functions such as AI summarize or AI analyze sentiment. So if we were to run this again, you can see we have a review for example there's this company that bought you know some stake in another company and we can also analyze whether or not the sentiment is positive or negative.
So you can see with agent bricks, we're able to directly integrate into into the batch inference processing pipelines. Uh and it's going to be data intelligent based on what you've trained for your workload. And what we had done before this when we were using the brick is actually give it some examples of successful extractions from news articles into JSON. And so then that was able to help inform it and fine-tune it.
And then now we're able to use that in these functions. So jumping back to kind of like the key takeaways um from what we have today. Uh data bricks AI data bricks batch inference uh with AI functions is available everywhere where spark is available. It's going to be fast and performant and easy to integrate into your existing pipelines. Second is that you can automatically generate AI powered insights on your data uh at high scale with batch inference. uh it integrates directly into the data bricks workflow suite uh and you can also visualize them and add them directly into your AIBI dashboards.
And lastly, with our uh new launches recently, uh we're able to be data intelligent, which means that uh all customers can take advantage of the new multimodal capabilities and all the full integration with uh agent bricks. And yeah, so now we'd like to open the floor up for any questions. Anyone?
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.