Assembling the future of great customer experience
Explore the transformative power of composable CX, and how it can equip your business to thrive in the ever-evolving digital landscape.
From OpenAI's GPT-4o to Google's T5 AI models, fine-tuning your AI models will require a different strategy when using a closed-weight or open-weight model.
Explore the differences, using GPT-4 and T5 as examples of closed and open weight models, respectively, and how you can adjust (or not) the inner workings of AI models to best meet your needs.
Everything AI can deliver comes from the foundation of the models used.
The evolution of such models has driven the need for fine-tuning, which is an essential step when creating AI systems. It ensures that the models can be applied to specific needs.
However, all fine-tuning isn't the same, and differences emerge when comparing large language models (LLM) like OpenAI's GPT-4 to Google T5. So, what does fine-tuning look like in closed-weight (GPT-4o) and open-weight (T5) models?
In this article, you'll learn the differences between fine-tuning GPT-4 using data provided in formats such as JSONL and fine-tuning a model like T5 using more traditional, fully annotated data.
What is fine-tuning of AI models? It's a process that adjusts pre-trained models to accomplish more domain-specific tasks. GPT-4 and T5 both have fine-tuning capabilities, but the depth and control over the model differ significantly.
Closed-Weight Models (e.g., GPT-4): These models have weights that are not publicly accessible. Instead of modifying the model's internal structure during fine-tuning, you adjust how the model behaves by providing examples in a format like JSONL. This type of fine-tuning indirectly influences responses but doesn't alter the core model weights.
Open-Weight Models (e.g., T5): Open-weight models provide access to the internal weights, allowing them to be modified directly through training. These models are highly customisable and can be tuned more precisely to individual tasks.
Fine-tuning GPT-4 involves using a dataset formatted in JSONL (JSON Lines), which consists of prompt-completion pairs. The model's behaviour adjusts based on the examples provided, but the actual model weights don't change.
{"prompt": "What is the capital of France?", "completion": "The capital of France is Paris."} {"prompt": "Who wrote '1984'?", "completion": "The book '1984' was written by George Orwell."} {"prompt": "What is the boiling point of water?", "completion": "The boiling point of water is 100°C or 212°F at sea level."} {"prompt": "What is the largest planet in our solar system?", "completion": "The largest planet in our solar system is Jupiter."} {"prompt": "Translate 'Hello' to Spanish.", "completion": "Hola"}
Example JSONL Data
Here are the pros and cons of using closed-weight fine-tuning.
In contrast, fine-tuning a model like T5 involves providing it annotated datasets where input-output pairs are tokenised, and the model's internal weights are updated based on the data. This more involved fine-tuning fundamentally changes the model, allowing it to specialise in a given domain.
Here are the pros and cons of using this method.
T5 is part of a growing family of open-weight models, where access to the adjust the model's internal structure is given. Other examples of open-weight models include Meta's LLaMA and newer models like those from Mistral AI. Open-weight models allow developers to customise the models by adjusting their weights to perform specific tasks. This level of flexibility is highly valuable for those who want to develop specialised AI systems without relying on the constraints of closed systems like GPT-4.
However, the trade-offs are not insignificant. Open-weight models require more technical expertise and considerable computational resources to fine-tune effectively. The process is also more complex, as developers need to manage the input-output examples and the entire end-to-end process of training and fine-tuning the model.
Aspect |
GPT-4 |
T5 |
Model Type |
Closed-Weight Model |
Open-Weight Model |
Model Weights |
Not changed; behaviour influenced by examples |
Model weights are updated to fit the specific task |
Learning |
Learns how to respond better based on examples |
Learns the entire task, altering weights based on data |
Data Format |
JSONL (prompt-completion pairs) |
Custom dataset (input-output pairs) with tokenisation |
Control Over Model |
Indirect control over behaviour through examples |
Direct control over the model’s learning and performance |
Usage |
Better for instructional tasks or minor adjustments |
Better suited for specific task specialisation |
In the era of AI model fine-tuning, no single process solves every need. There are pros and cons to closed-weight and open-weight models. The latter enables greater customisation and more in-depth learning, while the former is ready quickly but only for more straightforward tasks.
When determining which is best for you, follow these tips:
In this quick assessment, you can choose simplicity and speed with closed-weight or customisation and specialised learning with open-weight.
Explore the transformative power of composable CX, and how it can equip your business to thrive in the ever-evolving digital landscape.
Upgrading not only secures your site but also unlocks new possibilities with the latest .NET Core technology, allowing for a more scalable and robust web experience.
We reflect on our work with government on digital transformation and the unique challenges – and opportunities – faced in providing great digital services for citizens.