What is the difference between OpenAI’s GPT-3.5 Turbo models?

OpenAI API models help users interact with different artificial intelligence models, experiment with their use in multiple tasks, and generate completion and chat responses against user inputs. With the rise of ChatGPT, OpenAI has been working to continuously improve its GPT models to get maximum optimized results from it. GPT-3.5 Turbo model’s capability is understanding and generating natural language and its code for various tasks. It has also been optimized to perform chat completions upon recent modifications and updates.

In this Answer, we’ll discuss the differences in the working of the GPT-3.5 Turbo models.

GPT-3.5 Turbo models

As of March 2024, the models given below are currently active and are used to perform various tasks. The models marked as “Legacy” signal that the models won’t be receiving any updates and will be deprecated to be replaced by newer models. The models marked as “To be deprecated” have an announced deprecation date.

OpenAI GPT-3.5 Turbo models status

Model

Status

gpt-3.5-turbo-0125

Active

gpt-3.5-turbo

Active

gpt-3.5-turbo-1106

Active

gpt-3.5-turbo-instruct

Active

gpt-3.5-turbo-16k

Legacy

gpt-3.5-turbo-0613

To be deprecated (2024-06-13)

gpt-3.5-turbo-16k-0613

To be deprecated (2024-06-13)

Let’s discuss each of these models in detail to highlight their working capabilities.

gpt-3.5-turbo-0125

This model is highly accurate at responding with efficient and more customized responses in the requested formats. It also dealt with previously reported bugs, which highlighted the model’s inefficiency in generating correct text encoding for non-English function calls. The model is trained on the training data up to September 2021 and has a maximum output token of 4K tokens.

gpt-3.5-turbo

The gpt-3.5-turbo model points to the gpt-3.5-turbo-0125 and offers the same capabilities as the model mentioned.

gpt-3.5-turbo-1106

This GPT-3.5 Turbo model has been optimized to maximize the focus on generating more instruction-based responses; it also supports JSON mode and parallel function calling. The format following for JSON, YAML and XML has also been improved. The older version is still accessible using the gpt-3.5-turbo-0613 model, but it has been removed as of June 13, 2024. It offers a 16K context window by default, and the output has the capacity of a maximum of 4K tokens.

gpt-3.5-turbo-instruct

This model has the same capabilities as all of the models used for completions. However, it does not support chat completion models. It offers a 4k context window and was trained on the data from September 2021.

Legacy models

The legacy models offered by the GPT-3.5 Turbo are gpt-3.5-turbo-16k, gpt-3.5-turbo-0613, and gpt-3.5-turbo-16k-0613. Both gpt-3.5-turbo-16k and gpt-3.5-turbo-16k-0613 offer a 16K context window, but the gpt-3.5-turbo-0613 model offers a 4K context window. They all are trained on data from September 2021. These legacy models are still being used. However, they will be deprecated once new and improved models are released.

Use of the models

To execute this, you need an OpenAI account and use its API key.

The models can be used in external programming environments using the OpenAI API. Here, we will use Python to access these models through the API key. For the gpt-3.5-turbo-0125 and gpt-3.5-turbo models, we can set up a chat model to help us extract responses from from.

from openai import OpenAI
import os
os.environ["OPENAI_API_KEY"]
client = OpenAI()
response = client.chat.completions.create(
model="gpt-3.5-turbo", #replace it with "gpt-3.5-turbo-0125"
messages=[
{
"role": "user",
"content": "Translate the following English text to French: 'Hi i am very optimistic'"
}
],
max_tokens=300,
)
print("GPT-3.5-turbo response: ", response.choices[0].message.content)
response = client.chat.completions.create(
model="gpt-3.5-turbo-1106",
messages=[
{
"role": "user",
"content": "Give me an outline for a small blog on GPT"
}
],
max_tokens=400,
)
print("\nGPT-turbo-1106 response: \n", response.choices[0].message.content)

The gpt-3.5-turbo-instruct model is not used for chat completions, so we use this model to take in a prompt and generate a completion against it. See the example below:

from openai import OpenAI
import os
os.environ["OPENAI_API_KEY"]
client = OpenAI()
response = client.completions.create(
model="gpt-3.5-turbo-instruct",
prompt = "Write a function to calculate square of a number in python ",
max_tokens = 300,
)
print(response.choices[0].text)

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved