ChatGPT-4 is here: What’s new compared to GPT-3.5?

Barnacle Goose
6 min readMar 14, 2023

--

The GPT-4 model is here for “Plus” subscribers

The ChatGPT-4 is here

edited: January 21st, 2024
The world of artificial intelligence (AI) and natural language processing (NLP) has been evolving rapidly, with OpenAI’s GPT series leading the way in language model development. GPT-3.5 was a significant milestone that improved upon GPT-3 in terms of understanding and generating human-like text. However, GPT-4 has taken AI language capabilities to new heights, boasting enhanced performance and functionality. This article will explore the major differences between GPT-3.5 and GPT-4, shedding light on the improvements and their impact on the AI landscape.

Size and Complexity

One of the most significant differences between GPT-3.5 and GPT-4 is the size and complexity of the models. GPT-3.5 was already a highly complex model, containing 175 billion parameters. However, GPT-4 pushes the limits of AI language models with an even greater number of parameters (OpenAI refused to comment on the number of parameters used in GPT-4 mode), resulting in a more sophisticated understanding of human language. With the increase in parameters, GPT-4 is capable of more nuanced comprehension and generation of text, which translates to higher-quality responses and more precise predictions. Bot models can now be accessed via ChatGPT API (here is an example or API-based ChatGPT interface).

Improved Context Understanding

GPT-3.5 struggled with understanding context deeply, which sometimes led to inconsistencies in its generated text. GPT-4 addresses this issue by enhancing its context comprehension capabilities, allowing the model to generate more coherent and contextually accurate responses. This improvement is a significant step forward in developing more contextually relevant and coherent AI-generated text.

Longer context. GPT-4 has the ability to manage more than 25,000 words of text, making it suitable for a wide range of applications, including the creation of long-form content, engaging in extended dialogues, and performing search and analysis tasks on documents.

Enhanced Multilingual Capabilities

GPT-3.5 already supported multiple languages, but GPT-4 has significantly improved multilingual capabilities. It is now able to understand and generate text in more languages with better accuracy, making it more versatile and useful for a wider range of applications across the globe. This advancement is particularly significant as it enables AI models to be more globally relevant and effective.

In addition, OpenAI says that: “GPT-4 can accept images as inputs and generate captions, classifications, and analyses”. However, this is likely trough GPT-4 API for which developers need join a waiting list (edited: GPT-4-Vision is now available for both API and ChatGPT plus subscribers).

Image from OpenAI website showing that GPT-4 can accept images and analyse its content but developers need to wait for API
GPT-4 can accept images but developers need to wait for API

Few-shot Learning and Adaptability

Few-shot learning is an important concept in machine learning and AI, particularly in the context of natural language processing (NLP). It refers to the ability of a model to learn new tasks or concepts quickly and efficiently, using only a small number of examples, or “shots.” In contrast, traditional machine learning models often require a large number of examples (i.e., a large dataset) to achieve satisfactory performance. Few-shot learning is essential for building more efficient and adaptable AI systems.

GPT-4’s advancements in few-shot learning and adaptability stem from its architecture and training techniques. The increased number of parameters and enhanced language capabilities make GPT-4 more adept at identifying patterns and generalizing from limited data. This improvement allows developers to leverage GPT-4’s potential in various tasks without needing extensive fine-tuning or large datasets.

Key aspects of few-shot learning and adaptability in GPT-4 include:

Transfer Learning. GPT-4’s ability to transfer knowledge gained during pretraining to new tasks is a crucial aspect of its few-shot learning capabilities. During pretraining, the model learns language patterns, grammar, and semantics by ingesting vast amounts of text data. This process enables GPT-4 to develop a strong foundation that can be fine-tuned with minimal additional data for specific tasks.

Task-agnostic Learning. GPT-4 is designed to be task-agnostic, meaning it can perform various NLP tasks without being explicitly programmed for each one. This flexibility allows GPT-4 to adapt to different tasks using a small number of examples, making it more versatile and efficient.

