Image: Programming, Free Stock Picture,

This is how ChatGPT works

The powerful language model ChatGPT generates texts that can hardly be distinguished from those of human authors. We explain the technology behind the hype.

Image: Programming, Free Stock Picture,

Since the US company OpenAI released its new artificial intelligence (AI) ChatGPT for free testing at the end of November last year, users on social media have been sharing masses of examples of how the chatbot answers knowledge questions, formulates e-mails, writes poems or texts summarizes.

ChatGPT’s ability to confidently deal with natural language and to understand complex relationships with a high hit rate is seen by some observers as another milestone on the way to strong artificial intelligence – i.e. to algorithms that are on a par with human thinking ability in every respect. But how does the technology that makes all this possible work?

Six years – an AI eternity

ChatGPT is a language model, i.e. a machine learning algorithm that specializes in processing texts. ChatGPT is the latest generation in a series of language models based on the so-called Transformer model introduced in 2017. The Transformer architecture caused a stir when it was released in professional circles because it enabled specialized language models for text translation and other tasks with unprecedented power.

As early as 2018, OpenAI published the Generative Pretrained Transformer (GPT) as a modification of the Transformer with a simplified structure (PDF) . A major innovation was the idea of ​​no longer training the language model for a special task such as translation or classification of texts, for which only limited amounts of sample data are often available.

Instead, the GPT model was pre-trained on very large data sets of generic texts in order to learn statistical properties of language as such independently of the specific task. The model prepared in this way could then be effectively adapted with smaller sets of sample data for specific tasks.

The next version GPT-2 appeared in 2019 (PDF) . It was essentially a scaled-up version of the previous model with a significantly higher number of parameters and with training on correspondingly larger data sets. In contrast to the original version, GPT-2 was no longer adapted for special problems, but was able to solve many different tasks such as translating texts or answering knowledge questions simply by training with generic texts from the Internet.

With 175 billion parameters, the third generation GPT-3 (PDF) was even more extensive than GPT-2 and correspondingly more powerful. It also attracted attention beyond the AI ​​research community, particularly with its ability to write longer texts that were almost indistinguishable from those of human authors.

However, limitations of the model also became apparent, including ethical issues with objectionable or biased texts, and the habit of making grossly false statements of fact in persuasive-sounding language.

In order to remedy these shortcomings, OpenAI added a fundamentally new dimension to the training concept for its next language models InstructGPT and ChatGPT : Instead of leaving a model alone with huge amounts of text from the Internet, it was subsequently taught by human “teachers”, concrete ones To follow the instructions of the users and to make statements that are ethically justifiable and correct in terms of content. In order to ensure the effectiveness of this training, the algorithmic approach of the pure transformer model had to be expanded by a further step – the so-called reinforcement learning.

The impressive achievements of ChatGPT are the result of a whole range of different algorithms and methods as well as many tricks, some of which are very small. In this article, the focus is on providing an intuitive basic understanding of the technology without getting bogged down in too many mathematical or technical details. The links in the text refer to sources that fill in the gaps in this presentation.