Fine-Tuning OpenAI open to ChatGpt 3.5 Turbo and release updated API
OpenAI has finally released fine-tuning for GPT-3.5 Turbo, with fine-tuning for GPT-4 coming in the fall. Before this update was possible to fine-tuning and create modelling only with Curie, Babbage and DaVinci.
This update allows developers to customize models for their specific use cases and run these custom models at scale.
Early tests have shown that a fine-tuned version of GPT-3.5 Turbo can match or even outperform base GPT-4 capabilities on certain tasks.
Privacy and GDPR
The data sent in and out of the fine-tuning API is owned by the customer and not used by OpenAI or any other organization to train other models.
Uses Cases declared from this Update
Improved steerability:
- Fine-tuning enhances the model's ability to adhere to instructions more effectively.
- This includes producing concise outputs or maintaining a set language for responses.
- For example, with fine-tuning, developers can ensure the model consistently responds in German when given the respective instruction.
What is steerability
"Steerability" in the context of machine learning models, especially large language models like those from OpenAI, refers to the ability to guide or "steer" the behavior of the model.
It encompasses techniques and methods that allow users or developers to influence the outputs of the model to align with specific requirements, constraints, or preferences.For instance, if a user wants the model to produce answers in a concise manner, to follow a particular style, or to always respond in a specific language, steerability mechanisms would allow for such customization.
It essentially provides more control over the model's behavior beyond its default or pre-trained state.Steerability can be achieved in various ways, including:
- Fine-tuning the model on specific datasets or with particular prompts.
- Adjusting hyperparameters during inference.
- Using explicit instructions or prompts to guide the model's responses.The idea is to make models more useful and adaptable to a wider range of applications and to ensure that they can be tailored to specific needs.
Some Examples
Language Preference:
Without Steering: User asks, "What is the capital of France?" and the model responds, "The capital of France is Paris."
With Steering: User instructs, "Answer in Spanish," and then asks, "What is the capital of France?" The model responds, "La capital de Francia es París."
Verbosity Control:
Without Steering: User asks, "Can you explain photosynthesis?" The model gives a detailed multi-paragraph explanation.
With Steering: User instructs, "Give a concise answer," and then asks, "Can you explain photosynthesis?" The model responds, "Photosynthesis is the process by which plants convert sunlight, carbon dioxide, and water into glucose and oxygen."
Tone Adjustment:
Without Steering: User asks, "How do I bake a cake?" The model provides a standard recipe.
With Steering: User instructs, "Give a fun and enthusiastic response," and then asks, "How do I bake a cake?" The model responds, "Woohoo! Baking time! 🎂 Grab your favorite ingredients, put on some groovy tunes, and let's create a cake masterpiece together!"
Domain-Specific Answers:
Without Steering: User asks, "Tell me about apples." The model provides general information about apples.
With Steering: User instructs, "Answer from a historical perspective," and then asks, "Tell me about apples." The model responds with a history of apple cultivation, ancient varieties, and their significance in historical events.
Ethical or Bias Concerns:
Without Steering: User asks, "Tell me about controversial topic X." The model might provide an answer that some users find biased or inappropriate.
With Steering: Developers fine-tune the model with data and prompts that guide it to answer such queries in a balanced, neutral, and informative manner without taking sides.
Reliable output formatting:
- Fine-tuning bolsters the model's capacity for consistent response structures.
- This is vital for tasks requiring precise formats, such as code suggestions or crafting API requests.
- Developers can leverage fine-tuning to transform user inputs into dependable JSON fragments suitable for their systems.
Custom tone:
- Fine-tuning allows for refining the model's output quality and tone.
- This ensures a better alignment with a company's distinct brand voice.
- Companies with a unique brand tone can utilize fine-tuning to ensure the model resonates with their specific voice.
The Costs
Fine-tuning costs include training and usage costs, in addition, OpenAI has introduced babbage-002 and davinci-002 as replacements for the original GPT-3 base models, which will be turned off on January 4th, 2024.
When to Consider Fine-Tuning GPT Models
Fine-tuning GPT models is sharp for particular tasks, but it's essential to weigh the investment in time and resources it demands.
Before diving into fine-tuning, consider the following approaches:
Prompt Engineering:
Often, refining your prompts can significantly improve the model's outputs. A task that seems challenging for the model initially might become manageable with a well-crafted prompt.
Prompt Chaining:
Decomposing intricate tasks into a sequence of simpler prompts can enhance the model's performance. Instead of a single complex question, break it down into manageable chunks.
Function Calling:
Utilize the model's inherent capabilities by calling functions or methods that guide the model to specific behaviours.
The advantages of these methods include:
Faster Iterations:
Prompt engineering and chaining offer quicker feedback loops. In contrast, fine-tuning involves creating new datasets and initiating training sessions, which can be time-consuming.
Resource Efficiency:
Fine-tuning requires both computational power and time. Leveraging prompts can yield satisfactory results without the need for additional training.
Complementing Fine-Tuning:
If you decide to fine-tune later, your efforts in prompt engineering won't go to waste. The best outcomes often emerge when integrating a well-crafted prompt into the fine-tuning dataset or combining prompt strategies with fine-tuning.
For those seeking to optimize GPT's performance without resorting to fine-tuning, i suggesto to read GPT Best Practices Guide, it offers valuable insights.
gpt-3.5-turbo is the command to tune with the new model in Python
openai api fine_tunes.create -t "yourfile.json" -m "gpt-3.5-turbo"
Read also this