How to create and use a fine-tuned model?
In Fine-tuning Mode, you can create a custom AI model by refining a base model using your own dataset. Fine-tuning enhances the model’s knowledge in specific areas, allowing it to generate more accurate and relevant responses for your use case.
Step 1: Prepare Your Dataset for Fine-tuning
To fine-tune a model, you need to prepare your dataset in JSONL (JSON Lines) format. Each line in the JSONL file represents a conversation with a "prompt" and its corresponding "ideal response." This enables the model to learn from different types of interactions.
Example of JSONL Format
Here’s an example of a well-structured JSONL dataset for a technical support agent:
Json
Structure Breakdown:
- System: Defines the assistant’s behavior and context. This part helps the model understand its role.
- User: The user’s question or query.
- Assistant: The model’s ideal response, which it should aim to replicate during fine-tuning.
Additional Examples
-
Example 1: Customer Support - Order Tracking
Json -
Example 2: Healthcare Support - Symptom Inquiry
Json
You can add multiple examples like these (at least 20 recommended) in your JSONL file to train the model effectively.
Step 2: Upload Your Fine-Tuning Dataset
Once your JSONL file is ready, follow these steps to upload and start fine-tuning your model:
- Go to the AskHandle Dashboard.
- In the Command Center, select Fine-tuned Model.
- Click on + Add Model to create a new fine-tuned model.
- Choose a base model you want to fine-tune (e.g., GPT-4o-mini, GPT-4o, etc.).
- Click Choose File to upload your JSONL dataset.
- Click Save Model to start the fine-tuning process.
The fine-tuning process consists of two phases: validation and running. This typically takes a few minutes. Once the running phase is complete, your fine-tuned model will be ready for testing.
If the fine-tuning process fails, the issue is likely related to the data structure or file format. Double-check the format of your JSONL file, ensuring it's properly structured and saved as .jsonl
.
Step 3: Use Your Fine-Tuned Model
Once your fine-tuned model is ready, you can choose from several modes to use it in: Select your model in these modes:
Mode | Use Case |
---|---|
Fine-Tuned Only | Pure custom interactions (e.g., brand-specific support). |
Combined Data | Blend fine-tuned responses + your data sources + pre-trained AI knowledge base. |
General Data | Only use AskHandle’s pre-trained AI knowledge base. |
Your Own Data | Augment with your internal documents only (e.g., PDFs, FAQs). |
Troubleshooting
- Validation Failures: If the fine-tuning process fails during validation, check your JSONL file for errors. Ensure all data lines are correctly formatted, and that you're following the structure outlined in the examples above.
- Slow Model Training: If fine-tuning takes too long, try reducing the size of your dataset and ensure that your file format is correct.