Part 3 Prerequisites for Making Fine Tunes === Elizabeth: [00:00:00] So this video here I'm sharing because this is the recommended viewing. It is older. This is from 2023, November of 2023. It was the very first time that OpenAI publicly started, , trying to do some education about fine tunes. , the documentation is much better now, y'all, when we started the documentation was like horrible. We were having to figure things out on the fly. This video, it is long, it's about, I think 45 to 50 minutes, but it's going to talk about rag retrieval, augmented generation. And fine tunes. It's about half and half on each. Now if you're like, but I'm not here to learn rag. I know it's fine. Rag was something that was very much needed before the models had the larger context windows. This came out at a time where our biggest context window was 16,000 tokens. We are now more than 10 x that on most major models, most major models are taking 128,000 tokens or more. So [00:01:00] why is this video still pertinent? Because I think it's actually a really good way to understand. Some of the base jargon technology and understand that when they use jargon in this, they're inventing the jargon on the spot. Okay? This is a whole new field, so you are not behind. If you hear something you don't understand. This is like Shakespeare's times where we're all just making words to describe what we're doing because it's a whole new field. Now, the reason I think that this thing is really good, and if you watch nothing else, just jump to like 30 minutes and John Allard will be on there. So one of the first authors or first writers I should say, he wasn't an author, he was a writer. He was a writer of blog posts. They worked with on making a fine tune, and we still in the FFA laugh about this. He took like 140,000 slack messages to train on. And this is a good. Learning example. Okay, now, first of all, if you asked us who run the FFA, if we would ever have trained our Slack messages to be how we write, we would've said, no, that's a bad sample set. I don't write in [00:02:00] my Slack messages the way I write in my books. That's captain obvious, number one, but anyway, this person trained on Slack messages thinking, oh, I'll just train on Slack messages and it'll be able to write me a blog post. Well, after he trained on the Slack messages, hundreds of thousands of them made a data set, put it into the model. He asked this great model, all right, write me a blog post. And the fine tuned model says, okay, I'll do that tomorrow, because that's how he was always responding in Slack. So it picks up the tone and the style in which you would talk. And then he was like, no, I need you to do this today. And the model was like, okay. And again, because how do we respond in Slack to our bosses? It's TERs, right? It's very short. It's very like just the information, ma'am. And so basically he spent all this energy to teach at an AI model, how to be like a human, trying to avoid work inside of Slack. And it's quite comical. That's at the 31 minute mark. Now the biggest [00:03:00] thing. About this, uh, whole methodologies, I think it still holds true to today. This is still like a core crux of how I teach, , just writing with AI for authors. Open AI came up with a matrix, but I think it's, it's a fair matrix. , and it's just four quadrants. So if you're thinking about this lower left hand corner being zero, and I'm gonna zoom in so you guys can see it. A little bit better. Now this one's let's lit up. The other ones aren't lit up, but I'll tell you what they say. , the optimization flow. So everybody starts here at zero and they kind of learn how to prompt engineer. They learn, you know, better prompting. They learn to say avoid instead of no. They learn to be specific in their prompting and, and they're kind of like happy with their results, but they were like, I think that there's something more. Well. In order to make the model no more. That's where we have RAG as an opportunity retrieval augmented generation. All that does is take a long piece of text, lots of text, and it starts to chunk it and try to summarize those chunks. [00:04:00] Now, if you're trying to think for a second how you would chunk a book and understand that they're not chunking it at the chapter level, they're chunking it like the paragraph level, which works great for nonfiction, but you can imagine for fiction, that's not really a great. That's not really a great interval, I would probably chunk at the scene. So we have had advances now in RAG where we can control the rag and we can make the chunks bigger usually a thousand characters or whatever they usually would make it. But rag just takes a lot of information and tries to summarize it down and then inject that summary into the LLM. You can imagine for fiction sometimes that has mixed results because some summarization is great. But sometimes fiction has metaphor and things like that that the LLM doesn't summarize as well. It's a lot better today, but it definitely wasn't that great of, a year ago. So to help a model no more, you can always inject rag, or you can inject information Today, I think most authors don't really need rag. Just give it all your stuff and ask [00:05:00] for a shortened plan of like what, what the AI needs. The AI can just extract the information from a long prompt and like, make you make a plan. Now, the other way that you can optimize is how the model needs to act. And so beyond prompt engineering, what's to the right here is fine tuning, fine tuning. Is what changes that tone so that the AI can write back in that that new voice or that unique voice. And so when an author they master prompt engineering, which is a requirement before you wanna fine tune and then fine tuning, and then they also are able to inject information about their book. Then they're in this quadrant in the top right, which is all of the above, and AI creators who get to this top box. They're usually getting results that are 90 to 99%. Fine. I've gotten to the point where, I've had AI generate an entire book and I wouldn't have to make change like I read it, things in there, maybe about 10, that I was like, Ugh, I don't really like that. But it wasn't a games stopper. There was a difference between, it was [00:06:00] like the AI in previous years, would just write something that didn't even make sense plot wise. This made complete sense plot wise. I could sit there and read it. Maybe a few changes I would make, but it's completely publishable as is, and that's where we are today. Okay, so now the bad news, you do need to have prompt engineering BA before you try to fine tune. This is not a question of us. You know, we know this class is expensive, and it's not as simple as saying, well, I'm paying for this expensive class. I should just be able to skip. It's not about that. I can't teach you how you want to prompt the AI until you practice and you define that for you. Every author prompts the AI differently, so it's important that you have tested. Played with these base models, open ai, et cetera, and you can voice why you don't like them, why they're not a hundred percent good enough, what are they getting wrong? If it's a question of information, [00:07:00] like, I just got my character wrong, then your prompts probably just need to be injected with more information about the character. If you're like, well, they got the plot right, but this isn't the way I would write it, that's a fine tune. That's a fine tune opportunity. So you need to know the context, what a context window is, and be able to explain it to someone else. When we work with data sets, we are going to be making examples that have to fit inside a context window. Context window is, you know how much the AI can take at one in one prompt or one, one chain of conversation. If you don't understand what that is, you're gonna have a hard time making a data set and staying within those limits if you don't understand what those limits are. You need to know the output limits of major foundational models. Same thing. You'll need to know what system, user and assistant play in the open AI playground interface. Again, our free class on AI writing, at future fiction academy.com covers all of that information so that you can, know, exactly what those roles do. You need to know how to manipulate temperature and top P presence and [00:08:00] frequency penalties. Again, that's all in the free class. It is about being able to play with a fine tune and knowing those fine controls is going to make you more successful. You need to know the limitations and the opportunities, so like they don't think, but you can use that chain of thought, which is that new conversational style. You can craft specific prompts that give you decent results. So the results you wanted. That's the foundation of fine tuning. Fine tuning is the foundation of prompts that you know are pretty tried and true, are pretty, reasonable because you. You are going to give a whole bunch of examples, at least 20, minimum of 10, but you're going to give a whole bunch of examples and then you're going to continue to use those kinds of prompts, in the future with the fine tune. , and you also know that when you don't get a result that you want, you know how to re-roll it, to tweak it, , or try both. That's also a core functionality of being able to fine tune, understand that at the end of the day, this is a roll of dice. It picks a token. It picks the next token. It picks the next word. It picks the next word, it picks the next word [00:09:00] if it chooses kind of like a really obscure word, somewhere in that sequence, you can just be off on a tangent. And then it doesn't mean that you did anything wrong in your prompting or anything's wrong with your fine tune. You just have to click that redo button. Okay? So if you don't have those skills, don't worry. You can get them before you try to do a fine tuned data set. Go watch the free classes. Go get the free intro to Raptor Write, play with Raptor Write, which is free. Put $5 on open router so that you can play with it. Take the fine, , the free classes and educate yourself about the basics of AI prompting. If you don't know that, if you try to go, Elizabeth keeps warning me, but surely that warning is for other people, not me. I can just do this. What's gonna happen is you're going to be miserable. You're going to hate this. You're gonna, you're gonna not be able to tell if you're fine, tunes any good, , or is it even working? And again, you'll, you'll waste money. Alright?