Skip to main content

Reinforcement Fine-Tuning and the Future of Specialized AI Models

Summary

  • Reinforcement fine-tuning: Predibase's RFT platform enables custom AI models without massive labeled datasets—just human feedback to improve continuously.
  • Specialized models: Organizations build domain-specific AI models faster, starting simple and adapting through iterative feedback rather than expensive data labeling.
  • Democratized AI: Reinforcement fine-tuning makes advanced AI accessible to every business, removing traditional barriers of scale and labeled data requirements.

Reinforcement Fine-Tuning and the Future of Specialized AI Models

Watch: Reinforcement Fine-Tuning and the Future of Specialized AI Models
What if building a custom AI model for your business was as simple as giving feedback—no massive labeled datasets required? In this episode, we sit down with Travis Addair, CTO and Co-founder of Predibase, creators of the first reinforcement fine-tuning platform, to explore the future of specialized AI.
Discover how reinforcement fine-tuning is revolutionizing model customization, enabling you to start fast, adapt to your unique data, and keep improving through human feedback. Learn how this breakthrough is making advanced AI accessible to everyone.
Highlights:

  • How reinforcement fine-tuning simplifies building custom models
  • The impact of human feedback on continuous model improvement
  • Making advanced AI accessible with minimal labeled data

Chapters

FAQs

What is reinforcement fine-tuning (RFT) and how does it work?

RFT trains AI models using human feedback as a reward signal rather than requiring millions of labeled examples. This enables faster customization and continuous improvement as the model learns from real-world interactions.

Why is RFT better than traditional supervised fine-tuning?

Traditional fine-tuning requires expensive, large-scale labeled datasets. RFT starts with a base model and improves it through human preferences, making it faster, cheaper, and easier to adapt to domain-specific tasks.

What approach enables efficient fine-tuning of LLMs on private enterprise data?

Reinforcement fine-tuning provides a practical approach for adapting open-source language models to enterprise data without requiring millions of labeled examples. Unlike traditional supervised fine-tuning that demands expensive curated datasets, RFT uses human feedback as a reward signal to guide model behavior toward domain-specific tasks. This method is faster, more cost-effective, and enables continuous improvement as the model learns from real-world interactions with your proprietary data.

How does reinforcement fine-tuning improve custom AI agents and their performance?

Reinforcement fine-tuning enables the creation of specialized agents by allowing developers to optimize models for specific workflows using domain feedback rather than predefined rules. Platforms like Predibase combine RFT with serving infrastructure to deploy these customized agents at scale with high throughput and low latency. This approach democratizes AI by making it practical for organizations to build intelligent agents tailored to their unique business requirements and constraints.

Can reinforcement fine-tuning work with open-source models for enterprise applications?

Yes, reinforcement fine-tuning is specifically designed to adapt open-source models like Llama for enterprise use cases by leveraging domain expertise through human feedback. This approach avoids vendor lock-in and allows organizations to customize model behavior to align with company policies, brand voice, and specific business logic. The flexibility of RFT with open models makes it accessible and cost-effective while maintaining the ability to operate models independently of proprietary providers.

Full transcript

0:00 Intro

