ChatGPT != Prompt Engineering

Prompt Engineering is different

Disclaimer: The content of this blog are my views and understanding of the topic. I do not intend to demean anything or anyone. I am only trying to share my views on the topic so that you will get a different thought process and angle to look at this topic.

     OpenAI team has released ChatGPT ( Generative Pre-Trained Transformer ). It is a chatting UI for communicating with the GPT model. GPT is a AI model trained by the OpenAI team. The concept of Prompt Engineering and the use cases for that are something different that ChatGPT. We will dive into these points in detail in this blog : GPT Model, OpenAI libraries, Prompt Engineering, ChatGPT

GPT ( Latest Model GPT-4 )

GPT (Generative Pre-Trained Transformer ) is an AI model trained by OpenAI team. The model has the capability to transform text using NLP ( Natural Language Processing ) which enables it to solve complex tasks like code generation, text completion, essay writing, etc. If you see the model has the text transformation capability. The OpenAI team is planning for image inputs in the future. But as far as model is concerned it can only understand the text but not what it means in physical world. For instance if we talk about code completion, model can help you write a code and tell you how to run that by installing required dependencies but it cannot understand the concept of the code execution. But it does understand what the text means when you converse with it. A simple analogy is that of Theoretical physicist and Experimental physicist. So GPT model is like a Theoretical physicist.

Open AI libraries ( link )

Open AI has deployed this model on their servers. One of the ways to communicate with that model is using client libraries which use HTTP communication. Just like any other API Server you need an API key which you can generate from your OpenAI account. The usage calculation is different for these APIs. They have a Pay-As-You-Use model too similar to an AWS instance payment model. This way of communication helps in integrating GPT model into your application. There is a concept of system and user. You can send messages to GPT as system like how the model should respond and what are the constraints applied. Ex: You can create a prompt for model to act like a ordering bot and share the list of items available in the store with their prices. It is a system configuration and specification. In you app whatever user is requesting could be sent to the model as user role message. Now the benefit of this approach is that you can define the constraints for the model such that user cannot ask the bot to perform anything else other than ordering. One more benefit of using this approach of communication is that you can control a parameter called temperature for the model which defines whether model should be more creative or be more focussed. Another benefit is that you can also fine tune the mode and train it. But the pricing for that is different as mentioned here.

Prompt Engineering

Prompt is textual constraints and context setup for the GPT model to behave. In simple terms it is a specification for the model to work on some problem statement. When we communicate with each other we explain some concept with some examples, then ask questions based on that understanding. Prompt engineering is defining this explanation which is more concrete and give best result for a use case. All of us have different ways of learning hence explanation matters. Some people understand better with examples, some with pictures, etc. Hence in EdTech industry we are striving now for personalized learning experience. In our case we have a single model ( i.e. GPT ). Still in prompt engineering it is recommended to understand the models behaviour for creating better prompts. Since GPT-3 model might be having different level of understanding than GPT-4. It is like talking to a less experienced person ( I.e. GPT-3 ) and expert ( i.e. GPT-4 ). I would say prompt engineering is next level of abstraction of programming machines to do our tasks. In this case it is human language with context and constraints. A word of advice for becoming a better prompt engineer is that treat the GPT model as more like human while communicating, explain it the concept and constraint like you will explain to another person.

ChatGPT

Eventually we see what is ChatGPT. ChatGPT as the name suggests is a chatting app built on top of the API based communication with the model. The pros and cons of using ChatGPT over direct API communication is that we cannot train it or change any of its parameters. It can only remember things in a single chat window. Also if you keep discussing with ChatGPT for a longer period and if the total text size is larger than the max tokens then it can forget stuff. In this case you can only use it for single focussed problem solving. It is a great starting point to practice Prompt Engineering or tryout the GPT model. But you cannot deploy it anywhere or integrate it into your product. The usage and pricing for ChatGPT is different from API usage and pricing. So if you purchase a pro version of ChatGPT does not mean you can make many calls to GPT model via the API. However pro version of the ChatGPT is allowing in making many requests without any limit.

Summary

I hope I was able to clear the concepts and their differences and uses. If you want to start learning simple prompt engineering concepts start with ChatGPT but eventually switch to API libraries to integrate it in your product. Also do remember the pricing model for API is different than ChatGPT pro account cost.