What Is Generative AI

Updated · 6 min read

How can a computer write an email nobody has ever written? Srihitha needs two days off in December for a family event in Dallas. She types one sentence into a chat assistant, and a polite, complete email appears in seconds. That email didn't exist anywhere before she asked. The assistant created it.

That is generative AI: AI that creates new content. Earlier chapters showed AI that recognizes, sorts and predicts. This lesson explains what makes AI "generative", and how it produces something new.

Creating, Not Just Recognizing

Generative AI is AI that creates new content, such as text, images, audio, video and code, based on patterns it learned from data. It doesn't copy an answer from a database; it produces new output, one piece at a time, that fits the patterns it learned.

A prompt goes in; new content comes out
Generative AI can create...Everyday example
TextAn email, a cover letter, an answer to a question
CodeA function, a test, a fix for an error
ImagesA picture of "a golden retriever in a park"
AudioA natural-sounding voice reading your text aloud
VideoA short clip from a written description
SummariesThree bullet points from a 20-page report
Structured contentA table or JSON filled in from messy notes

How Something New Comes Out

A generative model learns which pieces tend to follow which: which words follow which in sentences, or which pixels sit near which in photos. To generate, it picks the next piece that fits, again and again. Here is the idea in a tiny Python program that learns which word follows each word, then writes a sentence:

Python
import random
 
training_text = "the dog runs in the park . the dog plays in the garden . the cat sleeps in the sun ."
words = training_text.split()
 
# Learn: which words can follow each word
follows = {}
for word, next_word in zip(words, words[1:]):
    follows.setdefault(word, []).append(next_word)
print("After 'the':", follows["the"])
 
# Generate: start with "the", keep picking a word that can come next
random.seed(33)  # a fixed seed, so you get the same sentence
word, sentence = "the", ["the"]
while word != ".":
    word = random.choice(follows[word])
    sentence.append(word)
print(" ".join(sentence))
Output
After 'the': ['dog', 'park', 'dog', 'garden', 'cat', 'sun']
the cat sleeps in the garden .

"The cat sleeps in the garden" never appears in the training text. The program combined patterns it learned into a new sentence. Real models are vastly more sophisticated: they consider the whole conversation, not just one word, and learn from billions of examples. But the core idea, generating new content one piece at a time from learned patterns, is the same. "How an LLM Generates Text" shows the real version.

Common Mistakes

Thinking generative AI looks up answers. It creates them from patterns, which is why it can produce something new, and also why it can produce something false.

Thinking generated text is always original and safe to use. It can repeat common phrases, contain mistakes, or resemble existing work; "Text, Image, Audio and Video Generation" covers copyright and deepfakes.

Thinking generative AI replaced traditional AI. Spam filters, fraud checks and price predictions still use traditional models, as the next lesson shows.

Interview Corner

What is generative AI?

AI that creates new content, such as text, images, audio, video and code, based on patterns it learned from data. Instead of only labeling or predicting, it produces new output, one piece at a time.

Why can generative AI produce wrong answers that sound right?

It generates what fits the patterns it learned, not what it has checked to be true. Fluent language is a pattern it learned well; accuracy isn't guaranteed, so outputs need checking.

Practice

Exercise: draft and check. Use a generative AI tool to draft a short leave request email and to create an image of "a golden retriever in a park". For each, list everything you had to check or fix: names, dates, tone, strange details in the image. Then write one sentence on what surprised you.

Check your understanding:

  1. What makes AI "generative"?
  2. In the Python example, where did the new sentence come from?
  3. Why should you read generated content before using it?

Quick check: what is generative AI

4 questions
1What does generative AI do?
2In the Python example, "the cat sleeps in the garden" was...
3Which of these is generative AI?
4A generated summary sounds confident and clear. What should you do?

Key Takeaways

Quick reference

TermMeaning
Generative AIAI that creates new content from learned patterns
PromptThe instruction or question you give a generative model
OutputThe content the model generates
Traditional AIAI that mainly labels, sorts or predicts

Was this tutorial helpful?

Lesson 23 of 186