To explore various topics in the data and AI community. And whether we're talking about data engineering or data science, we interview subject matter experts to dive deeper into these topics. And while we're enjoying our morning brew. I'm a principal developer advocate uh here at data bicks and one half of data brew. >> And hello I'm, senior director of our machine learning practice and the other half of data brew. And today we are thrilled to invite, co-founder and CTO at Predase to Data Brew.
Uh for those of you who aren't aware of Predase, it is a platform to help you train the best models, serve them at maximum speed, think about SLMs with the highest quality and fastest throughput. And Travis is also creator of Lorax, an open- source platform for serving multilura attention heads, as well as Horovote, which I have used many years ago. So, thank you for your contribution to the open source community as well. >> Yeah, absolutely.
Thank you. Um, it's great to be here. And, um, yeah, I don't have my coffee, but I do have my tea. So, >> I'm joining you with the tea as well. >> I feel outnumbered right now. No, I'm just joking. So to kick things off, would love to hear from you. There's continually new models, new techniques being released. What's the current lay of the land? >> Yeah. Um, well, definitely think it's uh a really exciting time to be in this space, whether you're like working with the proprietary models or with the open source models.
I mean with our company Predabase, we made the decision very early on to bet on open-source and on open source being kind of the future. And I think that what we're seeing is that um you know the original kind of bet that was being made by a lot of people is that there might be this convergence where there's like this one model to rule them all like everyone's using a single provider. And I think the good news for companies like us that's definitely not the direction things seem to be going.
We're definitely seeing a much bigger diffusion of different models that are better suited for different use cases and the landscape is constantly shifting in terms of you know which companies are putting out the best models and like you know I think it's actually great for people who um are wanting to build applications on top of these systems and things are constantly improving and getting better um and there's no clear like you know uh horse that you should be betting on right so you know I think just earlier this year we had deepse which was like this amazing amazing model release.
Um, very recently we had 3. Um, we also had Llama 4, which, you know, maybe didn't quite meet expectations on some levels, but like I think that's kind of the nature of the game is that, um, there's constantly new things coming out for people to try and some things will resonate and some things won't and some things will work well for some use cases and better for other use cases. And so, I think this diversity is actually really good for the industry and for the community.
And I think that's part of what we want to try to help people navigate with our business is, you know, which models work best for you and for your use cases and kind of help get them into production. >> Awesome. So one of the things based on like what you're seeing and especially with your background right uh of building horror and talking about the various techniques and you had mentioned like that deepse R1 paper like there seems to be a lot of techniques for fine-tuning like uh including supervised fine-tuning reinforcement fine-tuning um like like the DCR1 paper.

3:16 What is RFT

So I guess the first things can you tell me a little bit like about what is RFT? What is reinforcement fine-tuning like seem that seems to be an important construct for a lot of the current wave of what's happening right now. >> Yeah, absolutely. So I'd say like at a high level um you know kind of the way the taxonomy of these different concepts is evolving is that we kind have this broad bucket of things that we call post-raining which is like okay we've trained the foundation model it's good at a lot of different things now we want to tailor it a bit more for specific use cases and specific tasks how do we do that and historically you know one of the most common techniques was what we call supervised fine-tuning um which kind of has its roots going back to, you know, kind of the data science days of like the 2010s, you know, where, you know, obviously before that too, like that was like, you know, there was a big interest in the technique then for, you know, taking like a BERT model or something like that and, you know, then you would give it examples of the output that you wanted to classify etc. and then you would, you know, get it to learn through, you know, some form of mimicry or extrapolation, like how to reason about how to arrive at that right answer.
It's basically learning by example. And I think that this has been, you know, kind of a common tool in the toolbox going back to the beginning of the LM fine-tuning era, like when we had the llama model come out, it's like one of the earliest, you know, really production usable LMS. Um but it has some limitations for sure and definitely I think a lot of people um recognized that getting a high quantity of really curated labeled data was you know a big long pole and getting supervised fine-tuned to be effective and ended up being a reason why a lot of people decide not to do it instead just see if they could use like in context learning or you know rag based approaches and kind of get all the benefits that way. um separately we've had this other kind of area of reinforcement learning that has been um popular in the industry and primarily like with LMS through this con this technique called reinforcement learning from human feedback we're trying to align the model more towards human preferences so something more subjective like not something that's like right or wrong but more like you know humans prefer this or like our company policy prefers this etc.
Um, and that's where you instead of giving it an objectively correct answer, you'll often say like, "Here are two examples. Which one is better?" Right? So, it's like a very subjective quality quality. And now that we're talking about like this new technique like reinforcement fine-tuning, um, in some ways it's a bit of a marriage of those two concepts where you're saying, I want to take the techniques of reinforcement learning, but apply them to these tasks that are more objective like you would normally do supervised fine-tuning for.
So that's you know the term got coined by you know I think open AI back in December of 2024. Um the technique has been kind of you know pioneered a little bit before that when it was called reinforcement learning with verifiable rewards. Um and then you know definitely was heavily popularized by DeepSeek um uh when they published their R1 paper and you know kind of talked about their method called GRPO that they used which was like a specific way of doing reinforcement learning.
Um, and so in particular, what we found that's really exciting about this technique is that it lets you get a lot of the benefits of something like supervised fine-tuning. Um, but on tasks where there might not be a very clear like labeled ground truth example of what you're looking for like in code generation where you might know if something's good or not but like you might not be able to say like this is the absolute perfect you know function for doing this task or reasoning you know which is another area where you know some reasoning can be better than others but it's hard to say this is the perfect reasoning right which is I think where the deepseek um approach came into play and in also cases where you just don't have a lot of label data like we found that this tend to work tends to work quite well in those cases as well.
So that's a little bit of background on on why we started looking into this technique and how it kind of came to be. >> I'm curious then is there before we dive into GRPO because I think either myself or and I have a ton of questions just related to that specific topic. Does there does there is there an implication that basically you still need to actually have high quality label data or just you really need that feedback loop in order to take it to the next level like even with the reinforcement training like the reality is that combination of the two really takes it to the next level.

