ChatGPT

ChatGPT

ChatGPT (Chat Generative Pre-Trained Transformer) is an artificial intelligence chatbot application developed in 2022 by OpenAI that specializes in dialogue

The chatbot is a language model fine-tuned with both supervised and reinforcement learning techniques

It is composed of the GPT-4 and GPT-3.5 models from OpenAI

Transformers y GPT

The Transformers architecture (proposed by Google in 2017, Attention Is All You Need) has allowed the development of LLM (large language model) models, systems capable of recognizing and generating natural language based on Deep Learning

Based on the Transformers architecture, GPT and GPT 2 were published with open source licenses, from here on (GPT 3. GPT4...) OpenAI offers access to its models through a paid API

The base version, GPT is trained to provide the best possible continuation of a text

New versions are trained on this base model so that the model responds as a person would based on the instructions given to it: this is how ChatGPT appears

There is not much official information about ChatGPT specifications as of version 3, but we can find some clues about GPT3 and GPT4:

  • GPT 3 (released in 2020):
    It is a model with 175,000 million parameters

    For training, about 34 days are needed on 1024 NVIDIA A100 GPU cards

    In 2021, simply running a single training of that magnitude on a provider like Google Cloud or AWS cost about $2.5M

  • GPT 4 (released in 2022):
    It is a model with more than 1 billion (European) parameters

    More than 10,000 NVIDIA GPUs would be used for training

    To make an inference (for example answer a question we ask) 7 GPUs would be used

    The cost of his training was over $100M

Versions

ChatGPT

It is the free version of the application, it uses GPT 3.5

This is a version of GPT trained to follow instructions

In addition, rules are included to prevent ChatGPT from generating controversial content (for example, denying climate change or making racist comments)

These cases are easily recognizable, ChatGPT's response usually begins with the message "As artificial intelligence,..." followed by some type of excuse before giving a more or less generic response

Currently accessible via web interface or API (to integrate into other systems/applications)

It is necessary to create a user on the platform openai.com to be able to test it

ChatGPT Plus

In addition to the free version, OpenAI offers a paid version with some additional features:

  • Subscription cost $20/month
  • Access to ChatGPT 4 model (compared to GPT 3.5 in free version)
  • Additional functionality:
    • Web navegation
    • Advanced data analysis (formerly Code Interpreter)
    • Dalle-3
    • Creation and access to “GPTs”, configurable with our own data/instructions
    • Priority access during Access peaks
    • Access to beta features (Plugins)
    • 4k contexts

Access to GPT version 4 may be subject to restrictions (IP geolocation restrictions or those that OpenAI considers appropriate apply)

ChatGPT Enterprise

In September 2023 OpenAI published a subscription Enterprise with the following characteristics:

  • Your company data is not used to train OpenAI models
  • Conversation encryption
  • Company user management, advanced statistics
  • No usage limitations in GPT4
  • Running GPT4 at faster speed (2x)
  • 32k contexts instead of 4k

Using ChatGPT

Account creation

Before being able to use ChatGPT it is necessary to have a registered account in the OpenAI system

For this we will use the following registration link

We will enter our email and a password

We will go to our email account, which must be valid and real

And we will confirm the account registration by clicking on the verification email that they will send us

We will continue entering the rest of the user data requested in the form

And now we can start using the ChatGPT promt command chat as long as we log in with the username and password of the account we have created

Privacy

Special care must be taken when using ChatGPT

By default our conversations are stored in a history and can be used to continue training ChatGPT

If we do not want our data to be used for training, there is an option in our account settings to disable the use of our data to train ChatGPT (and conversation history)

Detailed instructions can be found in the OpenAI documentation

PROMP

ChatGPT is trained to follow and execute the instructions we provide to it

Our instructions are called prompts

They can be as simple or complex as we want, and can include additional information

For example, an example text, an image, a link to a web page...

We can “talk” with ChatGPT interactively

For example, asking you to complete or correct your previous answer

