What is AI ML Deep Learning and Generative AI

Four Words, One Family

These terms are nested inside each other. Each one is a smaller, more specific part of the one before it:

Artificial Intelligence (AI)      machines doing tasks that need "intelligence"
 └── Machine Learning (ML)        learning patterns from data instead of hand-written rules
      └── Deep Learning (DL)      ML with large neural networks (many layers)
           └── Generative AI      deep learning models that CREATE new text, images, audio, code
                └── LLMs          Large Language Models: generative models for text (Claude, GPT, Gemini, Llama)
TermSimple meaningExample
AIAny program that behaves smartlyChess engine, route planner
Machine LearningLearns rules from examplesSpam filter trained on labelled emails
Deep LearningML with big neural networksFace unlock, speech-to-text
Generative AIProduces new contentWriting an email, drawing an image
LLMGenerative AI for languageA support chatbot, GitHub Copilot

Rules vs Learning

Example

Classic programming: a human writes the rules. Machine learning: the program counts patterns in labelled examples and builds its own "rules" (here, word scores). Both are standard Python:

# 1) Hand-written rule (classic AI / programming)
def is_spam_rule(msg):
    return "free" in msg.lower() or "win" in msg.lower()

# 2) Learned from examples (the core idea of machine learning)
examples = [
    ("win a free iphone now", "spam"),
    ("free recharge offer click link", "spam"),
    ("your order has been shipped", "ok"),
    ("meeting moved to 3 pm", "ok"),
    ("claim your prize now", "spam"),
]
score = {}
for text, label in examples:
    for w in text.split():
        score[w] = score.get(w, 0) + (1 if label == "spam" else -1)

def is_spam_learned(msg):
    return sum(score.get(w, 0) for w in msg.lower().split()) > 0

for msg in ["Claim your free prize", "Your order is shipped", "Prize waiting, claim now"]:
    print(f"{msg!r:30} rule={is_spam_rule(msg)!s:5}  learned={is_spam_learned(msg)}")

Output

'Claim your free prize'        rule=True   learned=True
'Your order is shipped'        rule=False  learned=False
'Prize waiting, claim now'     rule=False  learned=True

The hand-written rule missed "Prize waiting, claim now" because nobody wrote a rule for "prize". The learned version caught it because "prize" and "claim" appeared in spam examples. Real models learn billions of such weights from huge datasets.

Where Generative AI Fits

Older ML mostly predicts a label or a number (spam or not, price of a house). Generative AI produces new content: a reply, a summary, code, an image. An LLM is trained on a huge amount of text and learns to continue text one small piece (a token) at a time. You will see exactly how in the next module.

Tip: You do not need to know machine learning maths to build GenAI apps. Most GenAI developer jobs are about calling models through an API, giving them the right context, and checking their output. That is what this material teaches.