7:50 Quality of data

I'm just curious from your perspective. Yeah, I definitely think that um the quality of data is always going to be an important factor, but I think it just changes with reinforcement finetuning. Like you know the big challenge with supervised finetuning was always collecting the labels, right? And you know it with reinforcement fine-tuning now we're saying we don't necessarily need labels. You just need a specific way to assess correctness, right?
Like a an objective function that can be used to say this is a right answer. this is wrong, etc. Um, but that still implies that you have good data, you know, to the end. It's just it doesn't necessarily need to have like a perfect label associated with it. >> Um, so I still think that there's an element of, you know, bad data in, bad model out, like that's not going to change, but hopefully at least like the curation of the data is, you know, less labor intensive because, you know, you don't have to spend as much time handlabeling things.
Right. >> Right. is just more like it's more like providing feedback on it. It's recording the feedback that's provided instead. So maybe that might be an easier way to get higher quality. I guess the one thing I'm curious about is like because there's it can be very subjective at times too, right? Versus objective. Do we run into this issue where basically pe too many people providing feedback that actually conflicts with each other? >> Yeah.

9:19 Use cases

Yeah. So um this is in the case of like you know you're trying to steer a model towards um like some kind of like human preferencebased um direction and I think that's definitely something that can happen. I guess maybe to take a step back for a sec like talking a little bit about use cases for a moment. Um there are a few different like use cases that I think this comes up where reinforcement fine-tuning can be very useful.
Um, one of the most early one, one of the earliest ones that we explored and had a lot of success with was uh, code generation. So like you can imagine like natural language to SQL or um, transpiling like from one coding language to another or something like that. And we found that it tended to work quite well with something like reinforcement fine-tuning because one, the task was verifiable in the sense that you could say, you know, this code doesn't compile, therefore it's wrong, or this code doesn't give me the expected result, therefore it's wrong, right?
Um, but it also didn't require having label data because, you know, I don't necessarily have, you know, the exact uh SQL command that I want to run for this intent or I don't have the Python code that I want to, you know, generate from this Java code, right? But I can, you know, generate it. I can compare the outputs of the two systems and see if they're the same, right? Um, so this ended up working pretty well for a use case like that.
Um, additionally, you know, I think people have had a lot of success with kind of the math um and side of things as well, which was where, you know, Deep Seek had a lot of success. And then I think that um there's also this bucket of these more subjective tasks um that are that's very interesting like you could maybe say maybe not subjective but like um you know like uh agentic systems as well where there might be like multiple steps that need to be taken and then you get like some final outcome at the end which is like did the system do what it was supposed to do or not right and then you need to kind of back propagate that through the entire reasoning chain. to figure out like to update it and improve it.
Um so those are cases where we've seen like a lot of success with this technique. Um I think an area of research that we're very interested in as well though is this idea of like learning from feedback. Um because you do have a lot of situations in the wild where people deploy these systems you know like to an end user to a customer or something like that and the customer might be able to give some feedback like you know good bad this was a good interaction or a bad interaction you know rated on a scale from 1 to five etc. um but they usually won't give it much more detail than that.
And so you know what we're um looking at doing and you know I this is in general a direction that the industry is looking at is can we take that data that comes from a human like or a set of humans right and build a reward model that kind of captures the essence of the human preferences um that can then be used within an RFT process to score the generations. from the models. So it' be like models like you know trying out different generations and then this reward model that acts as a proxy for the human is saying this is good this is bad and steering the learning accordingly.