That means we can ask him something, and then refer to either our previous question or his answer:

Effective PROMPS

ChatGPT is quite literal in interpreting our instructions, so it is important that we give it all the information necessary to complete its tasks according to our expectations

Overall, a good prompt must include:

  1. Role: for ChatGPT (expert in…, assistant of…)
  2. Context: the situation relative to the text we have to generate
  3. Instructions/tasks: What we need ChatGPT to do for us
  4. Format/style: if we want a formal letter, more modern, aggressive style... or if we need the response to be formatted in JSON for example

You can even ask ChatGPT itself to give you more advice

We can consult in this link a complete list of examples

These prompts are in English, but remember that you can ask ChatGPT to translate them into your language

The openAI documentation also provides some advice

Examples

Fairy tale

Let's lose him to Write a fairy tale with a happy ending

We ask you to modify the ending of the story for a sadder one

We ask you to generate a moral to the story

Finally we ask you to generate the story but with Hansel and Gretel, encountering a dragon and a fairy godmother giving them advice to defeat it

Letter

We are going to pretend that we are an employee of the General Directorate of Public Works using ChatGPT to help you in your daily life

We ask you to generate a letter to inform a user that a pipeline is going to be carried out that will pass through their property

We ask that you generate a second letter informing the user that their request to stop the work has been rejected

What can you do

There are many things that ChatGPT can do very well, just ask it

Below we present some examples of applications:

Creative tasks

  • Generate fictional stories
  • Generate technical documentation (if we provide you with enough information)
  • Texts for project proposals
  • Reports
  • Letters
  • Brainstorming: Product names, titles of works...

Training

  • Create text summaries
  • Generate activities, test-type exercises
  • Plan classes
  • Generate agendas
  • Code

Proofreading

  • Review texts to correct grammar and spelling
  • Change style:
    • Depending on the audience (for a high school student, for a scientist...)
    • Depending on ChatGPT's role (“speaks with the style and vocabulary of a college literature teacher/high school student…”)

Translation

  • ChatGPT has been trained with a corpus that includes a large number of idioms and we can ask you to translate from/to them

    It is advisable that after making a translation, we ask ChatGPT to review the text, correct literal translations and adjust the style and language to our audience

  • You also know a large number of programming languages ​​and we can ask you to transform code from one language to another
  • We can also ask you to transform file formats (for example, data from csv format to json)

Code

  • Code generation following instructions

    We can specify whether we need type annotations (for example in Python) or unit tests

  • Code validation
  • Function Explanation
  • Refactoring: using another library, changing variable names...

Reasoning

We can present problems, challenges and complex questions to ChatGPT based on well-specified assumptions and facts

To resolve it, the following promting techniques can be performed:

In the next link You can find these techniques with more details about them and also some more complex techniques

IO (Direct Input/Output)

It is the most basic method, it consists of asking ChatGPT directly for the answer to our problem

It works correctly with simple problems, but will fail on complex problems

Although with the latest training ChatGPT has learned to reason in steps even if we do not ask it explicitly, and in many cases it will generate the correct answer without needing additional help

IO with refinement

A method that provides good results: we ask ChatGPT to answer our problem

And then in successive prompts we ask ChatGPT to review and improve its response

CoT (Chain of Thoughts)

We can explicitly ask ChatGPT to reason about each stage of the process, or show it an example with that reasoning for it to repeat

CoT-SC (Chain of Thoughts – Self Consistency)

We will perform Chain-of-thought reasoning several times, and then we will select the most repeated answer (the most consistent between the different executions)

Tree-of-thoughts

We generate a prompt that allows ChatGPT to explore different avenues of thought critically, until finding a satisfactory solution

Limitations

Most limitations can be resolved by using plugins (currently available in version ChatGPT Plus or ChatGPT Enterprise)

But it is important to know them to avoid “surprises” when using ChatGPT

Provide complex answers if we do not give them time to reason

If we ask ChatGPT to answer a complex question, ChatGPT will try to answer it in small steps

