Lesson 1: What Generative AI Is
In the last course you learned that machine learning finds patterns in data and uses them to predict. Generative AI goes one step further: instead of only predicting a label or a number, it creates something new — a paragraph of text, a picture, a piece of music, a line of code. The text you are reading now could, in principle, have been written by a generative model. The fact that you cannot always tell is both the wonder of the technology and the reason this course spends as much time on judgement as on mechanics.
All generative AI works the same way at heart: it learns the patterns of some kind of content, then produces new content that follows those patterns. A model trained on millions of sentences learns how sentences are usually built — which words follow which, how questions are phrased, how stories begin and end. When you give it a prompt, it does not look up an answer; it generates one, word by word, following the patterns it learned. That is why it can write a poem about a subject it has never seen a poem about, and also why it can write a confident answer that is completely wrong.
Text, images, sound and code
The most widely used generative models work with text, and they are called large language models, or LLMs. They are the subject of most of this course. But the same idea works for other kinds of content. Image models learn the patterns of pictures and generate new ones from a written description. Music models learn the patterns of songs. Code models learn the patterns of programs and suggest the next lines a programmer might write. The training differs, but the principle is the same: learn the pattern, then generate something new that fits it.
It helps to be clear about what these models are not. They are not databases, and they do not retrieve facts. A model that tells you the capital of a country is not looking it up; it is producing the words that most often follow that question in its training data, which usually happens to be the right answer. They are not minds, either: they have no beliefs, no intentions and no understanding of what their words mean. They are prediction machines that have become so good at predicting text that their output reads as if it were written by someone who understands.
Generative versus discriminative
Not all machine learning models generate. The models in the last course were mostly discriminative: given an input, they drew a boundary or fitted a line to decide an answer — spam or not spam, a price, a category. A generative model does something different: it learns the whole pattern of the data itself, so it can produce new examples that look as if they came from the same source. The distinction is useful because it explains the different risks. A discriminative model that is wrong gives a wrong answer; a generative model that is wrong gives a wrong answer that looks like a real document, a real photograph, or a real person's words. That realism is the technology's power and its danger at once, and it is why the rest of this course keeps returning to the same question: how do you tell whether what a generative model produced is true, fair and safe to use?
That distinction — fluent but not understanding — is the thread that runs through this whole course. You will learn how these models work, how they are trained, how to use them well, how to build things with them, and how to spot their failures. Generative AI is a tool of extraordinary power, and like any powerful tool, its value depends entirely on the skill and honesty of the person using it.
Key Terms
- Generative AI
- AI that creates new content — text, images, music or code — by learning the patterns of existing content and producing new examples that follow them.
- Large language model (LLM)
- A large generative model trained on huge amounts of text, able to generate and work with human language.
- Prompt
- The text a user gives a model, telling it what to generate or do.
- Generation
- The process of a model producing new content, usually one piece at a time, such as one word after another.
- Training data
- The examples a model learns from — for a language model, enormous collections of text.
- Fluency
- How natural and well-formed generated text sounds; fluency is not the same as truth.
Discussion Questions
- A model writes a poem about a subject it has never seen a poem about. How is that possible if it only learned patterns from data?
- Why is 'the model looked it up' the wrong way to describe how a language model answers a question?
- Give an example where fluent, confident text that is wrong would be harmless, and one where it would be dangerous.
Practice Questions
- What is the difference between ordinary machine learning and generative AI?
- How does a language model produce an answer?
- What is a prompt?
- Why can a model write fluently and still be wrong?
- Name two kinds of content generative AI can create besides text.
Show answers
- Ordinary machine learning usually predicts a label or a number; generative AI creates new content. A classifier says whether an email is spam; a generative model writes a new email.
- It generates text word by word, following patterns it learned from training data. It does not look up an answer; it predicts the words that most often follow the prompt.
- The text a user gives a model, telling it what to generate or do. The model's output depends heavily on how the prompt is written.
- Because it predicts likely words, not true ones. Fluency comes from following the patterns of language; truth needs facts, which the model does not check.
- Images and music, or code. Image models generate pictures from descriptions; code models suggest lines of a program.