13:15 Whats next

Yeah, the verifiable outputs I think is a very interesting point that you brought up. U because like that is one of the critiques of the Geni community is we're just building tools that make programmers more productive. Um but so many of these problems are hard to have verifiable outputs of does the code run successfully. >> And so I'm just curious to get your take onto >> what's what's next? Um so so many of these problem domains are focused on coding and math.
I you had alluded to agentic systems, but I'm curious to get your take on what's the next big challenge to tackle. >> Yeah, it's a good point. I mean, definitely I think um you know, coding has been one of the first like kind of applications that's had a lot of success um with both RFT and I think LLMs in general like um taking on a lot of that workload. Um I do think that we're starting to see a lot of interest in um scientific domains being used with this technique as well like you know biology um kind of drug discovery um chemistry like various medical fields where there's still like some groundedness in you know like there's things are right and wrong like there's measurable ways to say like whether something worked or didn't work etc. um and where you can have these domain experts come in and impart their domain knowledge into creating these reward functions that define like how you're going to objectively score correctness or incorrectness.
Um I think that's like a big area of investment right now that we're seeing um a lot of uh a lot of companies explore. like in particular I'd say like um talking with some folks in in the space like this idea of like the longtail of applications is really is something that a lot of people are looking at. So for example, modern LLMs are pretty good at like generating Python code because it's a very popular language and so you know there's like a lot of coverage like on the internet and also a lot of people who know how to write it that can help you know improve the systems but there's also this long tale of like you know domain specific languages, languages that um maybe were popular decades ago that still have legacy systems that you want to you know convert to new systems. um that don't have as much coverage and so the models aren't very good at those tasks.
And so that's I think one area that we're seeing a lot of investment in the short term is like can we get um you know more coverage on these like longtail um coding languages and applications and help get a lot of that uh stuff modernized and you know um get these LLMs to be able to understand those types of tasks as well. And then even outside of coding you know I think expanding to other verticals other domains like you know the life sciences and so forth.
Um and then I think like where there's a big opportunity going beyond is you know like stuff like um multihop rag agentic planning systems and execution systems like I think we're going to see increasingly more systems that are being deployed that are you know not just one LLM call but some complicated chain of many LLM calls and then being able to introspect into that and say like where did it go wrong like where did it make a mistake that needs to be corrected that's I think going to be a big area of investment for RFT in the future as well. >> You you actually prompted my next question which was about reasoning models since you've been talking about DeepCar 1 which naturally brings up chain of thought.
How does RFT help in situations like that uh where you have these very complicated multi-step workflows. >> Yeah. Yeah. So I think um I think chain of thought is like a really interesting example of where RF is particularly useful because um you know if you imagine like wanting to fine-tune a model for a specific task and having some label data you know I think we can kind of like understand how you would go about collecting that data but if you want to try to teach a model to reason better it's like how would you do that with supervised fine-tuning right because it implies that you have some way of you know, perfect or nearly perfect like reasoning data um to learn from um that you'd want to say like here's an example of like perfect reasoning for getting the correct answer like go learn that.

16:36 Reasoning models