Prompt Engineering. GPT-4’s few-shot learning capabilities are closely tied to its ability to understand and respond to prompts effectively. Prompt engineering involves crafting input prompts that provide the model with sufficient context and task information. By presenting GPT-4 with a small set of carefully designed prompts, developers can guide the model to generate the desired output for a specific task.

Memory and Attention Mechanisms. GPT-4’s memory and attention mechanisms are essential for its few-shot learning capabilities. These mechanisms enable the model to focus on relevant parts of the input text and retain important information, allowing it to make more accurate predictions based on limited examples.

Examples of Improvements in GPT-4

The improvements in GPT-4 can be seen in its ability to conduct human-like conversations, produce more accurate and concise summaries of text, and generate more accurate code. Its improved understanding of context, advanced language capabilities, and enhanced multilingual support enable it to generate more engaging, coherent, and relevant responses during interactions. Additionally, GPT-4’s ability to generate more accurate code can save developers time and effort, streamlining the coding process across various programming languages.

Let’s consider a simple example of a Python script that retrieves the top headlines from a news API and prints them. Here is the code generated by GPT-3.5 and GPT-4.

GPT-3.5 generated code:

import requests
import json

def get_top_headlines(api_key, country='us'):
url = f'https://newsapi.org/v2/top-headlines?country={country}&apiKey={api_key}'
response = requests.get(url)

if response.status_code == 200:
data = json.loads(response.text)
return data['articles']
else:
print(f'Error {response.status_code}: Failed to fetch news headlines.')
return None

def print_headlines(articles):
for i, article in enumerate(articles):
print(f'{i + 1}. {article["title"]}')

if __name__ == '__main__':
api_key = 'your_api_key_here'
articles = get_top_headlines(api_key)

if articles:
print_headlines(articles)
else:
print('No headlines available.')

GPT-4 generated code:

import requests
import json

API_URL = 'https://newsapi.org/v2/top-headlines'

def get_top_headlines(api_key, country='us'):
params = {'country': country, 'apiKey': api_key}
response = requests.get(API_URL, params=params)

if response.status_code == 200:
data = response.json()
return data['articles']
else:
print(f'Error {response.status_code}: Failed to fetch news headlines.')
return None

def print_headlines(articles):
for i, article in enumerate(articles, start=1):
print(f'{i}. {article["title"]}')

def main():
api_key = 'your_api_key_here'
articles = get_top_headlines(api_key)

if articles:
print_headlines(articles)
else:
print('No headlines available.')

if __name__ == '__main__':
main()

Comparison:

Both versions of code are functional and produce the expected output. However, the GPT-4 generated code has some improvements:

  1. The API_URL is defined as a constant at the beginning, making it more modular and easier to update or modify.
  2. The params dictionary is used to pass the query parameters in the requests.get() function call, making the code more readable.
  3. The response.json() method is used to parse the JSON response, which is more concise than using json.loads(response.text).
  4. The enumerate() function in the print_headlines() function uses the start parameter to start counting from 1, which simplifies the print statement.
  5. The GPT-4 generated code wraps the main logic in a main() function, providing a cleaner separation of concerns.

Overall, the GPT-4 generated code is more readable, modular, and adheres to better programming practices than the GPT-3.5 generated code.

ChatGPT-4 can even make a snake game from scratch with little no-code feedback from me.

Another inspiring example for the use of GPT technology is music composition. It is now possible to create short MIDI tunes with the aid of ChatGPT. The music for the following clip was written by ChatGPT. Another innovating service that employ GPT technology to compose music is MUZIFI.

The Implications of GPT-4 for the AI Landscape

The introduction of GPT-4 marks a significant milestone in the development of AI language models. Its enhanced capabilities in context understanding, multilingual support, few-shot learning, and adaptability demonstrate the rapid progress being made in the field of AI and NLP. These advancements have significant implications for the AI landscape, making AI language models more globally relevant, adaptable, and capable of generating contextually relevant and coherent text. As AI continues to evolve, it will be exciting to see the further advancements that are made in this field.

--

--