GPT-4 Everything You Need To Know

Everything You Need To Know about GPT-4

OpenAI has developed a novel model that boasts enhanced abilities in natural language generation and comprehension.

What is GPT-4?

OpenAI’s latest language model is called GPT-4.

GPT stands for Generative Pre-trained Transformer (GPT), a type of language model that uses deep learning to generate human-like, conversational text. 

This new version succeeds GPT 3.5, which was behind the success of the company’s widely popular ChatGPT chatbot upon its debut in November 2022.

GPT-4 is a multimodal model of significant size that can process text and image inputs and generate textual outputs. While it may not surpass human capabilities in various real-world situations, it has demonstrated human-level proficiency in numerous professional and academic benchmarks.

GPT-4 is “multimodal”, which means it can generate content from both image and text prompts.

What can GPT-4 do?

The objective of developing GPT-4 is to enhance the “alignment” of the model, which refers to its capacity to accurately understand and fulfill user intents, while also ensuring that it produces less offensive or dangerous output by being more truthful.

It’s natural to anticipate that GPT-4 would surpass the GPT-3.5 models in terms of providing accurate responses. The occurrence of “hallucinations,” or factual and reasoning mistakes made by the model, has been reduced, with GPT-4 achieving a 40% higher score than GPT-3.5 on OpenAI’s internal benchmark for factual performance.

Additionally, GPT-4 enhances its “steerability” by being able to modify its conduct based on user commands. For instance, users can instruct it to produce content in a distinct style, tone, or voice. An example would be to initiate prompts with phrases such as “You are a garrulous data expert” or “You are a terse data expert” and request it to elucidate a data science concept.

OpenAI evaluated GPT-4 by simulating exams designed for humans, such as the Uniform Bar Examination and LSAT for lawyers, and the SAT for university admission. The results showed that GPT-4 achieved human-level performance on various professional and academic benchmarks.

OpenAI tested GPT-4 on conventional benchmarks for machine learning models, where it surpassed existing large language models and most state-of-the-art models that may have included benchmark-specific techniques or extra training procedures. The evaluations included multiple-choice questions across 57 subjects, everyday event commonsense reasoning, multiple-choice science questions at the grade-school level, among others.

OpenAI also evaluated GPT-4’s performance in various languages by translating the MMLU benchmark, comprising 14,000 multiple-choice questions from 57 subjects, into several languages using Azure Translate. GPT-4 outperformed GPT-3.5 and other large language models in 24 out of 26 languages tested. The more reliable outcomes of GPT-4 indicate a significant advancement in OpenAI’s mission to build AI models with more sophisticated capabilities.

Using Visual Inputs in GPT-4

GPT-4 is a language model that can process both text and image inputs, allowing users to specify various vision or language tasks. It can generate natural language or code outputs based on mixed text and image inputs. And it performs similarly well across different domains, such as documents with text and photographs, diagrams, or screenshots.

GPT-4 also supports test-time techniques, including few-shot and chain-of-thought prompting. However, image inputs are still in the research preview stage and not yet publicly available.

How GPT-4 works

OpenAI didn’t share many details, citing concerns about safety and competition. Like earlier GPT models, GPT-4 is based on the transformer architecture and trained to predict the next token on a mix of public and private datasets. It was fine-tuned using reinforcement learning from human feedback and engineered prompts.

  • OpenAI is remaining silent regarding the specific details of its architecture, which includes size, datasets, training procedures, and processing requirements.
  • According to Brockman, GPT-4 has an internal capacity to process 32,000 tokens at once, which is ten times greater than the estimated token count of ChatGPT. This capability allows GPT-4 to handle longer texts than previous models of similar size.
  • The model accepts image inputs including pages of text, photos, diagrams, and screenshots. (This capability isn’t yet publicly available because the company is still working to speed it up)
  • The model has a novel input known as a system message, which directs it on the appropriate style, tone, and level of detail to use in subsequent interactions. To illustrate, a system message can guide the model to adopt the style of Socrates, prompting users to derive their own solutions through critical thinking.
  • The company offers a new framework, OpenAI Evals, for creating and running benchmarks. It invites everyone to help test the model.

Who are Using GPT-4?

 Several companies are already using GPT-4.

  • The updated Microsoft Bing search, which launched last month, is based on GPT-4
  • OpenAI itself has been using the model for content moderation, sales, customer support, and coding.
  • Stripe uses GPT-4 to scan and write summaries of business websites.
  • Paid subscribers to Duolingo can learn languages by conversing with GPT-4.

What is the difference between GPT-4 and GPT-3.5?

While the contrast between GPT-3.5 and GPT-4 may not be immediately apparent, it becomes more evident when the task complexity reaches a certain threshold. In such cases, GPT-4 demonstrates superior reliability, creativity, and the ability to process much more nuanced instructions compared to GPT-3.5.

The latest version of the large language model has the ability to utilize both text and images as inputs, enabling it to identify and analyze objects in pictures. In contrast, GPT-3.5 is restricted to text prompts only. Furthermore, GPT-4 has the capability to generate responses that exceed 25,000 words, whereas GPT-3.5 is limited to responses of approximately 3,000 words.