Um and certainly like we do see people do this through like distillation, right? where they'll take a um strong reasoning model like R1 and they'll say, "Okay, let's have R1 go and do the task and spit out its reasoning trace and then we'll fine-tune a model on R1's reasoning." Um like using supervised fine-tuning and like maybe you'll do something called rejection sampling as well where you'll like discard all the generations that R1 had where it produced an incorrect answer, right?
Um, and that works pretty well. But like the one challenge you have there is like you're never really going to do better than R1 with this approach, right? Because you're learning directly from R1's reasoning and R1's answers. And so if your goal is to ultimately like push the frontier of like what is possible or like improve accuracy even further, like normally the way that we would do this with supervised finetuning is like collect more label data.
But you can't really do that with this distillation technique because you're inherently bound by you know this upper limit being the performance of the teacher model that you're distilling. So this is where I think RFT and is particularly powerful is that it's you know a way that you can go beyond what is possible with the current models today um for these kinds of tasks like reasoning based tasks where there's no clean way to just collect more ground truth data.
Um and so this ultimately also is what um was really insightful from the deepseek paper is you know they call out what they call this um aha moment where they ran this gpo process this RF process on their model and it suddenly went from not really understanding how to do the task particularly well to having this moment of clarity where it's like oh I just found a really clever way to think about this problem that's different from the way I thought about it previously. and then it was able to solve the answer.
And that was not something that came from ground truth. It was purely something that came from this self-discovery, this like selfplay of reinforcement learning. >> Oh, this is really cool. So, okay, but I got to ask the first question because uh what's GRPO? Like, you know, you've mentioned the deepseek paper, the aha moment, which is awesome, but yeah. What is what is this gpo's thing? >> Yeah. Yeah. So, gpo is is pretty simple. was just one of many different reinforcement learning methods that exists.

19:41 What is GRPO

It was one that the Deep Seek authors pioneered for themselves. And there is like maybe one uh one or two things that are noteworthy about it though. Um one is that compared to what was the standard reinforcement learning algorithm before GRPO which was PO. Okay. Um, PO was um, notorious for being a bit unstable in the sense that you had not just one model that you were optimizing like the policy model, but you also had another model that you were jointly optimizing called the value model.
And this whole system because you have like multiple models being optimized at the same time ends up being both very memory and resource intensive. So you have, you know, lots of like, you know, stuff occupying GPU memory that needs to be accounted for, >> but then also very unstable because, you know, one of the models isn't learning correctly that causes the other one to learn poorly. So you have to get everything to kind of just be configured just right to get to work.
So it often ends up being like a very big um hyperparameter search space problem where you have to like find the exact right configuration to get everything to work. And so, um, with GRPO, they recognized that they could kind of do away with a lot of this complexity if instead of having this like separate value model that needed to be trained, you could instead just have like these reward functions that you define where, you know, some human for example could like encode their domain knowledge and say, you know, here's how you score a correct answer. you know like write a function that like assigns numerical scores to an answer based on you know certain properties and then based on you know some sampling of different generations um in a group which is you know where the name GRPO comes from is like the G the group relative preference optimization policy optimization then you have a um way to kind of assess like all right so among these eight different candidate solutions which ones are relatively better than the others and then based on that you're able to compute a loss that then determines how you should update the model.
So it's all based on like the relative performance of different sample generations within a single uh for a single input. >> So the single input basically generates multiple potential outputs. Those multiple potential outputs then it's like almost going back to consensus algorithms all over again where you just basically use a different type of waiting in essence. But then because you're using that relative output as you're denoting, then you're able to use that as the basis for going ahead and uh judging what's the correct answer and then it's not nearly as memory intensive.
Does that imply that it's actually more network intensive though or in terms of running multiple um outputs at the same time and then cons uh having some consensus across all of them? >> Yeah. So there's definitely an element that um you know you do have like more computation potentially because you're generating like in different generations instead of just like one generation at a time. Um so there is like that element.
Um but yeah you are saving a lot on memory as a result. Um but yeah to your point like it is very similar to like a consensus algorithm or something where you take all those generations you score them all you compute the relative differences which is what we call the advantage and then that advantage translates directly into the loss so that you can say you know if this particular output um you know had correct formatting but incorrect syntax or something then it gets a score of you know.
5 and this other one that got everything right got a score of 0. 1 one and this other one that did all these other things incorrect got negative one then it can learn directionally just from that like okay like here's you know I should try to encourage myself to do things that look more like the answers that got high scores and do things that look less like the answers that got low scores >> okay well then oh sorry go ahead my apologies >> I think we're about to ask the same thing >> yeah you're probably right yeah because yeah this is super exciting yeah sorry >> of what you were talking about of how do you get it to produce higher scores?

