top of page

How Does Generative AI Work?

Updated: Nov 7, 2023

It helps to know how AI tools work to get the most out of them. So, let’s get into the basics of the technology behind generative AI tools, like ChatGPT.

Robot reading many books in a library
This image is AI generated.

What is generative AI?


Generative AI refers to AI models and tools that generate content (text, visuals, audio or code), which is original yet reminiscent of human-created examples. Examples of generative AI, includes ChatGPT (tool) and ChatGPT-4 (model).

This page is a basic overview of how these tools generate content and how this knowledge can help you get better results out of them.



Types of generative AI: Text, visual, audio and code. A combination of these is called 'multimodal'.
Types of generative AI: text, visual, audio and code. A combination of these is called 'multimodal'.

How do AI models learn and improve?


To understand the workings of generative AI and its recent advancements, it helps to know how AI models are trained.


AI systems are like super diligent students studying vast amounts of information to get smarter. This ability to learn from data is called machine learning.

Machine learning can happen in two ways: supervised or unsupervised. Supervised learning uses data which is labelled and classified. It's like giving students a textbook activity with a clearly defined structure and the answers in the back to check their work. Unsupervised learning, on the other hand, is like giving a student a project without strict guidelines, letting them explore and derive their own conclusions.

Early AI models depended on humans programming rules — imagine how many rules would be needed just to master English! Now AI systems can learn unsupervised, picking up rules and patterns for themselves to develop a greater intelligence.


This greater ability to learn has been made possible by technological advancements and the vast amounts of data available. Complex machine learning models use deep learning with layers upon layers of data to draw upon. One example of such a complex model is a large language model (LLM), the technology behind generative AI tools like ChatGPT.


A basic representation of a neural network, with layers of interconnected neurons.
ChatGPT naked — A basic representation of a neural network, with layers of interconnected data. This image is AI generated.


How do generative AI tools, like Chat GPT, work?


Generative AI uses large language models (LLMs) with neural networks to create text, images, audio, and more.


Large language models (LLMs) are trained on vast datasets, like online books, articles and posts, which they use to learn the fundamentals of language. This digital 'wisdom' is organised into a neural network, inspired by how our brains organise and connect information. This creates an intricate web of language, which it uses to understand your prompts and produce text, images, audio or code. On top of this, LLMs are then fine-tuned by humans to ensure they give suitable (and supposedly ethical) outputs.

Imagine an LLM as a digital librarian that has read all of Shakespeare's works. When it comes across Shakespearean phrases or themes, it recalls the essence and style from its 'readings'. Thus, if you ask it to craft a sentence in the style of Shakespeare, it accesses its vast 'memory' of Shakespearean literature to craft a sentence that mimics his style.


​Generative AI tools work by paying attention to key terms in your prompt and then predicting the best answer by drawing on data from its network.

When you ask an AI text generator, like ChatGPT, what the capital of France is, it responds "Paris" — not because it understands geography, but because this answer aligns closely with its training data, as Paris has a strong connection with the words 'capital' and 'France'.

Generative AI tools can also create images. They are trained on massive datasets of images, learning the visual patterns and relationships between different elements. When you give it a prompt, such as "a snowy Eiffel Tower under a starry sky," it references its training data to identify relevant visual elements associated with ‘snowy’, the ‘Eiffel Tower’ and ‘a starry sky". Using this information, it generates an image that aligns with the given description.



Person typing
Knowing how AI models work can help you write better prompts


So, how can this help you use generative AI tools?


The key to unlocking a more accurate, insightful or creative output lies in how you prompt the AI.


Providing clear instructions and context helps direct the AI to the most relevant information in its data network. This is done by writing specific, clear and informative prompts or using techniques to tweak the AI's output.

If your prompts aren't written well or lack information, you aren't giving the AI all it needs to find the best information to use for the task. This is like setting an essay without clear guidelines or criteria; students might write extensively, but they are less likely to produce work that is in line with your expectations.


Generative AI models are largely trained from data on the internet, much of which is written in a marketing style to a mass audience for search engine optimisation (SEO). This is why answers often lack creativity or insight, because the answer is based on what’s most common or likely from the training data. So, it's up to you to guide the AI to give you the response you need.


​Visit my prompting guide for tips, techniques and examples to help you get the most out of generative AI.


Want to learn more?


Code.org have two videos which show the basics of how AI text generators and image generators work.


54 views0 comments

Recent Posts

See All

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.
bottom of page