Introduction to ChatGPT

In 2020, OpenAI introduced GPT-3 and it set new heights in NLP with its incredible performance. Despite this, GPT-3 still had its limitations, especially the criticism it faced for biased generation. This led OpenAI to improve it to GPT-3.5 (and subsequently GPT-4).

Interface

ChatGPT uses a simple, traditional Yahoo! messenger-like interface (without a sidebar of contacts) where we can type the queries and it will chat with us.

ChatGPT uses a simple interface and comes with some pointers
ChatGPT uses a simple interface and comes with some pointers

Testing ChatGPT

Programming

Here is an example of asking ChatGPT to write a simple function in Python.

ChatGPT writes the code and also explains it
ChatGPT writes the code and also explains it
ChatGPT will also provide us with the complete code
ChatGPT will also provide us with the complete code

Now, let's try some machine learning code.

It can even write intermediate-level code with a high-level of performance
It can even write intermediate-level code with a high-level of performance

The code is copied below as a reference to verify if it works or not.

import torch
# Define the number of neurons in each layer
num_neurons = [2, 3, 4, 2]
# Define the activation function for each layer
activations = [torch.nn.ReLU(), torch.nn.ReLU(), torch.nn.ReLU(), torch.nn.Sigmoid()]
# Create the layers of the neural network
layers = []
for i in range(len(num_neurons)):
# Create a linear layer with the specified number of neurons
linear_layer = torch.nn.Linear(num_neurons[i], num_neurons[i+1])
# Add the activation function for this layer
activation_layer = activations[i]
# Add the linear and activation layers to the list of layers
layers.append((linear_layer, activation_layer))
# Create the neural network
model = torch.nn.Sequential(*layers)

Now, let's ask it a more complex question.

ChatGPT is smart at updating the existing code snippet
ChatGPT is smart at updating the existing code snippet

The complete code is as follows.

import torch
# Define the number of neurons in each layer
num_neurons = [2, 3, 4, 2]
# Define the activation function for each layer
activations = [torch.nn.ReLU(), torch.nn.ReLU(), torch.nn.ReLU(), torch.nn.Sigmoid()]
# Create the layers of the neural network
layers = []
for i in range(len(num_neurons)):
# Create a linear layer with the specified number of neurons
linear_layer = torch.nn.Linear(num_neurons[i], num_neurons[i+1])
# Add the activation function for this layer
activation_layer = activations[i]
# If this is the second or third layer, add a dropout layer and a batch normalization layer
if i == 1 or i == 2:
dropout_layer = torch.nn.Dropout(p=0.3)
batchnorm_layer = torch.nn.BatchNorm1d(num_neurons[i+1])
# Add the dropout and batch normalization layers to the list of layers
layers.append((linear_layer, dropout_layer, batchnorm_layer, activation_layer))
else:
# Add the linear and activation layers to the list of layers
layers.append((linear_layer, activation_layer))
# Create the neural network
model = torch.nn.Sequential(*layers)

However, can it answer non-programming answers and make day-to-day conversation as well? To check this, we conducted a detailed interview in which ChatGPT answered our queries. For ease of reading, the queries have been divided into categories.

History

Going by the maxim, "If you don't know history, then you don't know anything," we tested some history queries.

ChatGPT knows quite a bit about American history
ChatGPT knows quite a bit about American history

Let's try some more queries.

ChatGPT surprisingly didn't have much information regarding FIFA
ChatGPT surprisingly didn't have much information regarding FIFA

Weather/Geography

Let's talk about the weather with ChatGPT.

ChatGPT's detailed explanations can come very handy at times
ChatGPT's detailed explanations can come very handy at times

Let's try a followup question.

ChatGPT also appears to know quite a bit about geography
ChatGPT also appears to know quite a bit about geography

Let's ask another query.

Not only does ChatGPT fail at some queries at times, but also provides reasons for it
Not only does ChatGPT fail at some queries at times, but also provides reasons for it

Arithmetic

Let's see if it can perform quantitative analysis.

ChatGPT can perform quantitative arithmetic
ChatGPT can perform quantitative arithmetic

Let's present it with a slightly more complex query.

ChatGPT seems well-versed in the science behind numbers as well
ChatGPT seems well-versed in the science behind numbers as well

Let's make this query more complex.

ChatGPT surprisingly failed to recall a primary school fact
ChatGPT surprisingly failed to recall a primary school fact

Maybe there was some issue with the query's phrasing, so let's make it easier.

ChatGPT is also adamant over 2 not being a prime number
ChatGPT is also adamant over 2 not being a prime number

Note: Feel free to refer to the original blog post for a much more detailed Turing test for ChatGPT.

Conclusion

As we have seen, ChatGPT is amazing, and it's hard to get tired of it. However, this is just the tip of the iceberg with regards to its capabilities. Here are some of its patterns that we have observed so far.

  • Its performance is usually superb for many tasks, not limited to code generation.

  • When it fails, it's often for trivial tasks.

  • Instead of providing to-the-point answers, it gives very detailed information.

  • It can become a great tool if combined with human intelligence, but, on the other hand, it can also become a tool for spreading a lot of misinformation.

Free Resources

Attributions:
  1. undefined by undefined
Copyright ©2024 Educative, Inc. All rights reserved