Latest / Agentic Conversations (formally mlops.community) / Cost/Performance Optimization with LLMs [Panel]
Transcript
- 0:06Oh yeah, man. All right, Mario, and be guests
- 0:17of honor that I am going to end up replacing myself with Lena,
- 0:22Lena, you are the one who has been tasked with leading, this
- 0:26panel that is coming up. I'm going to hand it over to you
- 0:29and let let's get it started. Thank you all for joining us,
- 0:33amazing. Yeah.
- 0:38So I'm also the male engineer and I have an amazing panel for
- 0:41you today. So if two people who run large
- 0:44language models of production, we have Daniel was a research
- 0:48scientist at Neva, which is an ad-free private search solution.
- 0:53Try not quite nice and they using that language models in
- 0:57search for all kinds of questions, like summary,
- 1:00semantic retrieval query generation.
- 1:02So I'll be super interested to hear what you learnt by applying
- 1:05it to the sludge space, then we Mario was a staff engineer at
- 1:10intercom and they put one of these early Duty for power
- 1:14projects out which was a chatbot.
- 1:17And then we have two people from the tooling space.
- 1:20Really also very excited to have here Jarrod, which is the
- 1:23co-founder of prompt layer, it's a platform to manage your
- 1:26production, LM apps with reliable prompt.
- 1:29Engineering monitoring of the problems.
- 1:31Like versioning cost latency and you can track historic usage,
- 1:36history and performance. So, So I'm really excited to
- 1:39talk more about evaluation and last but not least, we have
- 1:42Lewis who wears many hands. He is a professor of computer
- 1:46science and Washington and also the co-founder and CEO of up to
- 1:50ml where they offer easy and efficient deployment.
- 1:54And very interesting part for me especially was that you can just
- 1:57upload any computer vision or an LP model and it will be
- 2:01optimized and it will tell you which instance to run it on.
- 2:05And soon, you can also run your model stairs.
- 2:08So I'll be very interested how you help users to make these
- 2:11model run where you more cost efficient and faster.
- 2:15Okay, so maybe let's start with costs.
- 2:19We know generally running large language models is quite
- 2:22expensive, much more expensive than normal page, like, and apis
- 2:27Mario, and Daniel, maybe because you run it for products was
- 2:31caused an issue. How did you approach this the
- 2:36cost angle of running in production?
- 2:39Yes, cops was an issue especially with scale and I
- 2:43think that's kind of like where we started out.
- 2:45Out, we start off with some, these kind of like foundational
- 2:47apis as a way to figure out. Is this a product that's useful?
- 2:51Does this help our ranking signals to our users like this?
- 2:54And then once we actually started getting that both the
- 2:57cost of running that and how much we could run this on really
- 2:59becomes a bottleneck. So if you think about like
- 3:01summarization systems potentially running is like in
- 3:04production real time for users that's very possible.
- 3:07The API it's kind of slow, it can get expensive but what if
- 3:10you want to run some reason? Let's say the entirety of the
- 3:13women index which is Is on the order of billions of documents.
- 3:17At that point, no longer can kind of become actually cost
- 3:19possible. So, you have to move in house or
- 3:21some type of smaller system at the same time.
- 3:24It's just a question of like, how widely do you want to cast a
- 3:27net when using these models? How many people do you want to
- 3:29access them? And what is their expectation
- 3:31for turnaround time? Yeah, do you have a guideline
- 3:36like, how long would you start to have a working prototype and
- 3:40also, maybe could you speak on imagine?
- 3:41You're running it and house now but it's still expensive, right?
- 3:44So you have a ball park compared to other services.
- 3:47How do you evaluate that? And how do you bring it down to
- 3:50which level? So on the evaluation side or
- 3:53initially? Using kind of these foundational
- 3:54models, it's about kind of like having rapid iteration.
- 3:58The ability to kind of revive things via prompt and get this
- 4:01in front of users to actually figure out what they thinking
- 4:04and once users Pakistan like oh this is great.
- 4:06This is the use case that I'm working on.
- 4:08Then we tend to kind of focus in on figure out how can we distill
- 4:11this extract this into a smaller model within these kind of
- 4:15smaller models the process? We generally, think about just
- 4:18less around, just the dollar cost more in kind of like, where
- 4:21can I run this? And for us, the golden threshold
- 4:24has been, can we make this model run on a single?
- 4:27A 100 GPS are 810 GP or on any type of CP requirement because
- 4:32like when you moved from the a It's to an 8/10 say you're
- 4:36serving AWS that moves you from having to pay 40, bucks an hour
- 4:40because you have to get a tat them at once to on the antenna
- 4:43you can pick up a spot instance for 30 cents and so like at that
- 4:46price point you can do pretty much anything and then if you
- 4:48even move it to CPU, the game changes even further where you
- 4:51can move to billions of items without necessarily even
- 4:53thinking about this cancer. A lot of our work we're moving
- 4:56like first more semantic search, these are small, queer encoders,
- 5:00these are 30 million 40 million 100 million parameter models.
- 5:03And some that case, We can actually run the query encoder
- 5:07on CPU, so it sits in the same system that's actually doing the
- 5:11retrieval and so that can just simplify production.
- 5:14It just a question on really, like, figuring out what scale
- 5:16you're going to, what is your latency, throughput that you're
- 5:19looking for and what is precise? And one of the things that we
- 5:22saw was the foundation, IEPs are actually really slow and
- 5:25partially, that's actually really good.
- 5:26Because it changes your perception where it's like,
- 5:29before people's perception via Google search was like anything
- 5:32over 100. Milliseconds is terrible.
- 5:34Now People are used to eating three four, five seconds.
- 5:37And we've been able to see that we can take.
- 5:40If we're running toe here, we're running open an eye.
- 5:44What's it called? So it's very anthropic there on
- 5:46the order of like three seconds for a response for single batch.
- 5:49We can get a model that is 20 billion grammars to respond in
- 5:54400 milliseconds. So that like meth Improvement in
- 5:58speed is huge, just bring it in-house.
- 6:00And that's just because you don't have to go on the
- 6:02internet, it doesn't have to go through their orchestration, you
- 6:04can Deal with your own. And then the other thing is,
- 6:06when you bring this in the house, you really become a
- 6:08master of your own fate, where one, any type of latency
- 6:12optimization is actually all about you.
- 6:14You don't have to worry about API rate limiting, you don't
- 6:16have to worry about like, their entire system going down.
- 6:19I think that was actually one of the things that really pushed
- 6:22neither to bring these things in-house because sure opening I
- 6:26do ARP has 99 percent uptime. That's 99 percent for every one
- 6:29that was not what we're experiencing at all.
- 6:31And when we're trying to deliver this product and we're like
- 6:34well, This use case doesn't work because their overall systems
- 6:38down in, we can do anything, but sit in our hands, it really gave
- 6:41us kind of like the impetus to bring this in-house.
- 6:45Now, we experience the same issues.
- 6:47We also had regular there were regularly not available
- 6:50sometimes 50 minutes at a time, so there was a problem.
- 6:53Okay, anyone else on cosmetic surgery?
- 6:56I can I can I just jump right in here to say, Amen.
- 6:59Like I love it was just what he just said more like, this is
- 7:02exactly our point of view is that it often you don't need the
- 7:05highest-end harbor, right? So you can live with Hardware
- 7:07that actually hits you or latency and throughput
- 7:09requirements, you know, even though there seems to be a
- 7:12strong let's say Shortage of high-end silicon.
- 7:16Many people don't realize that they don't probably don't need
- 7:18high in Silicon to deploy their models.
- 7:20And, you know, basically what dr.
- 7:22Now offers exactly what you talked about, but in the general
- 7:24way in a fully automated platform for broader users to
- 7:28deploy their own model, their own custom model or another
- 7:30source model in a black community control automatically
- 7:33choosing the silicone for you in turning models into high
- 7:37performance portable artifacts and code that you can run on
- 7:40different Hardware. I just want to say you know we
- 7:42should definitely follow up after this because Is our real
- 7:45value here is 100% aligned, so many panels will need to
- 7:48disagree with each other, so somebody should disagree with
- 7:51with him to make decisions thing, right?
- 7:53So you can disagree about the most promising ways to go about
- 7:58cost reduction. So if you each had two name,
- 8:00like your top two methods because you can do so much
- 8:03right, if you, if you start reading on the internet, what
- 8:05are the top things to do to reduce cost?
- 8:07You have a list of like 20 items so maybe you can disagree on
- 8:10that. Like that, that means if you
- 8:12give me each your top two, okay? SOC.
- 8:14Something has a to first of all, make pick a model is visiting
- 8:18that you need an optimized as much as you can because then you
- 8:21have better performance in a given Target and then second
- 8:23choose the right silicon for the one that has the lowest cost
- 8:27possible in hits your performance requirements.
- 8:30So you're also saying a different model type like a
- 8:32smaller type of model. Exactly.
- 8:34Yeah. The right model optimized as
- 8:36much as you can hopefully automatically and then to take a
- 8:39ride harder for it. Yeah.
- 8:40My two things would be kind of like structured kerning and
- 8:43knowledge distillation. Where You can take the large
- 8:45model and then you actually just remove portions of it until it
- 8:49fits in whatever systems you have in.
- 8:50Like, I like direct example for this, like, we're serving a flan
- 8:54T5 11d player under model that physically doesn't fit in an
- 8:588/10 GPU until you remove at least 60% of the way.
- 9:02So you have to just because like the actual size of the model,
- 9:05once you've done that, you can make that model fit in that
- 9:08small and GPU, but then you have to use some form of knowledge
- 9:11distillation. So the model doesn't actually
- 9:13have this like Icing quality. In generally speaking, those two
- 9:16things together really provide like big big performance
- 9:21improvements and get really crafty with your distillation.
- 9:24And I used to work at narrow magic, which focused on
- 9:27distillation for CPUs and everything else and we were able
- 9:29to get 30 40 50 x improvements on text text classification test
- 9:35by basically just pushing in that like knowledge,
- 9:38distillation is far as we could with the biggest teacher model
- 9:41in the smallest student model and that just works extremely
- 9:43well. The downside to it, I'll take my
- 9:45own going against myself the other corner.
- 9:48There's a non zero cost actually moving all these things
- 9:51in-house. Like if you think about the
- 9:52beautiful part about these foundational models is the
- 9:54feedback cycle is super fast because if you think about like
- 9:57saying you're doing something with the prompt for search
- 9:59engines, you want to rephrase how your system works.
- 10:03And so you just change the prompt and it runs it's good if
- 10:05in production is good to go. If you want to do this in-house,
- 10:08you basically say you're like, you want the system to take a
- 10:11more neutral tone, you have to go through all this, iterative.
- 10:14Approach to make data sets to store this data set into
- 10:17something smaller. Take a small compressor into
- 10:20something smaller, figure out how to boost your production.
- 10:22So like your iteration time goes from being on the order of
- 10:25minutes to potentially days weeks.
- 10:27And that's kind of like this place.
- 10:28Nice trade-off of, like, how much do you want to explore?
- 10:30How quickly you want to be able to iterate on products, with
- 10:32customers to? How quickly do you want to be
- 10:35able to optimize him control your own fate?
- 10:38It's running and house. What do you say, what size of
- 10:40team do you need? Just for the upside of Running,
- 10:44Man, A few models, let's say to kind of complete.
- 10:50Guess it depends. It depends.
- 10:53What type of model probably. But just maybe.
- 10:54Can you give listeners like a ballpark on the on the amount of
- 10:58work that you had to do? So I would say the bringing
- 11:01these models in the house and making models there was roughly.
- 11:05There's about four of us that were working on anything from
- 11:07data modeling to. I'm the compression guy.
- 11:10So that's what gets me up in the morning, but there's other folks
- 11:12are working on the modeling side and otherwise, I think, Overall,
- 11:15it Neva directly working with models, have probably around ten
- 11:18of us. Okay, and Mario, dark thoughts
- 11:23on the cost side. I can maybe you like few
- 11:25thoughts on how you can control cause before you actually move
- 11:30anything in the house. So we don't really like, we
- 11:32don't train or find, you know, limes ourselves.
- 11:34So right now, we are pretty much on the consumer side just going
- 11:38already apis, and it's tricky. It's expensive.
- 11:42And I think, even the Vinci can be a very expensive model,
- 11:46depends how you use it, and most of the time.
- 11:50Like we just first do pretty much visibility exploration of.
- 11:55Is it possible to do what we want to do in some like really
- 12:00isolate the cases? Like can we summarize one
- 12:03conversation for example and to let yourselves that capability.
- 12:09We would take the best model first probably similar, that's
- 12:12possible. And let's try to go down down,
- 12:14you know, just try to Pare down the model to the lowest model
- 12:18that gives us results are okay. Okay, like Daniel mentioned
- 12:21that's often like I think producing games 25 years ago
- 12:27where everything is too slow and you are totally like limited by
- 12:32how much you can process and kind of like Cuts both from like
- 12:37cost of latency perspective like you just can't summarize all the
- 12:40conversations in the come because will bankrupt
- 12:43straightaway, there's like too many of them.
- 12:46So but like one thing that's one thing that's interesting.
- 12:50More like cost reduction is just basing engineering thing which
- 12:53is just call it class and that's not always possible.
- 12:57Of course I think like probably like in Danielle's case an Evite
- 13:00that's little more tricky. You're doing semantic search.
- 13:02But like the systems we build are usually a complex set of
- 13:08things that talk to each other. And there are multiple.
- 13:13There are multiple components that are implemented with LMS
- 13:17and sometimes you can put like a really simple classifier.
- 13:20Fire before doing something to figure out, whether it's even,
- 13:23really would make sense to call along at all.
- 13:26So that's, you know, that that's one technique that I think can
- 13:30work quite well, because not all tasks are some things you can
- 13:33find the tool. That's really simple and is
- 13:36going to be able to say whether the more complex and smart tool
- 13:40is going to has, has any chance of finding an answer?
- 13:42Yeah. And I just a cup Mario's first
- 13:45point there that like the first step.
- 13:47Yeah, you could do these bringing And bringing it locally
- 13:51or whatever. But if you're using these large
- 13:53Foundation models from open AI or whatever, the first step is
- 13:56just knowing what's going on just building virgin one and
- 13:59kind of see understanding how the cops works.
- 14:03And this is like, it's a bigger step than you'd expect and just
- 14:07understanding which prompts in your system, which parts are
- 14:09expensive and like knowing where to go from, there is a pretty
- 14:14important actually. So just echoing that otherwise.
- 14:17Yeah. So this is some great tricks,
- 14:19you can employ. When when starting off and then
- 14:22maybe later when you scale to bring it in the house, okay,
- 14:25let's talk about latency. It's okay.
- 14:27You said one more thing and you would think that I think was
- 14:30supposing places but I do for said explicitly was you know
- 14:33there's plenty of Open Source ready to go models that can do I
- 14:37think Daniel mentioned in notified flying, for example,
- 14:39can we find for users and people realizing that you don't let you
- 14:42do not need to pay the open-air? Cohere tax.
- 14:46If there is a use case that you know the open source model can
- 14:49do well Any kind much more efficiently in the platform that
- 14:52you control that you might not need to do it on your own that
- 14:55they're already gives you a very very significant rule for cost
- 14:58savings there, right? So just know your use case.
- 15:00You don't kind of like this analogy of user CPU because it's
- 15:04General, but a CPU is expensive but then use the GPU to the book
- 15:07of the computation because that's more efficient.
- 15:09I think this. Is there a chronology here?
- 15:11Where you have these you know General expensive models like
- 15:15upt for that have to pay to use but then for things that, you
- 15:18know, that you want to do and you Can specialize it and use an
- 15:21open model. You probably going to pay a lot
- 15:23less by probably orders of magnitude and just to make it
- 15:25interesting and push back a little bit.
- 15:27I'd actually say that please the way I see it.
- 15:31If you're if you're I mean it depends where you are in the
- 15:34stages of development. If you're building burning one,
- 15:36if you're trying to ship something we're honestly most
- 15:39people working with lme's today are trying to ship version 1.
- 15:42I'd say don't bother with open source models, get something
- 15:44working on PPT or some person. Yeah yeah, yeah.
- 15:48But what just like a tissue Writing code here, you write in
- 15:51the CPU, you make sure it works and then you'll float to the
- 15:53efficient compute unit. That does what you need to do
- 15:56similar thing here. You start simple with the model
- 15:58that, you know, is more expensive.
- 15:59And as you understand what you actually need from it, then I'm
- 16:02fairly confident. You can find a local Source
- 16:05keeper multitude, does what you need to do, right?
- 16:07Question-answering summarization, and stuff like
- 16:09that. I think the part that's
- 16:11important to consider the cost reduction.
- 16:13Also, just his Staffing a team like the star have here is I've
- 16:17always worked in like the search World of like, big search
- 16:19engines. So There's always been a lot of
- 16:20money behind this. There's teams everything else.
- 16:22My brother used to work at fine Tech and at some point, they
- 16:26were looking for something that could classify businesses.
- 16:29And when they poked around and figure out like what would this
- 16:30cost to have our own system? You have to hire people.
- 16:33You have to hire these 1ml engineer, probably infer
- 16:36engineer. You have to run it in pretty
- 16:37much. Their bottom Barrel costs would
- 16:40be on the order of five six hundred grand a year just for
- 16:43like the team and they can make many 9% like what Alex was
- 16:46talking to them. But in reality they just needed
- 16:48something that was 17. Share, and like you say, just
- 16:51plug them into a system. They never had to hire an LP to
- 16:55end. Never had an MLT.
- 16:56They had the system that was beautiful because like they
- 16:59could go in and someone who could just tune The Prompt until
- 17:02it works. Well enough.
- 17:03And it just like, by using this large system, they save money
- 17:07because they didn't have to hire expensive people like man and
- 17:10it's an understanding use case because they were only pushing
- 17:1210,000 examples through today. So like their cost is not as
- 17:16High versus on like a search engine side.
- 17:18Or when you're like doing all the Ian's of intercom has like,
- 17:21if you wanted to do all the summer is then that kind of cost
- 17:24calculus change. It's a question of scale.
- 17:26So clearly if you, if you use it, like the x0 plus type of
- 17:31thing with a human in the loop, then using a z, i will be always
- 17:35more cost-efficient. It's a good point.
- 17:39All right, everyone, I just want to jump in real fast because I
- 17:42have a huge announcement. We will be having a part two of
- 17:46our large language models in production.
- 17:48The first conference was Success that we had to follow it up
- 17:51because there were so many incredible speakers that reached
- 17:54out after the first one. I couldn't help myself.
- 17:56So it will be on June 15th, and it is going to be online.
- 18:02So anyone from anywhere can join, but if you thought the
- 18:05first one was good, then boy. Are you in for a treat?
- 18:08We have some confirmed speakers already.
- 18:10I'll just go through a list of them, Mac tape from data bricks,
- 18:14you know, the founder of data, bricks, and Spark, and all that
- 18:17good stuff. We recently just had him on the
- 18:19pod. He's coming back to Keynote.
- 18:21You've got chip hewn, who is an amazing person and incredible
- 18:27follow on social sharing. So many insights and has been
- 18:30dropping knowledge bombs when it comes to large language models
- 18:33recently, you've also got Scott McKay from MIM dot AI.
- 18:39You've got the Deep speed team is gonna be there from Microsoft
- 18:43that is pretty epic and Sahar more from stripe.
- 18:47Another stripe alumni is Emmanuel.
- 18:50Send he's formally of stripe. Now he's working at one of these
- 18:53large language model companies that you've definitely heard of,
- 18:55but I don't think I can spill the beans on yet, and we've got
- 18:59Lance Martin in as from number station.
- 19:02George Matthews from Insight Partners.
- 19:05This is just a glimpse at the whole list.
- 19:08Go sign up. You've got all the details in
- 19:11the link in the description. Huge shout out to the sponsors
- 19:14redis for showing us some love and making sure that this event
- 19:18happens. Our Gala Any scale, continual
- 19:21chroma. Thank you all.
- 19:23And you can expect all kinds of bad musical improvisation.
- 19:27The brakes, like I normally do it.
- 19:30And who knows? I may make that I hallucinate
- 19:33more than chat GP t-shirt available for sale again.
- 19:37Check it all out. Links in the description, will
- 19:39see you soon. Okay, so moving on.
- 19:43Which is another. More.
- 19:48You know, spoiled from normal classification models but just
- 19:51moving into the LM space and seeing that.
- 19:54Just one token takes 3.7 seconds on P90 was shocking and then you
- 19:59normally you need like a whole sentence so that can take
- 20:03several seconds. And how do you deal with that?
- 20:06If you have a user on the other hand who was like yo I'm really
- 20:08very impatient things after 1. Second application is broken,
- 20:12what are typical? How do you go through the life
- 20:14cycle? When you start, you start out,
- 20:16maybe not looking at speed. What?
- 20:18Of speedups can be a possible to expect.
- 20:23Do you do this trade-off between the model size and speed or
- 20:27like, how are you thinking about this, and maybe also throw your
- 20:30best tips? Like, if you had can do one or
- 20:32two things on speed, what you do.
- 20:36If you don't have a lot of time, literally, I can walk through
- 20:40directing that we didn't even we've talked about is our
- 20:42initial summarization model and initially use a large language
- 20:46model, you get the summary. Basically looking at about three
- 20:49seconds per item and we're doing a batch of 10.
- 20:52So we're basically 30 seconds you we did this and figured out
- 20:55that like oh turns out this is actually used when very good
- 20:58entering her prompt and then brought this into a smaller
- 21:01model house just doing in to a T5 large model, but serving that
- 21:04on like a bad size of 10 on the A-10 still took like eight
- 21:08seconds naively. So we kind of went about all
- 21:10these ways. So, first off, there's a great
- 21:12Library called faster Transformers, Nvidia, kind of
- 21:15supports that they don't fully support it so like you Fiddle
- 21:18with it a little bit, but just moving from native python
- 21:22serving to faster Transformers, basically brought us down from
- 21:25like 8 seconds to like 1.8 seconds.
- 21:27So huge games just on changing. How it served it worked on the
- 21:30GPU kind of funky build process, but it works super well.
- 21:33And then from there, we threw in some notion of structured
- 21:36pruning and asymmetrical spurning on the encoder.
- 21:38Decoder side, just because the encoder produces this conceptual
- 21:42representation on a sequence sequence model.
- 21:44And you want the best conceptual representation possible, and
- 21:47also only runs once said of Costas pretty much doesn't
- 21:49matter version of the decoder runs again and again and again.
- 21:53So we heavily compressed the decoder.
- 21:55So we basically took this model that start off with twenty four
- 21:57layers on either side and brought it down to twenty four
- 21:59layers and one side and four layers on the decoder.
- 22:02And that meant that, like, by the time that we were done with
- 22:04faster Transformers, this compressed model we got down to
- 22:08roughly, like, 300 milliseconds per batch of 10, which that
- 22:11allowed us to basically say, hey it now will cost 20 thousand
- 22:14dollars to create a summary for everything in our index, and we
- 22:18Actually do it because we like decrease these costs versus when
- 22:21it was 10 seconds. 30 seconds and think just not track.
- 22:26Yeah, I guess I just wanted to underscore making sure to use a
- 22:29very best kernels. A very best binaries for the
- 22:31given harder. They running it on because it's
- 22:33a few can do without changing your model at all or any
- 22:35batching parameters. Any other Supremacy start with
- 22:38that and see how far you can go, you know, if you the problem is
- 22:41that this is dependent on the hardwood Target very specific
- 22:43than the harder Target. So the more you can automate
- 22:45that the better they'll put a plug in for what I've come out
- 22:48does. We can help you search
- 22:49automatically for what's the right library or compiler using
- 22:52tensor, t or T V M or, you know, could be n for NVIDIA or the
- 22:55equivalent for all the harder targets.
- 22:57Then after that, you know, change the batch size.
- 22:59Sure. You might pay a little bit more
- 23:00harder to decision, but its latest really matters to you
- 23:03reduce the batch size that a little bit more.
- 23:05So, I'm really happy to hear. Sorry.
- 23:12I really like what you're talking about because like if
- 23:16you're not real they're just talk like talking to some
- 23:18external API. Your hands are so tight.
- 23:21So effectively, you have like two ways to improve.
- 23:25The latency one is by shared capacity.
- 23:28If they if they can give it to you and then, you know, you can
- 23:31play a bit more. We'd like to put latency curve
- 23:34and like, very want to sit there and the second one is, maybe
- 23:38like what I said like if you're okay with, not finding an answer
- 23:41and if you can detect It quickly if you just don't call it and
- 23:44return the answer straight away like they are you expert dimes?
- 23:47I think it's becoming quite for like chat applications.
- 23:51You know, just piping the tokens directly from LM to the user.
- 23:55So user is, you know, seeing straight away that something is
- 23:59happening. But sometimes, dreaming do that
- 24:02streaming effectively? Yeah, like some like directly
- 24:05from lm22 to the end user experience.
- 24:08Like sometimes you want to check, what's the answer one?
- 24:11It's full Fully generated. And in these cases you have to
- 24:16wait for it. And for example, if we're GPT
- 24:19for shared pool of capacity like the the latency I'm seeing is
- 24:24something like 100 ml per token. The tone for English is usually
- 24:29one of our per token, they change the tokenizer 4254, but
- 24:32it's extremely high. So I'm really, I'm really happy
- 24:35to hear what Daniel and those are talking about because I hope
- 24:39we'll be able to actually, you know, move some of these things.
- 24:42Like once you understand like we choose cases are actually the
- 24:45most important for us and which use cases make sense to to
- 24:48optimize and bringing house. There's some tricks you can
- 24:51still do on. When you when you call an API,
- 24:54you can work with a prompt because the main database is
- 24:56actually in the output, not in the size of the input.
- 25:00So you can, you can tell it to because ice or give you back a
- 25:03number of paragraphs, like be a bit shorter and the output.
- 25:08So this is something I mean, we can clearly see from the panel
- 25:11that If you want to be really fast, you need to move it in
- 25:13house. But let's say you're in this
- 25:15first stage where you still need to understand the cost and the
- 25:18speed, there's a small amount of trick like semantic hashing and
- 25:22what Mario mentioned that you can do and maybe Jared you're
- 25:25also have a dashboard where users can track latency they
- 25:29observe, is there some insights? You can share?
- 25:31Like how do they like what You observe in terms of you users
- 25:35with respect to agency? Yeah, I guess the interesting
- 25:38thing here yet is, what is the low hanging fruit to kind of?
- 25:42With latency you mentioned one is obviously like how long the
- 25:45responses but the other one which is also very obvious but
- 25:49falling back to different types of models.
- 25:51So obviously, if you can detect, how how badly you need to keep
- 25:56it easy for over 3.5, if there's use case, where you can fall
- 25:59back to 3.5 a faster model or even something kind of left,
- 26:03although that might be the fastest what they have now.
- 26:05But or maybe Claude or something like that, kind of, there's
- 26:09becoming in fact, there already is probably This whole axis of
- 26:13which engine do I use for this problem as opposed to kind of
- 26:17just saying we're using gbd4 for everything or we're using our
- 26:21in-house for everything. I think these are all tools that
- 26:24have pros and cons and one of the pros and cons of each has
- 26:27Lanes, I can't resist bringing up again, like 11 thought it was
- 26:31mentioned very briefly that streaming the output like I'm
- 26:35more on the user side. These days interacting with his
- 26:37boss they go to buffer the entire answer before they show
- 26:39it to me. A simple thing that just Human
- 26:42decency to say it's being typed, or streaming it to the user,
- 26:45because then you see the something's happening, right?
- 26:48So he attacks by slack bot, Siri buffers entire album, before
- 26:51shows it to me. Like if you just said, hey, the
- 26:53boss is typing, just let this GPU work hard for you that we
- 26:57already go a long way. So don't change the latest just
- 26:59manage human expectation. They will probably go a long way
- 27:02as well. That's such a good point, the
- 27:04actual UI experience and there's some drawbacks in terms of like
- 27:08safety of the response like if you stream it, you Uncheck the
- 27:12response so that could be a concern for some type of
- 27:15applications, but I like your second idea of like typing.
- 27:18Like when you see someone typing in some different types of like
- 27:22a human I don't know. Different shared applications
- 27:24that helps you see they're typing.
- 27:26It's a good idea. Okay, I think because I had real
- 27:30quick. Yeah, I think there's a lot of
- 27:31ux ways to do this to solve this problem.
- 27:34That's one thing. And then also just one of their
- 27:36addition is these latency amounts of like keeping
- 27:41dee4diesel. Insane amounts of the models
- 27:43being offered are not constants either.
- 27:46We've like been looking kind of at our high level like user data
- 27:49and the lane season like very spiky of things like even before
- 27:54and like is very laggy. Some days and not other days.
- 27:56So, if you really care about optimizing, that's probably
- 27:59another thing to look at. Yeah, that's definitely an
- 28:02issue. They don't support any essays
- 28:04yet, so I guess that's hopefully soon to come, well, be having a
- 28:08latency page to kind of help with that soon.
- 28:10So stay tuned. On something we talked about
- 28:14earlier, I meant he's like that sizing is hugely important both
- 28:17for like the streaming component.
- 28:19But also, if you think about like, when you're actually doing
- 28:23this, like greedy token by token decoding.
- 28:25If there's any difference in the length of each batch, everything
- 28:28basically defaults to the longest bench.
- 28:30So like there is some literature out of Washington, I think that
- 28:34in machine translation they found those like 70% of tokens
- 28:39in batches were effectively used as tokens because he was driven.
- 28:41By the longest padded sequence and so like, especially if you
- 28:45have a high variability in your outputs doing anything but a
- 28:48small batch size King like be bad because it's like if you
- 28:52have a short response you don't get to enjoy that.
- 28:54Basically you're all your responses are limited by your
- 28:58longest output. Hmm.
- 29:01Make sense. Do you have?
- 29:03Do you control for that and your prompt somehow or do you?
- 29:06How do you handle that the control of a larger size?
- 29:10Okay, on our side we've done a bunch of optimization there even
- 29:14as you mentioned on like making the gbd3 up a more concise
- 29:17percent we kind of can just do them but it's really just kind
- 29:21of fiddling around with it. Like one of these things that we
- 29:24saw was with this kind of asymmetric pruning that we did
- 29:28when you move the batch sizes larger, all the gains went away.
- 29:31Way. And that's because like one of
- 29:32those smaller you really could like highly optimized it because
- 29:36you're not waiting on this decoding versus when you have a
- 29:38large batch size, you're just basically dominated by the
- 29:41longest sequence of all your compression is completely kind
- 29:44of just broken. That makes total sense.
- 29:47Okay, let's talk a little bit also about monitoring.
- 29:50I'm very curious what you guys found, useful both like human
- 29:55base and I am based modeling any other type of techniques that
- 29:59you found useful Can jump in here with like a high-level
- 30:03overview and I know talk to Mario personally about this.
- 30:07I'm sure he has some things to add to but kind of what we've
- 30:10seen our users doing kind of breaks down into three big
- 30:14categories. First category is, which I think
- 30:16is the real source of Truth is end-user giving you a thumbs up
- 30:19thumbs down or you can use behavioral-based maybe like
- 30:23clicking refresh or closing out is a thumbs down as a negative
- 30:26signal on like how the prompt is doing.
- 30:29That's one category. Another category is this This
- 30:31whole mturk hiring out, click workers to do, very boring, very
- 30:36boring way to do it in my opinion, the third category,
- 30:39which I think is really kind of where the future is here, is
- 30:42synthetic evaluation. So how do you actually use an
- 30:45llm to rate how good it is? And the one interesting thing
- 30:50I'll add here, which is kind of a thesis.
- 30:52We're developing based on our conversations at prom player is
- 30:56kind of via - is the right way to do this instead of trying to
- 31:00understand. Which prompt you have how good
- 31:03they are. It's better to reverse the
- 31:05problem and say, how can I evaluate what's failing in
- 31:09Prague which users are getting bad results.
- 31:12Like is the chatbot being rude as kind of fit the most trivial
- 31:15example of this. But that that's the way we see
- 31:17it. Yeah, to be direct on that that
- 31:21were calling this critic modeling, and it works extremely
- 31:24well, especially with the most recent models we found that.
- 31:27So, like, on a seven-point scale, The GPT for is f by an
- 31:33average of one label, which I used to do a bunch of human
- 31:36evaluation, that's pretty much the best.
- 31:38You're going to get off. Like a train judges, and it
- 31:41works across fluency, accuracy other things.
- 31:44The one thing here is their huge positional biases.
- 31:47So, we found that if you ever try to compare two things, the
- 31:50outputs don't work as well. So it's best to try to focus on
- 31:53individual comparisons. And then potentially using some
- 31:55like, wheat supervision signal to figure out pairwise things.
- 31:59Can you give us a concrete example of a new me?
- 32:01Critic. Like what is the problem you're
- 32:03giving the critic or how does it work?
- 32:05If you're writing a thing as the engine, you were tasked to
- 32:09evaluate how good a summary is for something.
- 32:12You are evaluating Anna terms of accuracy.
- 32:14Something that is completely accurate has X characteristics
- 32:17as a seven, something that is slightly missing.
- 32:19Something this is six provide all your description of labels
- 32:22give it to the model. The model will respond.
- 32:24Pretty damn well. But I will say like the caterer
- 32:27don't try to say hey I have these two summaries which is
- 32:30better. Or because the model will
- 32:33there's position bias. Depending on what you put first
- 32:35or second the model will favor with last.
- 32:38And at the same time the outputs aren't as usual is kind of like
- 32:41the old Costco thing where you never ask someone why they
- 32:44prefer something. Because if you ask them to
- 32:47justify it, then they will not actually give you their
- 32:50Preference. They will give you an answer
- 32:52which they can justify. So don't ever ask model to
- 32:54justify. Okay, just saying recency bias
- 32:59is also known in human decision-making by the way.
- 33:01Like, if you give a man, like a verbal statement of choices,
- 33:06people just forget very similar to what we observe in the
- 33:09network. The first option, intend to pick
- 33:12some of us and decision design. Very interesting Behavior
- 33:14research. We got a bunch of stuff in house
- 33:18and we found someone to a Jared mentioned.
- 33:20We're like the tail Laden sees can get very out of hand where
- 33:24you can see, massive spikes, you can be caused by.
- 33:26He's weird Corner cases that you never thought of like we were
- 33:30seeing massive tail agencies, occasionally and that turns out
- 33:33we were running a model on a sliding window and occasionally
- 33:37hit super long documents. And like the solution was like,
- 33:39oh what do you do? Just truncate after 10,000
- 33:42tokens but sometimes in the only way that you'd see, this is
- 33:46like, you look at what these outliers are.
- 33:48And in most cases, any time we've seen an outlier, the
- 33:50solution is super simple. It's just like, oh, we didn't
- 33:52know about this weird Behavior and the easy fix we no longer.
- 33:56Have that I cut my call. This terrible have a worse name,
- 34:00but I call this terrible experience debugging, which I
- 34:03regularly do. I wasn't recommender systems.
- 34:06So also money toward like the really bad experiences and they
- 34:09just picked one every week to Deep dive on the root causes
- 34:12very similar to you saying like, monitoring the bad experiences
- 34:17like the edge cases elongated see and then you'll find like
- 34:20groups of problems that you can fix one over one.
- 34:23Okay, cool. I think we're out of time.
- 34:25You spent one more thing if you don't mind.
- 34:26So putting a plug you come try to octal male profile at you
- 34:31with a single line of code, you can get your mother running
- 34:33across even harder in the see, the profile of the latency takes
- 34:36four, different options is going to give a very actually running
- 34:39the modern provided for you. So love to hear from you soon.
- 34:42Yes, please try out. The interesting components are
- 34:46dangerous to hear from others like Bravo and chat like how
- 34:49they deal and labeling becomes too expensive as well.
- 34:53If you need like you before for labeling then you know it's
- 34:55expensive again. N.
- 34:57So whether people have like some smart sampling techniques or
- 35:00maybe like pre-filtering initially are there Solutions
- 35:03out there for that. It seems so nascent field to me
- 35:07that pretty much like all the tooling is just in the process
- 35:10of building. So yeah, I'd be happy to hear in
- 35:13chat of like what people use for things like that.
- 35:15There you go. Oh, that's awesome.
- 35:17So we will continue this conversation in the chat.
- 35:22Yeah please let us know what everyone is thinking.
- 35:26And And thank you so much. All of you were incredible and
- 35:30these are like, these are very poignant questions and I really
- 35:35think that you all educated us a ton on how you're going about it
- 35:40and what kind of best practices you found thus far.
- 35:45Wow. Alright.
- 35:47Thank you later. You all off speed.
- 35:49See you later.