The new version of GPT, GPT-4, exhibits a significant improvement in its behavior towards disallowed content. GPT-4 is 82% less likely to respond to such requests compared to its predecessor. Additionally, GPT-4 demonstrates a 40% increase in accuracy in certain factuality tests. Moreover, developers now have the option to choose their AI’s tone and verbosity style.

From GPT-1 to GPT-3 – Tracing the Growth of Language Models

What are Generative Pre-trained Transformers (GPT)?

GPT, which stands for Generative Pre-trained Transformers, refers to a category of deep learning models that are capable of producing text that resembles human writing. These models are commonly employed in a variety of applications, such as

  • answering questions
  • summarizing text
  • translating text to other languages
  • generating code
  • generating blog posts, stories, conversations, and other content types. 

GPT models have limitless uses, and fine-tuning them with specific data can improve their performance. Utilizing transformers can lead to savings in terms of computing, time, and resources.

GPT-1

A paper titled “Improving Language Understanding by Generative Pre-Training” was published by OpenAI in 2018. The paper discussed the use of their GPT-1 language model for natural language understanding. However, the model was only a proof-of-concept and was not made available to the public.

This paper proposed learning a generative language model using unlabeled data and then fine-tuning the model by providing examples of specific downstream tasks like classification, sentiment analysis, textual entailment etc.

Transformer architecture | GPT-1 Paper

GPT-1 was a language model trained using a 12-layer decoder-only transformer architecture with masked self-attention. The model’s structure was similar to the original transformer model, but with masking to ensure that the language model only had access to words before the current word.

GPT-1 was an effective pre-training language model that demonstrated the power of generative pre-training and transfer learning for various NLP tasks with minimal fine-tuning. This success paved the way for further exploration of larger datasets and more parameters to unlock even greater potential.

GPT-2

In the subsequent year, OpenAI released a new research paper titled “Language Models are Unsupervised Multitask Learners,” which showcased their latest model, GPT-2. The model was made accessible to the machine learning community, and it gained some traction for text generation tasks. Although GPT-2 had the ability to generate a few sentences before encountering errors, it was considered state-of-the-art in 2019.

Model performance on various tasks | GPT-2 paper

 GPT-2 had 1.5 billion parameters. which was 10 times more than GPT-1 (117M parameters). The major differences between the two models were as follows:

  • GPT-2 had 48 layers and used 1600-dimensional vectors for word embedding.
  • It utilized a larger vocabulary of 50,257 tokens, employed a larger batch size of 512, and a larger context window of 1024 tokens.
  • Additionally, GPT-2 implemented layer normalization at the input of each sub-block, and included an extra layer normalization after the final self-attention block.
  • Finally, during initialization, the weight of residual layers was scaled by 1/√N, where N was the number of residual layers.

Several datasets of downstream tasks, including reading comprehension, summarization, translation, and question answering, were used to evaluate GPT-2. GPT-2 was able to achieve state-of-the-art results on 7 out of 8 tested language modelling datasets in zero-shot.

GPT-3

OpenAI published a paper in 2020 about their GPT-3 model, which had 100 times more parameters than GPT-2. It was trained on a larger text dataset, resulting in better performance. The GPT-3 model was improved with various iterations, including ChatGPT, which surprised the world with its ability to generate human-like text.

ChatGPT became the fastest-growing web application ever, reaching 100 million users in just two months.

Sizes, architectures, and learning hyper-parameters (batch size in tokens and learning rate) of the models. All models were trained for a total of 300 billion tokens. | GPT-3 paper
Results on three Open-Domain QA tasks taken from GPT-3 paper

The GPT-3 model has 175 billion parameters, 10 times more than Microsoft’s Turing NLG language model and 100 times more than GPT-2.

Due to its extensive training dataset and large capacity, it performs well on NLP tasks in zero-shot and few-shot settings, and is capable of tasks like writing articles and performing on-the-fly tasks it was never explicitly trained on. However, the paper discusses limitations and broader impacts of the model.

GPT-3 was trained on a mix of five different corpora, each having certain weight assigned to it. High quality datasets were sampled more often, and model was trained for more than one epoch on them. The five datasets used were Common Crawl, WebText2, Books1, Books2 and Wikipedia.

The architecture of GPT-3 is same as GPT-2. Few major differences from GPT-2 are:

  • GPT-3 has 96 layers with each layer having 96 attention heads.
  • Size of word embeddings was increased to 12888 for GPT-3 from 1600 for GPT-2.
  • Context window size was increased from 1024 for GPT-2 to 2048 tokens for GPT-3.
  • Adam optimiser was used with β_1=0.9,β_2=0.95 and ε= 10^(-8).
  • Alternating dense and locally banded sparse attention patterns were used.

When was GPT-4 launched?

GPT-4 was unveiled by OpenAI on March 14, 2023, nearly four months after the company launched ChatGPT to the public at the end of November, 2022.

How to Gain Access to GPT-4

ChatGPT is being used by OpenAI to make GPT-4’s text input feature available, which is currently exclusively accessible to ChatGPT Plus users. OpenAI has not yet made the visual input capabilities of GPT-4 available through any platform due to a collaboration with a single partner.

As for the GPT-4 API, there is a waitlist that needs to be joined.

There is a free way to access GPT-4’s text capability and it’s by using Bing Chat.