Introduction
Our ready-to-use large language models, such as command
, are very good at producing responses to natural language prompts. However, there are many cases in which getting the best model performance requires performing an additional round of training on custom user data. Creating a custom model using this process is called fine-tuning.
Why Fine-tune?
Fine-tuning is recommended when you want to teach the model a new task, or leverage your company's unique knowledge base. Fine-tuning models is also helpful for generating a specific writing style or format, or leveraging a new data type.
If you are aiming to use a language model to draft responses to customer-support inquiries, for example, using a model fine-tuned on old conversations with customers will likely improve the quality of the output.
Note that there might be pricing differences when using fine-tuned models. You can use our Pricing Calculator to estimate the costs.
How to Create Fine-tuned Models
Cohere offers two methods of creating fine-tuned models: via the fine-tuning Web UI on the Dashboard page, and via the Python SDK. The fine-tuning process generally unfolds in four main stages:
- Preparing and uploading training data.
- Training the new Fine-tuned model.
- Evaluating the Fine-tuned model (and possibly repeating the training).
- Deploying the Fine-tuned model.
Once you Fine-tune a model, it will start appearing in the model selection dropdown on the Playground, and can be used in API calls.
Types of Fine-tuning
Models are fine-tuned for use in specific Cohere APIs. To be compatible with the Chat API, for example, a model needs to be fine-tuned on a dataset of conversations. APIs that support fine-tuned models are:
Fine-Tuning Directory
For your convenience, we've collected all the URLs relevant to fine-tuning Cohere models below. Think of this as being like a fine-tuning table of contents.
Fine-tuning for Generate
- Preparing the Generate Data
- Starting the Generate Training
- Understanding the Generate Results
- Improving the Generate Results
Fine-tuning for Classify
- Preparing the Classify Data
- Starting the Classify Training
- Understanding the Classify Results
- Improving the Classify Results
Fine-tuning for Rerank
- Preparing the Rerank Data
- Starting the Rerank Training
- Understanding the Rerank Results
- Improving the Rerank Results
Fine-tuning for Chat
Updated 4 days ago