24:02 How to prevent reward hacking

How do you avoid it from producing lower scores? How do you prevent reward hacking? >> Yeah, so that's that's a really good question. Um, so one of the big problems that does come up here in this process is you write these reward functions and you um you know try to encode like your understanding of like what good looks like and what bad looks like. Um but the models can be kind of clever in their own ways like you know they can come up with ways of uh getting a good score on the reward function um that might not actually um achieve like the objective that you have as the programmer.
Right? So a good example of and we call this reward hacking. So a good example of this is like you know we um we're trying to do like a code translation problem um where we were you know going from this um framework called PyTorch to a framework called um Trident. It's like a CUDA like language and you know what we were doing is we were you know uh writing these reward functions that said like okay does the code execute successfully?
Does it um give you the same answer as the original PyTorch code? So kind of comparing them directly and then if so like let's give it a score of one. So one meaning good and we saw that like the model was learning. It was getting better and better and so like great this is like clearly working like we're really happy with this and then we looked at the generations like what the model was actually generating and we saw that it would like write this function that was supposed to be like in this Triton dialect and what it was doing is it was just calling like the PyTorch function and then returning that and like not actually doing anything in Trident at all.
And so we're like, okay. So it's basically figured out that it can game the system by just um writing the original PyTorch that was in the prompt to begin with. So it didn't have to do anything clever. It was just like grab that, return this, and then you know, and so um it was like clearly an example where like the model figured out a way to kind of game the system and get work around like what we had originally instructed it to do.
So, you know, we went back to the drawing board. We took our reward function that we had written and we added this extra check to basically like mock out um the function that it uh that's supposed to the Triton function that's supposed to actually do the work and compare the output before and after mocking it and said you know if the uh final answer is the same both with and without stubbing out or mocking out this function then that's evidence of reward hacking right because you the function should be doing something.
It should be materially changing the output in some way. Um and then that by introducing that check, we were able to get it to kind of stop doing that behavior and you know start doing what we were expecting it to do. But it was it was definitely evidence that you know when you are modeling these systems you know when you're building these kinds of reward functions and so forth you need to be cognizant of like the edge cases right or like what the model could do to kind of circumvent your logic.
Um, and then also kind of be on the lookout during training to just like be looking at the outputs, make sure they look good, and then be willing to kind of go back and update things if they if if it's, you know, starting to go off in this kind of reward hacking direction. >> So, this overall seems like a challenging system to design, like how do you define the rewards? How do you guard against reward hacking? How much effort is it to use RFT to do post training on a model? >> Yeah.
Well, I'd say that um it's it's definitely very task dependent like how complex it ends up being. Like I think we have some pretty good recipes that we've come up with for a lot of code generation tasks at this point um for other tasks like maybe summarization, named entity recognition, classification. Like they're pretty good like standard templates you can use for a lot of things. Um but it's definitely the case that once you start getting to things that are more um domain specific like some of these agentic planning systems and so forth like it does end up taking a bit of effort to get the solution right and so I think what we found is a good kind of general framework is that you want to try to start with something relatively simple like start with like the easier examples.
So this is kind of like a technique they broadly call like curriculum learning. It's like you have all these different data points that you want to learn. Like start with the ones that are easiest and like try to throw that at the system and then try to get it to learn some of the easier um attributes as well, right? It's like what are some things that are clearly right and wrong like formatting of the correct answer.
Like that's something you can get it to learn um relatively easily. And then I think what you'll typically want to do is once you start getting to some of these more complicated things like correctness like you know for code generation like is the code correct um what you would typically do is try to break this down into not just like a binary like zero or one yes or no but can you give it partial credit and if you can find ways to kind of give it partial credit then what you can do is you can start to steer it in the right direction even if it's not all the way there yet.
And this is really important because um these R this RFT process is what you call like an onp policy learning algorithm which means that it's learning from its own outputs. And so what that means is that if you're trying to get it to learn something it has no idea how to do at all. It's never going to get there right away. Right? because the model the model doesn't know how to do like calculus or something like you're not going to like get it to learn calculus by just telling it nope you're wrong you know you didn't get it right like you're going to have to teach it like you know like small baby steps along the way to say like okay like you know this is the correct notation versus this is not the correct notation right like slowly start to get it there and it'll eventually learn what you want it to learn but you have to give it that partial credit in order to prevent it from just getting stuck and unable to make any forward prog progress. >> Wow.

