Understanding OpenAI Models - Instruction

Flagship Models

A disclaimer, OpenAI continuously provides updates to their models, so be sure to check the latest information.

OpenAI maintains two flagship models, GPT-4o and GPT-4o mini. These represent their highest-performing model and their high-performing but affordable model, respectively. Here’s a summary of these two models below

Context Window Pricing/1M Output Tokens Pricing/1M Input Tokens Use Case Model 128k tokens $2.50 $5.00 For complex, multi-step tasks. gpt-4o 128k tokens Max Output 4k tokens 16k tokens Training Data Oct 2023 Oct 2023 $0.075 $0.15 For fast, simpler tasks. gpt-4o- mini

Snapshot Models

If you notice, the mini model above has a larger max output size than the 4o. You might be wondering why. If 4o is the more intelligent model, why does it have less max output? This is because gpt-4o currently points to an older snapshot model called gpt-4o-2024-05-13. A newer gpt-4o-2024-08-06, with 16k max output tokens like the gpt-4o mini, exists.

The reason behind this is that there are apps in production using the GPT-4o model, and they don’t want those to suddenly break them. OpenAI said they’d give a 3-week notice before updating the GPT-4o model to point to the newer snapshot. Here’s a summary of the snapshot models of gpt-4o and gpt-4o-mini.

Context Window Pricing/1M Output Tokens Pricing/1M Input Tokens Use Case Model 128k tokens $2.50 $5.00 For complex, multi-step tasks. gpt-4o-2024-05-13 128k tokens Max Output 4k tokens 16k tokens Training Data Oct 2023 Oct 2023 $1.25 $2.50 For complex, multi-step tasks. gpt-4o-2024- 08-06 128k tokens $0.075 $0.15 For fast, simpler tasks. pt-4o-mini- 2024-07-18 g 16k tokens Oct 2023

Notice that the newer gpt-4o-2024-08-06 model is half as cheap as the other snapshot model. This shows how model prices go down over time. Imagine paying less for a smarter model in the future, like paying for a 1GB USB drive back in 2001 compared to today, where you pay less but get more storage. :]

While the flagship models are usually sufficient to choose from, older models are still available. This is in case you’re already using the models in production and don’t have time to migrate to newer models immediately. That means, aside from the snapshot models above, there are older snapshot models from previous models. You will get to know them in a later part of this chapter.

To get full information about deprecation dates, check here.

Other Available Models

OpenAI provides models that aren’t just capable of text generation but also vision,

Context Window Pricing/1M Output Tokens Pricing/1M Input Tokens Use Case Model 128k tokens $15.00 $5.00 For research and evaluation, not optimized for production. chatgpt-4o- latest 128k tokens Max Output 16k tokens 4k tokens Training Data Oct 2023 Dec 2023 $30.00 $10.00 Points to g pt-4-turbo- 2024-04-09 gpt-4-turbo 128k tokens $30.00 $10.00 Older flagship, for complex tasks. Has vision. pt-4-turbo- 2024-04-09 g 128k tokens 4k tokens 4k tokens Dec 2023 Dec 2023 $30.00 $10.00 Points to g pt-4-0125- preview gpt-4-turbo-preview 128k tokens $30.00 $10.00 Intended to reduce cases when model doesn’t complete a task. gpt-4-0125- preview 128k tokens 4k tokens 4k tokens Dec 2023 Apr 2023 $30.00 $10.00 Improved instruction following and JSON mode gpt-4-1106- preview 8k tokens $30.00 $10.00 Points to g pt-4-0613 pt-4 g 8k tokens 8k tokens 8k tokens Sep 2023 Sep 2023 $30.00 $10.00 Improved function calling support. gpt-4-0613 16k tokens $1.50 $0.50 Points to g pt-3.5- turbo-0125 gpt-3.5- turbo 16k tokens 4k tokens 4k tokens Sep 2021 Sep 2021 $1.50 $0.50 Older cheap and fast model, is recommended instead since July 2024. GPT-4o-mini gpt-3.5- turbo-0125 16k tokens $1.50 $0.50 Older cheap and fast model, is recommended instead since July 2024. GPT-4o-mini pt-3.5- turbo-1106 g 4k tokens 4k tokens 4k tokens Sep 2021 Sep 2021 $2.00 $1.50 Older cheap and fast model for completion, not chat,is recommended instead since July 2024. GPT-4o-mini gpt-3.5- turbo-instruct

Note that GPT-4 Turbo models have later training data compared to the flagship models. This means they’ll know events that GPT-4o doesn’t. Also note that the cost of some older models is higher than the current flagship, gpt-4o-mini, while having smaller context windows, maximum outputs, and earlier training data dates. Vintage stuff, that was just two years ago.

For more detailed and specific documentation, you can visit OpenAI’s platform documentation here.

Selecting Models

Now that you have an overview of the available models, you should try to understand how to select them. How would you select the best model given the following tasks?

Summarizing Large Text

You’re tasked to summarize a 200-page book or a large amount of text. You would like to be as accurate as possible. You aren’t given other constraints.

First, you can eliminate factors that aren’t part of your goals. For example, cost is not specified as a limiting criterion. Another factor that doesn’t matter is the training data for information. Since the text to summarize is given to you as input, there’s no other time-sensitive information that the model needs to know.

Then, let’s look at the things that might limit your choices. First, the input is a large amount of text. This means you should consider whether it fits your context window. The latest models have 128k tokens in their context window, and that’s around 300 pages. The older models have smaller context windows, so they’re eliminated from the options. That means you could pick from the flagship models. You could choose between gpt-4o and gpt-4o-mini and their snapshots. So far, they meet the criteria.

Lastly, the task requirements stated that you would like to be as accurate as possible. This means you should pick the most intelligent model available. You’re left with gpt-4o and its snapshots.

Since the newer gpt-4o-2024-08-06 snapshot is half the price of gpt-4o at the time of writing. You should pick this snapshot model for this task.

Did you get it right?

Storytelling an Event

Your task is to ask a model to tell you about the Miss Universe 2023 pageant. You want it to name the winner and runners-up.

Since the training data is relevant in this case, that’s the constraint. This event happened in November 2023. That means you should pick a model that has training data after that date. The only ones that fit are the gpt-4-turbo and snapshot models.

See forum comments
Download course materials from Github
Previous: Understanding OpenAI Models - Introduction Next: Understanding OpenAI Models - Demo