Artificial intelligence can do some amazing (and sometimes not so amazing) things. But how does it work? This page explains how text and images are produced by AI.
How does an AI tool generate text?
Tools that generate text are a type of AI called a ‘large language model’ (LLM). They have this name because they are large, very complex computer programs that are fed billions of words of text (a process called ‘training’) until they become good at understanding the patterns of language—not only grammatical patterns, but also which words and phrases are related to each other and how they tend to appear together in a text.
When you ask one of these tools a question, it analyses your question and tries to answer you based on the patterns it knows. These generative-text tools are based on statistical models of language patterns, so as they write your answer, they are continually analysing probabilities to guess which word or phrase is most likely to appear next in a piece of clear and coherent writing.
It’s important to understand that LLMs are not search engines. While they can make it sound like they have all the answers because they’re so good at writing convincing language, they don’t actually ‘know’ anything. They are simply writing the most reasonable response based on probability. This is why they don’t always provide accurate information, and why some tools are unable to provide sources for the ideas in their writing.
How does an AI tool generate an image?
Like generative-text tools, AI tools that create images based on a text description are trained on very large sets of data until they’ve learned what patterns make an image look realistic—for example, the usage of colour, texture and lighting, and the way objects are arranged—as well as what text descriptions match different types of images.
Image generating tools can create art in different styles because of the large number of images they’ve already analysed. Just like generative-text tools, they sometimes produce strange results because they do not understand anything about what the real world actually looks like—they are simply mimicking the visual patterns of millions of other images. It should be noted that in many cases, artists have not been consulted before their work was used to train these tools, leading to ethical concerns.