welcome back guys so as I said in the previous video in this video we're going to discuss how you can train the models these custom models with your own data but before we do I do want to uh say one thing so if we go to the um base models you can look at all the models that we've looked at and for example um many of these Amazon models are in preview so they're not available in the playground yet um and I do want to talk about for example the uh embedding model because the Titan
Tex G1 or the Titan uh text G1 light are similar to like other uh AI models um that we've looked at with like uh anthropic AI or a21 Labs however this one uh is an embedding model and remember um embedding models create a vector output so this one outputs a vector of size 1536 and this means that you can have like a text and it's going to save it as the this embedding and then you can use this uh embedding to then you know save your data into a vector database and then do semantic search
with it and all those kinds of stuff and the reason that these embedding models are not in the playground is because they're really isn't an output besides a vector with this size okay so Amazon was like you know if if you do a playground with these chats or image text it's pretty cool when you see the output but for that model the out put is just a vector so it's just a vector with um um 1,536 uh numbers in it so it's not really anything that you know you need a playground for so now let's
come back over here to custom models and here you can fine-tune and incr incrementally train a base model with your own data right now this is in um preview actually also so you can't use it but I will show you guys how you can okay so if you go to find tuna model you can see over here as of the recording um there are no models that I can fine-tune just yet okay so if you're watching this video in a few weeks or months uh you'll have the source model but for me this is so
new that I can't select the model but then let's let's suppose I selected a model here then I can you know say my name my my custom llm um you can do model encryption and if you look at the information our data is encrypted by default with a key that AWS owns and manages for you and to choose a different key or your own key um you can um basically just uh set this model encryption and you can select your own key okay now you can have a job name that you want so this way
you can identify the uh the training job for this um specific model if you want to you can even set it up to be in a VPC and here is the input data location and the validation data set and I'm going to talk about that in just a second and here are the hyper parameters that you can tune um epox batch size learning rate and learning rate warm-up steps you know I'm not going to get into the details because I'm assuming you guys already know what these are as you can see the information is pretty
um good here um so yeah I'm not really going to get in the details um and here you can get in the output data um where the model is going to be output and here you can also have service access and you know just some basic what rule you want to assume okay so here it says that purchase provision throughput to use a fine-tune model remember this is what we talked about if you fine-tune a model you're going to have to do provision throughput and it's going to be build by the hour um and if
we come back over here to the provision throughput you can look at it right now what's available what's not available you can just come here to the docs and look at the latest um about provision throughput and remember when we looked at the pricing for example for the um provision throughput so um let's look at it actually sorry um let's look at it for for example for anthropic um for the provision throughput um you must have a commitment for example for the anthropic AI for either a one month or a six month and this is
the per hour billing okay so that's why they're going to be quite uh expensive because you have to Do It um either for a one Monon commitment or a six month commitment and so before you do train your custom model and then you want to deploy it I highly recommend you look at the pricing because it can get quite costly um so I just wanted to to let you guys know so do look into it and actually yeah the EPO you know I I don't want anyone who doesn't um have this understanding to think that
you know I'm not going to talk about it so EPO basically is just a number of iterations of all the training data so the more Epoch you have the better your model is going to be but the more expensive the training um is going to be so this is basically how many times it should Loop over your entire uh data set the batch size is the number of samples processed before the model weights are updated if you set the badge size to one then the model is going to be very noisy because after each sample
it's going to you know go into a direction when it's being optimized with gradient descent so you do not want to set too large of a batch size because if it's too large then you could have you could run out of memory so you know you want to look at the uh optimal number and there are a lot of Articles of how you should choose the badge size for llms the learning rate is the step size for incrementing parameters at each iteration so this is basically for back propagation if the learning rate is too small
then your uh model might not converge to the uh ideal solution if the learning rate is too big then it might uh jump over the optimal uh solution so you have to find the optimal learning rate and this is just the number of iterations over which the learning rate is gr gradually increased to the initial rate specified so basically you might want to set this to like I don't know like 10 50 depending on your use case um and basically it's going to say that after how many iterations should the learning rate um be increased
to this because it's gradually increased to the initial rate specified over here so you can play around with this as well uh this is so that this is a great parameter if if um you want to optimize the performance not the performance but the uh number of minutes or hours it takes um for your model to uh train and here this is important because I do want to let you guys know that if you do want to train your uh a custom model with your own data then how that data should look like so I'm
over here in the official guides over here Bedrock um user guide for the model customization and here you have the prepare the data sets this is how it should look like so this is how your data should look like you have the input and the expected output that your model should say so you know if you're uh for example a a hospital and you want to train this or you're a research team and you want to use this for medical stuff you can have like the input be like the patients concerned so they're going to
be like I have a sore throat um I have a running nose and I have a high fever and then the expected output is going to be you know a certain sickness or whatever a disease it could be coid I don't know whatever or a flu and so that's how you could optimiz this okay and so this is an example the input is what is AWS and the output is it's Amazon web services so this is how your training data should look like and you can read more about this it should um support the jonl
format and you need to have these keywords the input and the uh expected um output is going to be specified over here so as you can see um then I can start fine-tuning the model okay but like I said there's no Source model as of now because Bedrock is so new but by the time you're um looking at this video there might be a source model that you can look at and like I said be careful with the pricing if you do uh tune your own model because in order to use it have to do
provision throughput which is quite costly and it could be several thousand a month okay so you've been warned um but I did want to show you guys how you want to do it and this is going to be probably be used by big large companies and you know like uh large Banks who have the money to to support this okay so this is basically my overview of Amazon uh Bedrock um I feel like we've touched on all the topics so in the next video we're going to start looking at um our projects and what we're
going to be building so I will see you in the next video