How ChatGPT works?
San Francisco-based OpenAI craeted the ChatGPT chatbot, available for free public testing on Nov 30, 2022 . A chatbot is a software application designed to mimic human-like conversation based on user prompts.
Within a week of ChatGPT being unveiled, over a million users had tried to make the tool talk, according to Sam Altman, co-founder and CEO of OpenAI.
Who built ChatGPT?
ChatGPT is the brainchild of OpenAI, an artificial intelligence research company. Its mission is to develop a "safe and beneficial" artificial general intelligence system or to help others do so.
It's made splashes before, first with GPT-3, which can generate text that can sound like a human wrote it, and then DALL-E, which creates what's now called "generative art" based on text prompts you type in.
GPT-3, and the GPT 3.5 update on which ChatGPT is based, are examples of AI technology called large language models. They're trained to create text based on what they've seen, and they can be trained automatically -- typically with huge quantities of computer power over a period of weeks. For example, the training process can find a random paragraph of text, delete a few words, ask the AI to fill in the blanks, compare the result to the original and then reward the AI system for coming as close as possible. Repeating over and over can lead to a sophisticated ability to generate text.
How OpenAI's ChatGPT Works?
According to OpenAI their ChatGPT model, trained using a machine learning technique called Reinforcement Learning from Human Feedback also called as (RLHF), it can imitate dialogue, and give answers to follow-up questions, and accepts mistakes, challenge incorrect statement and reject inappropriate questions and bad language.
Initial development involved human AI trainers providing the model with conversations and played sides – the human user and an artificial intelligence assistant. The version of the bot available for public testing attempts to understand questions posed by users and responds with in-depth answers resembling human-written text in a conversational format.
For example, you can ask it encyclopedia questions like, "Thermodynamics Law." You can tell it, "Tell me funny joke," and when it does, say, "Now make it funnier." You ask it to write a computer program that'll show you all the different ways you can arrange the letters of a word.
We must understand one rule, ChatGPT doesn't have any knowledge on topic been discussed. It's an AI that's trained to recognize patterns in vast swaths of text harvested from the internet, then further trained with human assistance to deliver more useful, better dialog. The answers you get may sound plausible and even authoritative, but they might well be entirely wrong.
Is ChatGPT free?
Yes, for now. OpenAI CEO Sam Altman warned on Sunday, "We will have to monetize it somehow at some point; the compute costs are eye-watering." OpenAI charges for DALL-E art once you exceed a basic free level of usage.
But OpenAI seems to have found some customers, likely for its GPT tools. It's told potential investors OpenAI expects $200 million in revenue in 2023 and $1 billion in 2024, according to Reuters.
Follow the given steps to understand API model of ChatGPT
Go to openai.com website
Create a account for yourself
Enter an instruction or select a pre-set, and watch the API respond with a completion that attempts to match the context or pattern you provided.
You can control which model completes your request by changing the model.
KEEP IN MIND Use good judgment when sharing outputs, and attribute them to your name or company. Learn more.
Requests submitted to our models may be used to train and improve future models. Learn more.
Our default models' training data cuts off in 2021, so they may not have knowledge of current events.
Get the code in desired format
Using API on postman
Method POST
URL : https://api.openai.com/v1/completions
Param: None
Authorisation: Inherit
Header: Authorization : (value from OpenAI account)
Body : RAW (Format json)
{
"model": "text-davinci-003",
"prompt": "What is gravity",
"temperature": 0.7,
"max_tokens": 3000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0
}
Response
{
"id": "cmpl-6Sgdmzu8z8lAIevKmAi19N6rWCP7G",
"object": "text_completion",
"created": 1672295114,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nGravity is an invisible force that pulls objects towards one another. It is the force that holds us to the Earth and keeps the planets in orbit around the Sun. Gravity is one of the four fundamental forces in the Universe, along with the electromagnetic force, the weak nuclear force, and the strong nuclear force.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 3,
"completion_tokens": 64,
"total_tokens": 67
}
}
Data from ChatGPT is captured from field as shown below
"choices": [
{
"text": "\n\nGravity is an invisible force that pulls objects towards one another. It is the force that holds us to the Earth and keeps the planets in orbit around the Sun. Gravity is one of the four fundamental forces in the Universe, along with the electromagnetic force, the weak nuclear force, and the strong nuclear force.",
To understand more about chatbot kindly refer to my other blogs
https://smartpanda.ai/post/what-is-a-chatbot
https://smartpanda.ai/post/chatbots-exploring-healthcare