30:17 Optimizations

So, we're basically as per curriculum learning going back and teaching our models like a a full, you know, elementary, middle school, high school course, college course load basically. But yeah, I like I like the analogy quite a bit. Um, saying that um all right, you've built all this. This is really cool. Can you tell me a little bit about like now that you have this model, like how do you optimize performance of the system for things like model serving?
I'm just curious. >> Yeah. Yeah. So, um this is definitely something that we spent a lot of time thinking about for us as well as like you know we do both post training as well as serving optimizations. Um and so one thing that um you know we do is we also um not just I guess do the kind of quality based fine tuning but we also do some post-training optimizations to help with speed as well. And so, you know, one thing that, uh, we've invested very heavily in that we've found has been very successful is when you have these models that generate a lot of tokens.
Um, you know, you can use techniques like something called speculative decoding to speed up the inference process. So that instead of, you know, normally the like maybe to just like kind of briefly give a primer for folks who maybe aren't as familiar about like, you know, LM inference and how it works, normally you're generating like one token at a time, right? So you generate a token, you feed it back in the input, you generate the next token.
Like that's the process. And that tends to be why LM inference is slower than most other forms of inference because they have to generate one token at a time. And so what you can do with speculative decoding is if you can generate say four tokens at a time um and then just validate that they're consistent with what the model would otherwise have generated then you can speed up the whole inference process by you know like two to threex in some cases right depending on how expensive that verification ends up being.
Um and that's like you know a big win when you're you know like trying to do this as fast as possible in production. So what we often do with um you know when we do these engagements is you know we'll do some fine-tuning for quality initially to get the model to output what we want and then we'll do some post-training optimization for this specular decoding as well and other kind of quantization methods and things like that in order to get the latency where the user needs it to be and then ultimately deploy that into production.
So, it's usually a multi-step process like get the quality where you want and then get the performance where you want for production. >> And so, I know you created Lorax. How does Lorax help with serving these models as well too? >> Yeah, absolutely. So the kind of background behind Lorax as a as a project is that um you know when we were starting to look at doing fine-tuning and serving particularly like this parameter efficient fine-tuning and serving where you have these like small adapters that um you know like maybe only constitute like 1 to 10% of the total parameters in the model that are being modified. um you know the kind of solutions that were available at the time um circa like 2023 were you know that you would have to either merge those weights back into the base model and then serve that or you know just serve this like model plus these adapter weights like together in a single deployment and then do that for every single adapter that you have.

32:55 Lorax

