GPT 3.5 Fine Tuning for Structured Output: Academy

In this video tutorial, we'll discuss how use GPT 3.5 fine tuning for structured output formatting. In particular, we'll use fine tuning to turn financial news headlines into structured JSON outputs.

For example, we'll be using fine tuning in order to take financial news headlines and output the stock symbol, price change, event, and date:

  • Input: Apple Inc. stocks soared by 5% after announcing its new iPhone on September 1, 2023.
  • Output: {"stock_symbol": "AAPL", "price_change": "5%", "event": "new iPhone announcement", "date": "September 1, 2023"}

As OpenAI highlights, reliable output formatting is a key use case for fine tuning:

Fine-tuning improves the model's ability to consistently format responses—a crucial aspect for applications demanding a specific response format, such as code completion or composing API calls. A developer can use fine-tuning to more reliably convert user prompts into high-quality JSON snippets that can be used with their own systems.

This is the video companion to this article and includes the a Colab notebook containing the code, as well as a sample fine tuning dataset for structured output formatting.