The output of each step serves as support for the following reasoning, and greatly improves your results

For example we ask you:

Now we ask you, letting you “think”:

When we have let him “think”, the result has been much better

Complex mathematical operations

For example, multiplying numbers with more than 3 digits

ChatGPT's response will usually be close to the correct value (in this case 553,254), but it will not be exact

For example, operations with large square roots

The solution will be close to the correct value (in this case 44.988887516807970076138159027823), but it will not be exact

In seemingly simple arithmetic operations, we will begin to see effects with relatively large numbers

For example, we will probably get the correct answer for the value of 3 cubed but not for 333 cubed

Once you have given us an answer, if we do not correct you, you will accept that result as good, and it is quite likely that ChatGPT will reuse it in subsequent answers about the same operation

This limitation can be solved using the plugin WolframAlpha

A plugin that is specialized in mathematical operations

Provide or verify factual information

When we ask you for factual information, you do not have to answer us with reality

Even if it claims otherwise, it cannot verify whether the information is true or not with certainty

You also cannot give us the source of your data (it is not something supported by the algorithm)

For example, we are going to ask you about the equestrian monument to Espartero, but we want information about the one in Logroño, since there are several in Spain

We insist that we want the one from Logroño

We politely ask you to list us if there are more in Spain

This limitation can be solved by using the navigation integrated into ChatGPT and plugins that allow you to access databases, web pages, scientific articles...

For example, plugins: WebPilot, World Bank Data, WolframAlpha, ScholarAI

Access to updated information

The training corpus varies over time, but is static at any given time

For example, in September 2023, a corpus is used that reaches September 2021 for GPT3.5, and January 2022 for GPT-4

Let's try to ask him on April 7, 2024, when Akira Toriyama died

On the date of April 7, 2024, you have not been able to respond to me when Akira Toriyama passed away (which was on March 1, 2024 at the age of 68)

This limitation can be solved with ChatGPT4 and your web browsing

Or the same plugins as the previous one: WebPilot, World Bank Data, WolframAlpha, ScholarAI…

Know what date and time we are at

Recently the GPT 3.5 model has started to respond to us with the correct date, probably because OpenAI includes that information in a text prior to our prompts

ChatGPT 4, however, still cannot respond to us (although sometimes it can)

ChatGPT presents erratic behavior in this sense, sometimes it answers, sometimes it says that it does not have that information, and sometimes it gives us the wrong date

Let's try to ask you on April 7, 2024, what time is it?

This limitation can be solved for example with the plugin WolframAlpha

Access to information about ChatGPT itself

ChatGPT does not know its current version, the value of its configuration parameters, etc.

As with factual data, sometimes ChatGPT may respond to us as if it knows the answer, but we cannot trust it to be true

This limitation can be solved with the navigation capabilities of ChatGPT4

Or with one of the plugins, such as WebPilot

Advanced data analysis

The Advanced Data Analysis module (currently integrated into the GTP-4 model, with ChatGPT plus subscription) can generate and execute code Python

For example, to analyze a set of data from a file in .xls format

Once the data is loaded, we can ask ChatGPT to perform the typical tasks of a Machine Learning flow

  • Set a summary of loaded variables
  • Analyze relationships between them
  • Identify variables with problems (null values, outliers...)
  • Perform graphic and statistical analyzes (histograms, mean/median/standard deviation values, correlation coefficients...)
  • Predictive models
  • Cluster analysis
  • Generation of complex visualizations (for example, generating maps…)

These actions may be limited by the characteristics of the execution environment

Since we can easily receive messages that the system has run out of memory

Everything will depend on the volume of data and the complexity of the analysis we want it to perform

Plugins

They are available with a subscription to ChatGPT plus

More than 900 plugins in September 2023

Currently it is only possible to select 3 active plugins during a query

When we write a prompt, ChatGPT will decide if it can rely on any of those 3 active plugins to answer our question

