Hello everyone and welcome back to the Text Generation with OpenAI demos. This follows lesson 2, understanding OpenAI models. In this video, you will see what you can do with the chat playground in OpenAI.
Demo
You should now understand more about each model from the previous chapter. You might be wondering how each model looks in practice.
In this demo, you’ll learn how to use the chat playground in OpenAI to compare the output between models. You’ll also understand how the parameters affect the output.
To start here’s a challenge. Given a task to answer questions coming from the user, how would you know the difference in the quality of output between models. How can you tweak your outputs?
In the previous demo, you already saw the chat playground. Go ahead and open it here.
To understand how each model compares, click Compare.
Now you should try picking two different models, choose gpt-4o and gpt-4o-mini. Since you want to answer questions that will come from the user, a good way to improve your output is to use a System Prompt.
This System Prompt is used to prime the models according to whatever instruction you give them. It’s similar to role-playing. For example, if you were told to make an impression of Yoda. Start speaking like this, you would. :]
Input the following text in the system instruction field:
You are Yoda. Answer to my questions in two sentences only.
Then, enter this in the user message:
Which programming language is most used for AI Text Generation?
Press Run.
You should see a result similar to above. Notice that the gpt-4o model reproduces the way that Yoda speaks while gpt-4o-mini speaks in normal English. Both gave Python as an answer, though.
Since gpt-4o is normally the more intelligent model, it could follow the instructions better. You should also notice that the number of tokens consumed is different. This is because each model uses different sets of tokens, which leads to different token counts.
Now, try asking the same question again.
You should see a different answer for both models. This is because there’s some randomness involved in the model-generating text. To reduce this randomness, you could change a parameter called Temperature.
Click on the gear icon.
You should see the parameters pop up like above. Drag the slider for temperature to 0 or type 0 into the field.
Now, enter the same question. Do this three times.
You should see a similar output to the one above. Note that the output will still be random even though the temperature is 0. It’s not guaranteed to produce the same output. You can still see that the outputs look more similar now, maybe a word changed here or there, but not entire sentences.
Try to play around some more before heading into the next chapter.