ChatGPT explained

Rohit Raj
6 min readJan 30, 2023

How does it learn and how intelligent it can be

Everyone knows about ChatGPT. Some of the answers it gives seem downright magical. It can compose poetry, and write stories and brilliant opinions. The list of its capabilities is endless from that of a coder to that of a counselor.

People are predicting that it will replace google search and cause large-scale unemployment.

But how intelligent it is. How much more intelligent it can be.

Let us first understand what it is and how it learns.

ChatGPT based on Open Research

ChatGPT is based on version 3.5 of GPT model of OpenAI. GPT stands for Generative Pre-Trained Transformer. It is based on Attention network architecture which was introduced in 2017 paper by the Google team.

https://arxiv.org/abs/1706.03762

OpenAI has previously published scientific research on its previous GPT versions. As recently as in 2020, they published a research paper on GPT version 3 detailing its capability and architecture.

ChatGPT is based on open research done by multiple teams across multiple companies including Google. So Google can make a chatbot like Chatgpt but it will severely hinder their ability to serve ads to you.

Training of ChatGPT

Andrew Karpathy, former head of Artificial Intelligence at Tesla and one of the founding members of OpenAI, has published a GitHub repository of the implementation of a mini version of GPT models.

ChatGPT is based on transformer network architecture. It consists of an encoder and a decoder, consisting of multiple layers of self-attention and feed-forward neural networks. The encoder takes in the input text and generates a set of hidden states that capture the meaning of the input. The decoder then uses these hidden states to generate the output text, one word at a time.

Transformer network architecture allows language models to train larger models with increasing accuracy.

ChatGPT is trained on a dataset of billions of words, mostly from the internet, including websites, books, articles, and more. The training data is diverse and includes a wide range of topics and styles, such as news articles, Wikipedia pages, forums, and social media posts. The model is trained to predict the next word in a sequence of text, given the previous words, so it learns to generate text that is coherent and grammatically correct, as well as semantically meaningful. The training process involves adjusting the model’s parameters so that it can generate text that is similar to the text in the training dataset

In GPT 3 it was observed that model was prone to hallucinating and inventing new stuff. Since training did not distinguish facts from fiction.

If you had given Gpt 3 prompt of how Columbus discovered Germany. The model would have just invented new facts and theories

Since it was trained to predict the next word of text, GPT3 cannot care for the truth. To solve this problem OpenAI took human-labeled output data from GPT and fed this into new models, using a reward function to train the future models to behave with less hallucination.

Further to make it better suited to the function of a chatbot, ChatGPT is fine-tuned on a dataset of question-answer pairs. During this fine-tuning process, the model learns to understand the meaning of the question and generate a coherent and semantically meaningful answer.

ChatGPT Behavior

Almost all training of ChatGPT has been done on unsupervised data where the model learns to predict the next word in training data. It has not been told the meaning of words or the relationships between them.

All words exist only as a list of numbers in the model of ChatGPT. During training, it learns number representations of words. And it learns the values of the parameters of the model, which will lead the output of the model to match the expected output.

It is trained to reproduce its input as output. Just by doing this, it is able to combine different concepts and make logical arguments. For example, see its answer to my hypothetical question

It is able to combine concepts of different topics to provide an intelligent response.

But it is not intelligent in a similar manner as humans. Ask it basic maths it fumbles

21342/103 is 207.20 but it resorts to approximation. ChatGPT network architecture cannot handle mathematics very well.

Further, in the case of law, it can often misquote sections. ChatGPT is good at understanding relationships. It does not remember bare facts very well. The size of the model is thousands of times smaller than the data.

And where it is matter of opinion. Its opinions are just reflection of most popular opinions. For example, if I ask it to write a review of Avatar. Then it will praise the movie as it is the consensus among people.

If I had asked it to write a critical review of Avatar. It would have done that too

In both cases, it is not thinking itself. It is sampling opinions about Avatar from its training data. If we ask positive or negative opinions it will provide a similar opinion.

Most of extreme liberal slant in its results are due to OpenAI constraints. Left to itself it would provide most racist and offensive answers.

Conclusion

ChatGPT does not have intelligence but does give a brilliant impression of being intelligent like a B school graduate.

It is based on version 3.5 of the GPT model. Version 3 of the GPT model was available as an API for quite some time but the public was not aware of the capabilities of the model.

It is not the final version of the GPT model. Machine Learning research keeps improving network architecture and ways of model training. Already it is expected that GPT-4 would be a much larger model than GPT-3.

The GPT model is not expected to develop general intelligence. It cannot think on its own or have feelings or opinions. It just learns relationship between words and based on the training data creates most likely output for the input.

It has a surface-level understanding of almost everything in the world. Unless you are expert in a particular topic, it is very difficult to find fault in its answers.

As the model improves blindspots of the model will keep on diminishing. Further it may be possible for OpenAI to fine-tune the model for a specific dataset. If a large law firm wants to use ChatGPT as a legal advisor, OpenAI can fine-tune the model on dataset of legal documents. It will certainly make much less mistakes.

Currently, OpenAI permits fine-tuning of GPT-3 models. They will most likely permit fine-tuning of ChatGPT models too.

With its current network architecture ChatGPT model and its successor will become better and better at generating responses to prompts. It will likely help companies in automating most of low level jobs.

But to develop general intelligence will require breakthrough in network architecture.

ChatGPT based models cannot create new insights. It cannot reason in the way humans do.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rohit Raj
Rohit Raj

Written by Rohit Raj

Studied at IIT Madras and IIM Indore. Love Data Science

Responses (1)

Write a response