Um, and so what we realized was, you know, that you could, um, serve many of these adapters on a single GPU because the amount of memory that they take is so small relative to the model itself. Um, and then effectively like swap them in and out um, at inference time. And this ended up being very valuable for RFT as well where you have you know you can imagine like constantly new checkpoints that are being written like every time you update the model you write a new checkpoint that checkpoint needs to get loaded in to the inference server to generate the new candidate generations and then unloaded at the end.
Um, so this idea of like swapping Lauras, swapping these adapters, um, was what ultimately led to the creation of Lorax, which was an inference server designed for serving many fine-tuned adapters simultaneously. Um, and since then, I think we've obviously improved it quite a lot. So, you know, we don't even have really the notion of swapping at all anymore. Like everything can be done in a single batch. We have like custom CUDA kernels that um you know been written in collaboration with like you know some from some folks at University of Washington who did like the flash in for a project wrote the original version of these kernels.
Um and you know they kind of let you process um multiple different loras in a single batch together without having to pay any kind of switching costs. And so effectively, you know, what we've been able to do is kind of scale this up to now the point where we can have like hundreds of different fine-tuned models on a single deployment without any noticeable degradation, latency or throughput. Um, and so that ends up being very valuable for customers that want to have um many different you know very narrow task specific um RF models or fine-tune models.
So what you can imagine ends up happening in practice is like instead of trying to fine-tune one model that does all these different things really well, right? Like you can fine-tune models that are very specialized to like specific things like function calling or you know handling uh guard rails or something like that. Um, and then as long as you have a way to route to the appropriate fine-tuned model at query time, you know, you can have this very highly performant, very efficient model to service that request that's all running on one GPU.
So like your costs, you know, are very manageable as well. Um, you know, that's like ultimately a better production system at a cheaper price point. >> This is awesome. And so then I think that naturally, you know, you we're talking about RFTTS, we've been talking about Lorax, pretty cool. How does this fit into Predabase, your company, like you've got a cool company, I'm you've been building these cool systems. Love to know better a little bit better how this all fits together. >> Yeah, absolutely.

36:24 Predase

So with Predase, um, you know, we're a platform that helps people to customize and productionize open source LLMs. That's like our our mission. And so as part of that we have you know kind of two broad offerings in our product. One is the inference capabilities and the other is the kind of post-training capabilities like fine-tuning and reinforcement fine-tuning etc. Um, and ultimately we see this as being, you know, like why why a product that does these two things in particular.
It's because we see that there's really like this um flywheel that exists between these two things, right? It's not just like that, you know, you want to post train and you want to serve in these like two distinct steps, but rather, you know, you want to put something in production and then over time you want to it to get better, right? You want it to improve. And so to do that, you need to collect more data about how the system is performing like what are the requests and responses that are coming in.
What's it getting right? What's it getting wrong? What's the human feedback on those responses? And then as that data comes in, you want to curate it and refine it and then help turn that into the next round of fine-tuning that you'll do to improve the model further. So, you know, we already see today that our customers use our post-training speculative decoding technique, Turbola, to automatically make their models faster and faster over time.
So, like as you get more and more request and response data, you can fine-tune these speculators to make the model faster. And then we're also starting to do more with fine-tuning for quality as well over time where you collect more and more of this data, you refine it, you curate it, you build eval sets, you do AB tests, and you can get the model to be better and better in production um on a quality dimension as well. >> So how can listeners get started with Predase? >> Yeah, so we have a free trial that's available for folks who want to uh check it out.

38:26 How to get started

So, we give um about $25 in credits to every new person who signs up to the platform. Um, and with that, they can fine-tune models, deploy them, um, kind of get a sense for how, uh, their production workloads will work on our platform. Um, and from there, um, you know, there's a full developer tier available to help you kind of deploy your own models, whether that's any open source model that you want like 3, Llama, etc.
They're all available for fine-tuning and serving. Um, and then from there as well is like as you get more serious and you want to go to production, you know, we also have support available for uh helping people do dedicated deployments with reserve capacity and like helping to build customized deployment solutions for the exact demand uh the exact number of requests per second and latency targets they want to hit. And then once that goes to production, we um help them, you know, with uh providing SLAs's on that and making sure their deployments are working 24/7.
Um but getting started is very easy. Just sign up and with uh your Google account, etc. , and you can get started without even having to put any credit card down today. >> That's amazing. Awesome. So, we just want to say thank you so much for joining us today on Data Booth. This was a fantastic conversation about the lay of the land of current models, RFT, Lorax, and once again, thank you for all of your contributions to the open source community, both with Horode and with Lorax.
Um, and we hope everybody gets a chance to check out Predase. As Travis had mentioned, no credit card required, so no blockers to getting started today. >> Awesome. Thank you both for having me.

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.