Latest / Agentic Conversations (formally mlops.community) / All About Evaluating LLM Applications // Shahul Es // #179
Transcript
- 0:00Hi, I'm Shahul. I'm the co-founder of Exploiting
- 0:02Gradients and I take my coffee black and without sugar.
- 0:08Hello and welcome everyone to another edition of the ML OPS
- 0:11Community Podcast. I am your host Dimitri OS and
- 0:15today we are talking to none other than Shou S This man has
- 0:21been doing very big things in the evaluation space.
- 0:24He's also been absolutely killing it with the Open Assist
- 0:28project. You may know him because he
- 0:31created the Ragas project, which is an open source evaluation
- 0:36framework for Rags or retrieval augmented generations he's got.
- 0:44Such a pulse on the open source LLM ecosystem.
- 0:50We had a deep dive on how to look at evaluation, where to
- 0:55even start if you're thinking about Ohh man.
- 0:59I'm trying to debug this. I don't know what is wrong.
- 1:02Is it the open source model that I'm looking at?
- 1:05Is it the prompts that I'm looking at?
- 1:07Is it that I'm serving it on the wrong type of hardware or do I
- 1:13need to check out? My vector database.
- 1:17Do I need to look into that and my chunking it correctly?
- 1:20Sparse, dense vectors? I'm just throwing out buzzwords
- 1:24right now, but since he got into it because he actually knows
- 1:28what he's talking about. And then we did a whole another
- 1:33deep dive on the state of benchmarks.
- 1:38Shameless gives us all kinds of insights and wisdom into this
- 1:43world. Hope you enjoy this
- 1:45conversation. And if you know one person, just
- 1:48one person that you think. Would value this podcast.
- 1:54It would be a huge help to me and the team.
- 1:59You can share it with that person.
- 2:06Shahrukh, it is great to have you on here.
- 2:09I'm excited to talk to you and I think we have to start with the
- 2:12big question, almost like the existential question.
- 2:17What does evaluation mean to you?
- 2:21Yeah. So evaluation means to me is a
- 2:25way of really measuring and quantifying the performance of a
- 2:31system. So whatever it may be can be
- 2:34alums, it can be a traditional system or whatever.
- 2:38And why we should evaluate is because if we want to make any
- 2:43improvements on something, the first step is to measure and
- 2:46quantify it in the 1st place. Then then only you will be to be
- 2:52able to do any kind of iterations on top of it and see
- 2:56if these iterations have made any positive or negative.
- 3:02What country impact has these iterations made in with in in
- 3:06your system so? That's what what is evaluation
- 3:10and why we should do evaluation. Awesome.
- 3:13So basically, what you can't measure, you can't actually fix,
- 3:19and you've got to iterate as much as possible to make it
- 3:24better, all right? And so when it comes to
- 3:29evaluation, I mean, you wrote an awesome blog post that I saw and
- 3:35I loved, and you talked about all the different ways that we
- 3:39can evaluate, and I think that. It stood out to me.
- 3:44There was a few things that stood out to me.
- 3:46Probably the first one is. That we have all these
- 3:50evaluation metrics, but it feels like sometimes when models come
- 3:56out, they just say how they do against these evaluation metrics
- 4:01and just saying how they do against evaluation metrics.
- 4:06I've learned to. I'm almost like immune to that
- 4:09now because it feels like every model that comes out, says Ohh.
- 4:12We're state-of-the-art on these benchmarks or this or that.
- 4:17Yeah, you felt that way too. And what do you think about
- 4:20that, right? Even even as a guy who deals
- 4:24with these open alms on a daily basis for a variety of purposes,
- 4:28I have found it really hard to select an LLM for my own
- 4:33application or my own usage. And these open LM leaderboards
- 4:38are actually going to be less reliable than more reliable, if
- 4:42any. And this can be because of maybe
- 4:46an ongoing competition or race to produce the best model in the
- 4:49leaderboard rather than producing the best useful model
- 4:54in general. So it's a tricky situation.
- 4:57As of now, everyone is trying to optimise for a particular leader
- 5:01board and that optimization becomes a kind of overfitting to
- 5:05the particular datasets or leaderboard itself and making
- 5:11the model or even the efforts less useful in the long run.
- 5:16So I will share the same feelings and it is something
- 5:20which the open source community and that basically the LLM
- 5:25community has to figure out really quickly so that people
- 5:29can actually choose an LLM and actually know which LLM is at
- 5:35least good for a particular task or something.
- 5:39And rather than just trusting random leader boards which could
- 5:43be blindly over philtre to the leader board itself.
- 5:46Yeah, and let's just double click on that for a moment,
- 5:49because why are these random leaderboards getting gamed?
- 5:53Is it because some of the? Evaluation test sets are being
- 5:58used in the training and then they're over fit for that.
- 6:00So it's like the model basically knows the answer before it's
- 6:04asked the question. Or are there other tricks that
- 6:08are happening? So there are two reasons that
- 6:13are mainly observed. The first one is the one that
- 6:16you pointed out. These datasets and tasks are all
- 6:21open, so people can use these datasets to fine tune them all
- 6:26on these datasets. Which means that model has which
- 6:30already seen that test set it. So it basically breaks the
- 6:35preliminary assumptions of formulating a test set that
- 6:38tests the model Should not have seen the test set before.
- 6:42So that is a first problem and the second problem can be the
- 6:46use of evaluation metrics that have poor correlation with human
- 6:53judgement. Even these days many of these
- 6:55metrics that we use thus does not really have high
- 6:59coordination with human judgement when it comes to low
- 7:02form answering. So basically when you say that
- 7:05assets or even evaluation you will have different types of
- 7:09datasets. One data set could have a simple
- 7:12one word answer it could be one word question answering and some
- 7:16other data set could be something like a loan from
- 7:19question answer. So for short form question
- 7:21answering, it is basically very easy to compare.
- 7:24You know OK if this if you expect the answer as York City
- 7:28and the model gives out something like New York City or
- 7:31NYC, you you rather figure out some some metrics to see that OK
- 7:35these answers were similar and hence the model was correct.
- 7:38So for long form answering there are very few datasets available
- 7:43and there are not really very good evaluation methods
- 7:46available to do it for. For example, how do we evaluate
- 7:49the capability of a model to write a summary or or or a long
- 7:54story. So then they they introduced
- 7:57different dimensions for example coherence, fluency, etcetera,
- 8:01etcetera. And these dimensions are
- 8:03evaluated on on the basis of mostly traditional metrics which
- 8:09are not really highly coordinated with human
- 8:11judgement. So that could be the reason why
- 8:13the evaluation metrics itself feeds or even the third itself
- 8:16fields. And the first one is obviously
- 8:19the overfitting to the test set which should be avoided.
- 8:22So has a very similar situation. Whenever they host a
- 8:27competition, they have to evaluate these models and models
- 8:30that people submit, right? So what Kaggle does?
- 8:33Is that OK? Sure, the player should be able
- 8:37to understand or have an estimate of the performance of
- 8:41the model on leaderboard, but that estimate will all be final.
- 8:45So there will be a public test set and a private test set.
- 8:49So it ensures that the model are not all fit to the public test
- 8:54set. So if you have a say if you have
- 8:57100 sample test set that you are trying to optimise for, you
- 9:01could train your model anyway and just optimise for that
- 9:04particular data set itself just by measuring the performance 10
- 9:08times, right? Yeah, but that's not the ideal
- 9:11outcome. The ideal outcome is something
- 9:13which is much more generalizable.
- 9:15So that's why Carol keeps it private leaderboard and private
- 9:18does it to avoid any of these situations.
- 9:21So that's an effective thing that open source can adopt.
- 9:25Yeah, it seems like. We're missing the other side,
- 9:29which is the private test sets and.
- 9:32I guess right now what's happening is each person who is
- 9:36dealing with these models comes up with their own.
- 9:39Private evaluation metrics to go against and it might just be
- 9:43something as simple as does this work for my use case?
- 9:47How much do I have to prompt it? Etcetera, etcetera.
- 9:49And you were saying how you're working with a bunch of open
- 9:52source LMS right now and it's really unclear.
- 9:55I know that every time I mess around with open source LMS,
- 9:59what the hardest thing to do is is recognise.
- 10:03OK, I have a use case, let's say summarization like you were
- 10:08saying, which is a bit harder to.
- 10:10Evaluate And now I just want to know which one of the open
- 10:15source models out there is the best that summarising long text.
- 10:19You can't really get that information.
- 10:21It's super obscured. I wish there was a way to just
- 10:24say, alright cool, if you're trying to do this use case, use
- 10:28this model. At this given time, it's the
- 10:30best open source model that you've got, right?
- 10:33I mean something like that would be really useful.
- 10:37There is an initiative called HTML from Stanford and they're
- 10:41doing a good work and I hope they continue it and improve the
- 10:44evaluation as in a better way. But evaluating all these albums
- 10:49itself is a task because it takes a lot of commute.
- 10:52So you have to run these albums on all these different datasets
- 10:57and then take the output and have a valuation metrics to
- 11:01quantify the results. All that stuff so.
- 11:03It's it's again computing density even in a way.
- 11:06You know you have to have some kind of computer for sponsorship
- 11:09to evaluate, such as a. Yeah, and it's funny because it
- 11:13feels like it's almost like this paradox that as soon as an
- 11:16evaluation test set becomes public, then it's no longer
- 11:21useful. And.
- 11:24So for me it's funny because the I've heard a lot of people say
- 11:29that. Benchmarks are bullshit.
- 11:32And that basically. When we talk about benchmarks,
- 11:37especially with LMS, it shouldn't be used to gauge.
- 11:42How well this model actually performs in the wild and I know
- 11:47that you've undoubtedly had this and I'm sure a lot of people
- 11:50that are listening have had this happen to them too where you
- 11:54hear on Twitter, on LinkedIn, how there's this new model that
- 11:58dropped and it's been so good at you know does it's
- 12:02state-of-the-art soda on all these different metrics etcetera
- 12:05etcetera. And then I go and ask it.
- 12:07My favourite question to ask. It's like is the earth flat and?
- 12:12It says yes, of course the Earth is flat because we have pictures
- 12:16of it and you're like, whoa, this was trained on one too many
- 12:18subreddit threads, even if we say the current benchmarks are
- 12:24very limited as we discuss. So even if we improve that slide
- 12:28of benchmarks, OK, let's say we have all these close set,
- 12:32private set, test set and everything.
- 12:34If you want to really use an LLM extensive info extensively for a
- 12:40particular application, for a custom application, you better
- 12:44evaluate it yourself in your custom data distribution,
- 12:47because it's not really practical to evaluate LMS on all
- 12:52these stuff individually and present it somewhere.
- 12:57So benchmarks even if if it's done correctly, it will give you
- 13:02an A ballpark idea of you know what is the performance of this
- 13:07LLM or particular task or particular data.
- 13:10All that's it. So it's a ballpark performance
- 13:13generally that's I think that's the purpose of benchmarks or
- 13:17even not really say that OK, it doesn't really guarantee a
- 13:20performance on any particular application or any particular
- 13:24data or anything. So if one is going to use any
- 13:29element whether close or open source and building an
- 13:32application on top of it, I think the person should figure
- 13:36out some evaluation metrics and have it evaluated whenever they
- 13:42make changes to the pipeline node itself.
- 13:44The LLM pipeline can have multiple other components that
- 13:48affect their LLM output other than their lab itself.
- 13:51So whenever they change the part of pipelines, they should have a
- 13:57valuation metrics figured out so that internally or they could
- 14:01subscribe to any of the SAS solutions that are exposed and
- 14:05evaluating and items and evaluate the LMS whenever they
- 14:10make the change. So that they know that this is
- 14:12something they can push to production without worrying
- 14:15about it breaking or annoying customers.
- 14:19And for you, what are some of the key cause you you map out in
- 14:24your blog post a lot of different ways to evaluate
- 14:28looms. How are you?
- 14:31Recommending that we. Evaluate these like with which
- 14:36standards and which ways of evaluating, because I imagine
- 14:40it's not all of them if we could, and you do make this very
- 14:44clear, A little bit of a tangent, but in the.
- 14:47Blog posts. You also say how expensive and
- 14:50time consuming it is to actually go through this process of
- 14:53evaluating and So what would you recommend if we're just trying
- 14:58to figure out what's the best way for us to evaluate it
- 15:00against our own data and our own use cases, so.
- 15:04You get it broke. The problem can be broken down
- 15:06into different steps. OK, the first thing you need to
- 15:09figure out is in your application what will be a
- 15:12reasonable test set that. You have to evaluate.
- 15:17So the test set should contain the expected distribution of
- 15:21data which which you are exposing the Lambda for XAML.
- 15:25If you are building a retrieve augmented system and the people
- 15:29are always asking the system about summaries and stuff, you
- 15:33should have some kind of prompts and user prompts that have these
- 15:37kinds of distribution. OK, what is summary of this
- 15:40document? What is number of that, all that
- 15:41stuff. And then the next step should be
- 15:44to figure out the dimensions, the aspects that people really
- 15:48care about or even you really care about.
- 15:51So when you get a summary, what are the aspects of summary that
- 15:55you really care about? OK, so let's see if in my case
- 16:00it could be fluency, coherency and abstract.
- 16:04How much? How much level of information
- 16:06from the actual content, Desktop abstract.
- 16:09Capture all these steps. So let's say I have identified.
- 16:13Now I have a test set and the second set I've identified some
- 16:16aspects, some dimensions that I really care about or my users
- 16:20and really care about. And then?
- 16:23I have to figure out a method to quantify these aspects.
- 16:28So this can be done this OK Quantifying the aspects can be
- 16:34either done using some string match or you can use an LLM to
- 16:38evaluate the element itself. So.
- 16:41The I think the feature evaluation, evaluation, even
- 16:46multi modal whatever multi modal audio or levels itself is.
- 16:53So I think in future a will evaluate A systems but.
- 16:58These evaluations will be formulated in such a way that it
- 17:03cancels or it is not really affected by the biases that are
- 17:08inherent to a systems, I think. I think in LM's case you could
- 17:13either use LM itself to quantify these aspects.
- 17:16How fluent is the output and how guarantees output?
- 17:23Etcetera, etcetera. So now you have to have a figure
- 17:26out a method to use LLM to quantify these output in a way
- 17:31that it is not really affected by the biases of alums.
- 17:35Some of the biases of alms like Elms usually only give
- 17:38individual scores, like some of the things which I pointed out
- 17:41in my blog. Yeah, you also mentioned, right?
- 17:44There's one piece where you said LLM's prefer the output of other
- 17:48LLM's rather than human generated content.
- 17:51That's a funny thing, right? So so if you if you want to go
- 17:55so this this was I think probably one of the experiments
- 17:59so there was like some of the best golden annotated human
- 18:04answers and then there was answer from some LMAO CBD
- 18:08something CBD 3.5 or something and when evaluated LLM mostly
- 18:14prefers answer from LLM itself because there is a bias to its
- 18:17still. So it's basically.
- 18:19Just subscribing to that style of answering, it's not really
- 18:23looking at any particular, so if you give it to answers and ask
- 18:26another which is the best, you don't really.
- 18:28You're not really asking them to pinpoint to any aspect or
- 18:32something, you're just asking which is the best and mostly
- 18:35prefers style of a particular style of answering like humans
- 18:40do. OK, we also do have some kind of
- 18:42bias like that. So when it was also proved in
- 18:45some of the experiments I think so there are many leaderboards
- 18:49which allow humans to write answers.
- 18:52So basically they they basically they show 2 answers from two
- 18:55different albums and ask which answer was the best.
- 18:59Well, what happens in that scenario is that the people who
- 19:03are judging the answers usually only care about the state of
- 19:06answering which. Which is not appropriate, right?
- 19:10We also want to take into account complex things like what
- 19:14was of how much factuality and other stuff.
- 19:17People usually only jump to conclusion by just looking at
- 19:21the state. I think another also suffers the
- 19:24same kind of bias, but in that case of alums, it just prefers
- 19:29it's on sale over the tail of even human or any other LR.
- 19:34Yeah, it's almost looking at the answers and judging it not only
- 19:39on one metric, and judging it on many different rubrics and
- 19:44saying, OK, well. Writing itself, I like this one
- 19:48better, but the actual facts or the way that it's presented, the
- 19:52arguments, et cetera, et cetera, the flow you could.
- 19:57See how it could get really out of hand quickly on how many
- 20:01different ways you can judge the output.
- 20:04And so again, going back to evaluating it, it's like what
- 20:08are you evaluating it for and what is the most important for
- 20:12you? And I think you brought up a
- 20:13great point, it's, it all comes down to your use case and what
- 20:17you're going to be seeing in the wild.
- 20:20And so if you're mainly seeing summarization and you're mainly
- 20:23seeing that your end users like to get their summaries.
- 20:28In quick bullet points type answers, then you should
- 20:33probably bias for those type of test set evaluation metrics.
- 20:38Right. So there is another thing that I
- 20:42wanted to mention, which is around.
- 20:45Once you see that you have proper evaluation metrics and
- 20:51the model is failing for some reason or the output isn't that
- 20:54good, how do you debug that? What do you do?
- 20:58Do you make a better RAG? Do you fine tune the prompts?
- 21:02Do you fine tune the model? Do you get a different base
- 21:05model? It feels like there's so many X
- 21:08factors, and so where do you even start on that?
- 21:13I think it. Comes down to first isolating
- 21:15the error itself and you know, figuring out OK which part and
- 21:19why it happens and then scrolling for it accordingly.
- 21:24So there could be many reasons if.
- 21:27From the alarm viewpoint, there could be many reasons.
- 21:30From just another viewpoint, there could be many reasons why
- 21:32it fails. For example, if you see Lama 2.
- 21:36People are trying to, I think, fine tune Lava 24 core
- 21:41applications, but. It is.
- 21:44Not going to get much much better in code applications
- 21:47because Lamma 2 was by default was not trained in much code
- 21:55tokens as required. So basically the person, the age
- 21:58of code tokens it has seen in the pre training itself.
- 22:02Is. Limiting its knowledge and code
- 22:04then you fine tune. Doing fine tuning on top of it
- 22:08only will you know. Mean improve the.
- 22:11It will improve the results, but it is also prone to overfitting.
- 22:14So I would isolate the error like this and then then from my
- 22:19conclusions and then figure out the next base.
- 22:23So it's almost like you have to know a bit of, and this like
- 22:27Lama 2 not being good at coding is news to me.
- 22:32And I feel like I'm very deep in the subject.
- 22:34But it's almost like you have to constantly be checking.
- 22:39And I guess it's probably because I didn't read through
- 22:41the whole Lama 2 paper and they may have said that.
- 22:44And so if you're not up to date on each one of these models and
- 22:49what the training data was that went into it, it can potentially
- 22:54drive you crazy because you're like, OK, let's just grab Loma
- 22:57two, everybody saying it's the best out there, and let's see if
- 23:00we can fine tune it on our coding use case.
- 23:03And then little do you know that it's never going to be that
- 23:06good. Right, right.
- 23:08So I think. Yeah, I think The thing is that
- 23:11this is where you. Know.
- 23:14And a guy who has good exposure to these things Northeast.
- 23:20So so even if you know even if a person who is just trying out
- 23:26these models really won't notice these stuff because OK, for that
- 23:30person it's like just figure and trying out stuff.
- 23:33OK, everyone else. Every model, OK, which is the
- 23:35best model. Everyone says that this is the
- 23:37best so this should be the best. But you'll have to dig through
- 23:41stuff, especially when it comes to upon.
- 23:44Jose Luis and using it in production or you know using it
- 23:48in use cases, you know to really dig through it understand OK,
- 23:51what are the methods that they used, how different is this from
- 23:57any other olms and so on and so forth and then choose then make
- 24:02a wise decision on which L to fine tune or use for your use
- 24:07case in future. It's going to be crazy because
- 24:10they are going to be, there are going to be many base, many
- 24:14good. The lungs or you know,
- 24:15foundation, Any models and then to just choose models from it is
- 24:20itself going to be a hard task. We haven't even touched on the
- 24:26idea of. The prompt injection or the
- 24:30security of the models, which feels like all of the evaluation
- 24:34metrics that I've seen, they don't really talk about that.
- 24:37Like this model is able to get hacked 9 out of 10 times.
- 24:41Nobody's going to say that we were the most secure model or
- 24:44the least secure model. And things like, I know there is
- 24:48a whole Reddit thread that came up around Dan or do anything now
- 24:53and how there's that constant push and pull between making the
- 24:59model less useful because it won't tell you things since
- 25:03thinks it is bad and it shouldn't say that.
- 25:08And then on the other side, making the model secure and not
- 25:12telling you things because it actually is bad, right.
- 25:14So I know there was a lot of tweets that were going around
- 25:17and memes when Lama Two came out and it said how do I kill a
- 25:20Kubernetes cluster or something like that, How do I, how do I
- 25:24kill this? And Lama Two is saying things
- 25:27like, no, I'm a language model. I'm not going to tell you how to
- 25:30kill anything. And so.
- 25:33So it's funny, you know? It's the.
- 25:35I I. Really allow the work the Lama
- 25:41to team did, apart from the kind of Aleman they did.
- 25:44I think they spent a lot of effort in Element.
- 25:47But Element itself is really, really hard and to get a good
- 25:52reward, to produce a good reward model to get the model aligned,
- 25:57that's a very, very hard task. I've worked in IT for open
- 26:00assistant team and then there is.
- 26:04It's like it's like a very. It's like a.
- 26:06Data problem. There is very few data which is
- 26:08available in open source that we can use to align language
- 26:12models. So it needs a particular type of
- 26:15feedback data. I think Opera has those feedback
- 26:18data because people has these user interactions and people's
- 26:23feedback from a long time and then they can use these people's
- 26:28feedback itself to. Language models So what I might
- 26:33do was fairly over aligned and and I'm a 2 chat to specific
- 26:39Blood Glamour 2 doesn't have that problem fortunately so.
- 26:44So I mean it's it's it's a very tricky problem and the current
- 26:47LMD is looking at a way that OK, it is it is currently aligned to
- 26:53I think subscribe to maybe a particular culture or something
- 26:56say for XML element is element is subjective right.
- 27:00So something which is offensive in where you belong to might not
- 27:05be offensive in place I belong, right?
- 27:08So there are these. Cultural differences and all
- 27:11that stuff which is not currently taken into account in
- 27:13language model alignment. It is currently just aligned to
- 27:16a mainstream culture or whatever, so I think in future
- 27:20I'll even would be something which can be even personalised.
- 27:26To. That also could happen.
- 27:29Ohh yeah. So I'm thinking potentially you
- 27:33would get different alignment depending on where the companies
- 27:40are based or the end user is based, depending on the cultures
- 27:45that person is in. And so you're going to have all
- 27:47of these. Maybe it's the same base model,
- 27:50but it has different alignment because of where it's being
- 27:54used, right? Exactly.
- 27:55That that's that's the idea. So I think I mean in future will
- 28:00be will be like that it should be something which.
- 28:04It should be aligned. To where that it's serves the
- 28:07population. In in the best possible interest
- 28:11of community and yeah. And and it should be it's some,
- 28:17it's Richard normally something which is just a mainstream
- 28:19culture. So it is just that a model is
- 28:22only subscribing to the mainstream culture.
- 28:24But the moral can be, it can be, it can be aligned easily.
- 28:28It can be aligned to different cultures, but just that.
- 28:32If if you have N different aligned models to different
- 28:36cultures, it means that you have to deploy in different models,
- 28:39so it takes some kind of overhead in production.
- 28:43But if it's worth in future, I guess it will happen.
- 28:47Yeah, it's those trade-offs. And Speaking of trade-offs and
- 28:52putting things into production, coming back to the evaluation
- 28:55sets, you mention how costly it can be and how curating with
- 29:03ground truth is expensive. It's time consuming and to
- 29:08maintain that golden annotated test set against data drift is a
- 29:14challenging task. Have you seen it done well and
- 29:19what does that entail? Like what should we expect to
- 29:23have to do if we wanted to do that?
- 29:25Because something that I find fascinating is people thinking
- 29:30that they can bring open source models in house and they don't
- 29:34realise all this work that's going on with, like you said,
- 29:38with Open AI or or with Claude behind the scenes.
- 29:42Not only to host the model and to get the latency low, but also
- 29:46to make sure that it's continuously being evaluated and
- 29:51having these golden test sets come up.
- 29:54So a. Tester Gordon Dessert should
- 29:59have some kind of annotated best answer to it.
- 30:04And that is mostly the hardest part of my Indian because
- 30:08whenever you update your test set, you'll have to have a set
- 30:12of people who can annotate the best answer to the given
- 30:16question or best outcome to the given problem, let's say.
- 30:19So how to overcome this situation is something which we
- 30:23have been exploring. So there are dimensions, or
- 30:27there are methods by which you could.
- 30:32Effectively evaluate albums without a golden annotated
- 30:36answer using an ALM assisted evaluation and avoiding avoiding
- 30:41such biases from alms and identifying the rate dimensions
- 30:46to evaluate and quantify. Can.
- 30:49Be a. Solution to it and we have been
- 30:51using this pretty effectively in retrieval, retrieval, augmented
- 30:55generation systems. Yeah.
- 30:57Hey everyone. My name is Aparna, founder of
- 30:59Verizon, and the best way to stay up to date with.
- 31:02ML OPS. Is by subscribing to this.
- 31:03Podcast. So basically in retrieve log
- 31:08when the generation systems the. Some of the aspects that we
- 31:13really care about is how grounded is the answer to the
- 31:16given given context. So if you give a context, even
- 31:20if the moral laws much more than the given context, the model
- 31:23should only limit itself to the given context.
- 31:26So how can we quantify it? How can we quantify
- 31:29hallucination? Do we need an annotated ground
- 31:32truth to quantify hallucination, or can we do it with using
- 31:37another alum and forming A paradigm so that we can quantify
- 31:41it? Effectively so I think in future
- 31:45again Ella will evaluate a systems and the power which I
- 31:51see which is very difficult to evaluate without an annotated
- 31:55down truth is factually correct quality of the answer.
- 32:01Factuality is like it is a widely debated topic and we can
- 32:05even relate to that with fake news detection.
- 32:07It's a very it's. An age-old.
- 32:09Problem. And it's very, very hard.
- 32:12This sort of problem and nobody has solved it yet.
- 32:14So The thing is that you know what is factual and what is not
- 32:19factual and what is acceptable, what is not acceptable.
- 32:22All these things are really complicated and that except.
- 32:27That the. Emotion, which is really
- 32:28complicated and which is. Which is also an age-old
- 32:34problem. I think there are many
- 32:35differences which we can evaluate without having much
- 32:38human effort by using alarms itself to evaluate Elms right
- 32:43adopted. So let's talk a minute about
- 32:46open assist and what you've been doing over there and how you've
- 32:49been overcoming some of these challenges with evaluation.
- 32:52Has it been through the, like what I've heard it called?
- 32:58So RLF has gotten very popular in the last six months, but I
- 33:03also have heard it called like RL AIF.
- 33:07So it's if reinforcement, reinforcement learning through
- 33:11AI feedback instead of human feedback.
- 33:14Have you been messing around with any of that too?
- 33:16And this is really what we've been talking about, right?
- 33:18Like getting the evaluation through the models, other AI
- 33:22models and they they will tell you if it's good or bad alright.
- 33:27So it's the basic idea of again aligning A models with A itself.
- 33:33I believe strongly that this is going to be the future and if
- 33:36you see if you see even for fine tuning test set curation by
- 33:42human adaptation is very expensive.
- 33:45So before we used to have say for example if you want to build
- 33:48an any error name the needy recognition system, you
- 33:52basically will have OK, thousand newspaper thousand documents and
- 33:56then you have to upload these thousand documents into.
- 33:59Zone turf, where technical Turk and then 100 people somewhere in
- 34:04the world will annotate each entities in each document for
- 34:07you. Now you don't really have to do
- 34:10it. You can actually do the same
- 34:12thing with maybe like 1 by 100th of the coast and using LMS
- 34:19itself using LMS and even much much faster.
- 34:23So I think in future a will generate.
- 34:28The data that it needs to be trained, maybe with human
- 34:32supervision, some some weak supervision and a will evaluate
- 34:37and are laid a systems itself. Again, all these should happen
- 34:40with at least some weeks, even supervision.
- 34:43But I think the human in the loop, the number of humans in
- 34:46the loop will be reduced to very very small percentage.
- 34:51And as far as open assist skills, what have you been up to
- 34:54on there so in open? Assistant I have been doing the
- 34:59radio stuff we used. I used to work in reward
- 35:01modelling and layman team where we work on aligning our trade
- 35:07fine-tuned large alums and release it now I have been
- 35:13involved in. Have been very interested in
- 35:17data set you know. So for fine tuning I think after
- 35:21playing with fire during all these past six months, what I've
- 35:23really understood is that data is the king in fine tuning.
- 35:26So if you know how to prepare the right data for fine tuning
- 35:30with the right model, you'll have the you'll get the best
- 35:34outcome just throwing some random data to model and fine
- 35:38tuning. It's not really difficult to be
- 35:40honest to fine tuning and model, maybe because I have been doing
- 35:44it for a while, but. It's not really difficult to
- 35:47throw a random some random data and fine tune a model.
- 35:50Sorry, I was. I was going to say at the end of
- 35:53the day, what it seems like is is not useful if you just throw
- 35:56some random data at it, yes. Yes.
- 35:59So basically if you want to do that, yeah, sure, you're free to
- 36:02do that. And that's not really, it's not
- 36:03really difficult. What is difficult is to produce
- 36:06a high quality model and how to produce a high quality model.
- 36:09It's basically garbage in, garbage out.
- 36:12So if you have high quality data.
- 36:14And if you have figured out methods.
- 36:17By which you? Can produce high quality data to
- 36:21fine tune algorithms. That's where the value is and
- 36:24that's where I have been mostly working around these days.
- 36:27Because we have with the fine tuning setup for even $70
- 36:32billion to 1:00 and we are currently doing fine tuning for
- 36:3570 model and mostly in there whenever I find some spare time
- 36:42I spend on data preparation and filtering and all those
- 36:46techniques. So that's something.
- 36:49Which I have been a really contributing to Open Assistant
- 36:51and we are. Planning to.
- 36:54Release a 7 billion Lama 2 model this week.
- 36:59Nice. So by the time this is out then
- 37:01everyone will have probably heard about it and we'll leave a
- 37:05link in the description and now I want to contrast that.
- 37:08So basically you've been doing fine tuning with open assist,
- 37:11but then you also have ragas which are a wave to evaluate
- 37:17rags or the retrieval augmented generation which I think most
- 37:22people are playing with much more than fine tuning.
- 37:26Now in your mind since you lay in both realms, the fine tuning
- 37:32in the rags realm. And just a quick side note, I
- 37:36love the name ragas because is there in India.
- 37:41There's ragas right? The singing are ragas, different
- 37:44nails. Alright.
- 37:46So rathers, actually we named it like RG, Retrieval Manager,
- 37:52Rational Assessment and it came out to be Raga Summit.
- 37:54It's a cool name and it's easy to pronounce.
- 37:57So we thought, OK, why not? Yeah, yeah.
- 38:01But there is in singing, right? Is there not ragas?
- 38:05Yes, then singing that's. Awesome.
- 38:07All right, so back on track? No.
- 38:10When it comes to fine tuning versus rugs, you've been playing
- 38:16in both fields. I've gotten the impression that
- 38:21you don't want to fine tune unless you absolutely have to.
- 38:25You want to try and see how far the Rogs can get you.
- 38:29Right, so this is again some topic which I have been meaning
- 38:33to write on SO. So I I.
- 38:36Where the way I look at it as as I agree to your point like you
- 38:40should not fine tune and until and unless it is absolutely
- 38:43necessary but. Adding fine.
- 38:46Tuning and retrieval. Augmented generation serves two
- 38:49different purposes, so. The thing is.
- 38:52That fine tuning is not really meant to inject any factual
- 38:58information to the model. So if you have a model, let's
- 39:02say even GBD 3. And let's say whatever, like
- 39:06Lama two or something, it is strained on all these tokens and
- 39:09all stuff, but you are going to use Lamma 2 on a private data
- 39:13set that that resides on your enterprise.
- 39:17Fine tuning doesn't really make sense in that situation because
- 39:21by fine tuning you cannot really inject.
- 39:24A new factual? Information to the model.
- 39:27If you do that, that's called overfitting.
- 39:29Why? Why do we fine tune?
- 39:31Fine tuning actually enable instruction.
- 39:34Fine tuning actually enables model to think in a certain way,
- 39:37let's put it that way, think in certain way given certain
- 39:41instructions. So even though the model has
- 39:43internal knowledge about things, it really.
- 39:47You don't really understand the way to think or you know,
- 39:50understand the instructions correctly and output the answer
- 39:54correctly. So fine tuning will enable you
- 39:57to do it. For example, let's say if you
- 39:59have a moral which you have pre trained on only.
- 40:04Bio. Data which is in the lower
- 40:07domain. OK, let's say we have this model
- 40:10and this model has only seen the data which is which is a load of
- 40:15enduring pre training. Most of his most of it it's
- 40:18storage is now confined to the law domain.
- 40:21You cannot really take that model and fine tune on something
- 40:25like something like life sciences and expect it to
- 40:29perform good. Why?
- 40:31Because mine does not really help model.
- 40:35Do you know up soak that kind of information?
- 40:37Factual information. It helps model to thing in
- 40:39certain way. For example, let's say you want
- 40:42model to follow and call a particular function when someone
- 40:47says something. Let's say I have a function or
- 40:50play function is a good example of actually.
- 40:52So they have this model, they have this base model and
- 40:55whenever the user says something which could trigger a function,
- 40:59they wanted the model to do it. They wanted to model the thing
- 41:03in certain way. For example.
- 41:04OK, what? Is the weather in Boston and I
- 41:06have a function which which I also give a function which.
- 41:11Can get the weather given the location.
- 41:14So in this case the model gets two things, basically a function
- 41:19which has an argument called place and I'm also concerned
- 41:25with the model that asking what is the weather in Boston.
- 41:27So in that case I want to model to think in a way and output
- 41:30function of Boston. So that's a good example of fine
- 41:34tuning. In that case, what will add the
- 41:35predefined knowledge of what is a function and how does the
- 41:38function look and what is the code and all that stuff but?
- 41:41Model just we just nudge the model in a way that it it was
- 41:46able to think and follow the instruction properly.
- 41:48And this fine tuning can improve the benchmarks and performance
- 41:52of the model because as we have seen, the model itself followed
- 41:55the instructions in a much better way.
- 41:56So when it comes to RAG, you cannot really do this.
- 42:00OK, you cannot really inject any information to the model using
- 42:03fine tuning you have to do even. You have the capability to fine
- 42:08tune models. The places where you have to use
- 42:11retrieve long window generation, you'll have to still continue
- 42:13doing that, and that is something which works safely and
- 42:17effectively. So these are independent things
- 42:20and I think there is. Something I've been meaning to
- 42:24write on it and there is a popular confusion.
- 42:27OK, that fine tuning is an alternative to RG alternative to
- 42:32fine tuning, but I don't look at it that way and I don't think
- 42:35it's that way. They're.
- 42:37Complementary in a way is what I'm understanding you saying.
- 42:40And yes, just because you have one doesn't mean you are going
- 42:43to not have the other. You still can fine tune and use
- 42:46rags 100%. Yes, you gotta do it in use.
- 42:50Tracks. I guess what I'm wondering is
- 42:53what have you seen be a valuable use case besides this Open AI
- 42:59functions use case that you're talking about for an open source
- 43:03model and a company that wants to fine tune an open source
- 43:07model. Why would they do that?
- 43:08What are some use cases there? Like what's going to make me
- 43:11think, OK now I need to just go and find tune this, OK?
- 43:17So hmm, interesting. Question.
- 43:20So let's say you have to yeah, you.
- 43:24Are basically running a company. I'm just saying my own example.
- 43:27So in my case I want to build a model that can evaluate LMS
- 43:32itself. So in that case I want the model
- 43:35to output things like OK, why, if this answer can be actually
- 43:40attributed to the given context and why that happened.
- 43:43All that stuff, so I want more interesting in a particular way,
- 43:46so. The models the output should
- 43:48look like OK this is the sentence one.
- 43:51This is the first statement of the generated answer and this
- 43:54statement can be attributed to this this part of the context.
- 44:00Then it goes to goes and so basically the model is learning
- 44:04to think and answer in a particular way.
- 44:06So whenever you have those kind of application where OK, you
- 44:11have a base or you even have which is already fine-tuned but
- 44:15you want it to. And the capability of you want
- 44:19to improve the capability in a certain aspect or certain
- 44:22aspects, you could prepare the data in that particular way and
- 44:26use fine tuning to improve the model performance in that
- 44:30certain aspects. But that one really just just to
- 44:35just to reinforce this at that part should not really be
- 44:39injecting new factual information to the model.
- 44:42So if let's say if I have a model which does not really know
- 44:45who is. Popular days, there is no point.
- 44:49In asking or fine tuning the model with all the things that
- 44:54Socrates has said or whatever, because moral really doesn't
- 44:56really understand who is it is in the 1st place because it has
- 45:00never seen someone, some it has never really understood that
- 45:03this guy assisted or whatever, all that stuff that happens in
- 45:06the retraining stage. So that is the difference here
- 45:10in that case. It's funny because I think a lot
- 45:13of people, including myself. With the image generation models
- 45:18and like the diffusion models, you think about fine tuning in a
- 45:23different way which. I always thought about fine
- 45:26tuning with like diffusion models as OK, I'm going to add
- 45:29me Dimitrios to this model now so that I can call and say
- 45:34Demetrio's meditating on a rock on the sun and then I would get
- 45:38a picture of myself and it was image generated in the LMS. It's
- 45:43a much different story, though, because it's you telling it, no
- 45:47matter how many. Dimitrios notes you train you
- 45:51fine TuneIn LM on it's not really going to kick U that OK,
- 45:56Demetrius talks like this. For that use case, it's better
- 46:00to use some kind of a rag and just say here some few shot
- 46:05learning and say here use it speak like Dimitrios Demetrio
- 46:10speaks like this. Here's a few context items and
- 46:13then you get the output in that way.
- 46:16What you're talking about with the fine tuning is that.
- 46:19You want to. Give it almost like a new way of
- 46:26looking at. The world or a new tool in its
- 46:31tool belt to be able to ask it. Hey can you do XYZ which it
- 46:38before it couldn't have done and now you have this new new way
- 46:43that it can say Alright yeah now I understand what you mean when
- 46:47you say XYZ which is. Like almost like a a different
- 46:52job or a different. I am trying not to use the word
- 46:56function because it goes back to the open AI one, but it feels
- 46:58like it's a different way of executing.
- 47:03It might getting that right and what?
- 47:05Where am I wrong here? Alright, alright, I think.
- 47:08What? Your what?
- 47:09Your perception is right there. Maybe.
- 47:12I'll add just more one example. Say that you have moral that
- 47:16have already understood what is understood coding in Python in
- 47:21pre training stage. So basically it knows all these
- 47:24it has in its internal parameters.
- 47:26All these correlation, all that stuff we we don't really know
- 47:29what the model knows in its in the parameters.
- 47:32We don't really know what the model.
- 47:34That's great. So what?
- 47:35What? Let's let's go with the best
- 47:37assumption that model has learned many things like, OK,
- 47:39what is the relationship between all these stuff, all these
- 47:42words, all that stuff. But that doesn't make the model
- 47:46follow instructions in a way. So let's say I'm coming in the
- 47:51next day and saying OK. I'm just really signing Python
- 47:56And I want to use. Semicolon.
- 48:00At the end of every statement. In and write me a Python
- 48:04programme to do XY to do this with all these steps.
- 48:09So even though the model has an understanding about Python And
- 48:13all that stuff, what is not able to understand how to think in a
- 48:17way how to think correctly and how to think correctly so that
- 48:22it serves your instruction the best way possible.
- 48:26So that capability is what fine tuning brings and all that
- 48:29internal knowledge about coding and stuff.
- 48:31All that internal knowledge about Python.
- 48:33Variables, emissions and all that stuff that's learned during
- 48:36pre training stage. So initially we also nobody
- 48:39really knew that OK fine during is this is what fine dust.
- 48:45This is what I have seen happening and this is our best
- 48:49possible research that this is the best possible thing that
- 48:53research has given us right now. And This is why we use fine
- 48:58tuning in why we should use when tuning with our current voltage.
- 49:04Awesome, dude. Well, our time is coming to an
- 49:07end. For anyone that is looking to
- 49:10evaluate their rags more deeply, I would highly encourage you to
- 49:16check out Ragas. As we mentioned in the episode,
- 49:18it is awesome. It's some really cool work that
- 49:22you're doing with that, and for anyone that wants to connect
- 49:26with you, where's the best place to find you?
- 49:29I am actually want to tell so you could correct me on Twitter
- 49:34and and. With Radas, our aim is to
- 49:38improve the reliability of LM applications, either with
- 49:42evaluating, testing or railing all that.
- 49:45So if you have any, if any of you are you hearing me has any
- 49:50application, let me know and I'm always open to chat.
- 49:56Excellent. Well, thank you.
- 49:58So this has been wonderful, man. You taught me so much.
- 50:02I appreciate it. Well and it there.
- 50:09Hey, I'm. Vishnu, I'm a data scientist at
- 50:11first hand and I definitely think that you should subscribe
- 50:15to the ML OPS Coffee Sessions podcast.
- 50:18It's the best podcast out there to stay on top of what ML OPS
- 50:21actually is to talk to the true thought leaders in the space.
- 50:24And oh by the way, Demetrius is absolutely hilarious.
- 50:28What a weird guy. You should definitely subscribe
- 50:30to the podcast.