Capabilities offered:

  • Access to data sources updated in real time (flight information, statistical information, scientific articles...)
  • Mathematical calculation and programming capabilities (arithmetic operations, numerical analysis, optimizations, scripts Python)
  • Graphic capabilities (generation of QRs, diagrams, images) Analysis of files (pdfs, images...)
  • Access to services (hotel reservations, restaurants, travel)
  • Generation of specific content (improvement of prompts, horoscopes, children's books...)
  • And almost anything the plugin developers can think of

WolframAlpha

It is one of the most powerful plugins

It will connect to the WolframAlpha engine, which is used by Wolfram Mathematica

Mathematica It is a program used in scientific, engineering, mathematical and computational areas

It was originally conceived by Stephen Wolfram, who remains the leader of the group of mathematicians and programmers developing the product in Wolfram Research, company located in Champaign, Illinois

Commonly considered a computer algebra system, Mathematica It is also a powerful general purpose programming language

We can use WolframAlpha to:

  • Solve mathematical problems (from algebraic operations to solving differential equations and optimization problems)
  • Generate graphs and visualizations, including maps
  • Solve physics problems
  • Access databases with information on distances, roads, towns, etc.
  • Retrieve date and time information in real time

With this plugin problems with complex mathematical operations are solved

Returning precise results and with the decimal precision that we indicate (in Wolfram language code, since thanks to the plugin it is able to understand, generate and execute it)

Issues with real-time dates and time are also resolved

Therefore, a good practice when using this plugin is:

  • If ChatGPT responds to us with Mathematica code (the Wolfram language), we will ask you to run that code directly
  • If ChatGPT responds to us with code in another language, we will ask you for the code using WolframAlpha and then ask you to run it

The main limitation of this plugin is calculation time

If we ask for a task that is too complex, it is possible that it will return a “timeout” error and we will not get any response

On the page of Wolfram we find spectacular examples of its possibilities

WebPilot

When activated, ChatGPT will become a search engine, since the prompts will be able to search the Internet

If we say for example Search on wikipedia... or Recover from the internet…

ChatGPT can concatenate multiple queries when WebPilot is active, if necessary within the same response

For example, if we ask him to retrieve information from Wikipedia about Classical Greece and the Roman Empire, cross-referencing both information

Scholarassist

Connected to the repository of scientific articles arxiv It will allow us to recover information about scientific research on physics, mathematics, computer science, biology, medicine, etc.

AskYourPDF/Link Reader/Ai PDF

Any of these plugins (among others, since the list of similar plugins is very extensive) will make ChatGPT able to read the content of a file in PDF format

Link Reader also supports other formats (based on the Microsoft Office office platform) such as PowerPoint, Excel, etc.

We can pass the URL of the file in our propmt and then ChatGPT will be able to answer our questions based on its content

Sometimes, if we have WebPilot and AskYourPDF installed

ChatGPT will use WebPilot to retrieve the contents of the PDF file automatically and then use AskYourPDF to analyze it

Wordcloud

Through this plugin we can generate word cloud graphs to graphically display the content of a text

Combined with any of the previous plugins, it will allow us to generate word cloud graphics from the results of an Internet search, a scientific article, a PDF file...

Show Me Diagrams

ChatGPT is now capable of generating diagrams using the notation Mermaid by itself

But thanks to this plugin we can also view them in the ChatGPT response itself

Canva

The popular application Canva It also has its own plugin, and it will allow us to automatically recover some of the templates it has and then edit them on its platform

Prompt perfect

Add the word “perfect” to your prompts

Prompt Perfect will refine your request so that you get the best possible result from ChatGPT

We must be validated with a username and password for it to work

Stories

Allows you to generate stories, in book format, with incorporated illustrations

Currently only available in English

There’s an AI for that

Website search engine specialized in websites that allow you to solve your problems through AI

Debugging with plugins

If ChatGPT, using a plugin, does not achieve the desired result

We can check both the information that ChatGPT has passed to said plugin and the information that the plugin has returned

If we click on the little down arrow that appears next to the name of each plugin that has been used in the query