From the course: Fine-Tuning LLMs for Cybersecurity: Mistral, Llama, AutoTrain, AutoGen, and LLM Agents
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
LLM fine-tuning
From the course: Fine-Tuning LLMs for Cybersecurity: Mistral, Llama, AutoTrain, AutoGen, and LLM Agents
LLM fine-tuning
- [Instructor] Welcome back. We are finally ready to fine tune our LLM. Let's go through the code together. The alpaca prompt variable is a template that helps format how instructions, inputs, and responses should be presented. It ensures that the structure of these three elements is consistent. When we fill in this template, we get a complete prompt ready to be processed by the model. EOS Token is a special token that tells the model when to stop generating text. Without this token, the model might keep generating text indefinitely, which isn't what we want. This token is crucial for controlling the output length. The formatting prompts func function is responsible for taking the instructions, inputs, and outputs from our dataset and plugging them into the alpaca prompt template. It loops through each example in our dataset and formats it properly appending the EOS token at the end. The result is a list of neatly formatted texts ready for training. Instead of using an existing…