{
  "id": "ai-ml-dl-genai",
  "module": "ai-basics",
  "level": 1,
  "minutes": 10,
  "audiences": [
    "beginner"
  ],
  "software": [],
  "text": {
    "en": {
      "title": "AI vs Machine Learning vs Deep Learning vs Generative AI: How They Fit Together",
      "description": "One nested diagram that explains artificial intelligence, machine learning, deep learning and generative AI: rule-based vs learned AI, the three ways machines learn, why deep learning won, and generative vs discriminative models. With papers and free courses.",
      "updated": "2026-10-22",
      "takeaways": [
        "The four terms nest: artificial intelligence (AI) ⊃ machine learning (ML) ⊃ deep learning (DL) ⊃ today's generative AI (LLMs, text-to-image and so on).",
        "Rule-based AI is programmed by people; machine learning learns the rules from data. Supervised, unsupervised and reinforcement learning are the three main ways to learn.",
        "Deep learning uses many-layer neural networks that learn their own features; once big data and GPUs arrived it took over, starting with image recognition in 2012.",
        "Discriminative models answer “what is this?” (classify, score); generative models answer “make another one like this” (text, images, code). Large language models are generative."
      ],
      "faq": [
        {
          "q": "Which layer does ChatGPT belong to?",
          "a": "All four: it is AI, trained with machine learning, built on a deep neural network (a Transformer), and generative — it writes text one token at a time."
        },
        {
          "q": "Does all AI use machine learning?",
          "a": "No. Shortest-path routing, classic expert systems and chess-engine search are AI, but their rules and search methods are designed by people rather than learned from data."
        },
        {
          "q": "Is deep learning the opposite of machine learning?",
          "a": "No. Deep learning is a branch of machine learning that uses many-layer neural networks. On many tabular-data problems, “classic” methods such as gradient-boosted trees are still common and strong."
        },
        {
          "q": "Will generative AI replace discriminative models?",
          "a": "They are often used together. A generative LLM can classify through a prompt, but for spam filtering or risk scoring a small purpose-trained discriminative model is usually faster, cheaper and easier to evaluate."
        }
      ],
      "sources": [
        {
          "title": "LeCun, Bengio & Hinton (2015), Deep learning, Nature 521",
          "url": "https://www.nature.com/articles/nature14539"
        },
        {
          "title": "Krizhevsky, Sutskever & Hinton (2012), ImageNet Classification with Deep Convolutional Neural Networks (AlexNet), NeurIPS",
          "url": "https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html"
        },
        {
          "title": "Goodfellow et al. (2014), Generative Adversarial Networks",
          "url": "https://arxiv.org/abs/1406.2661"
        },
        {
          "title": "Vaswani et al. (2017), Attention Is All You Need",
          "url": "https://arxiv.org/abs/1706.03762"
        },
        {
          "title": "Brown et al. (2020), Language Models are Few-Shot Learners (GPT-3)",
          "url": "https://arxiv.org/abs/2005.14165"
        },
        {
          "title": "Elements of AI (free course, University of Helsinki)",
          "url": "https://www.elementsofai.com/"
        },
        {
          "title": "DeepLearning.AI, AI for Everyone (Andrew Ng)",
          "url": "https://www.deeplearning.ai/courses/ai-for-everyone/"
        },
        {
          "title": "Google, Machine Learning Crash Course",
          "url": "https://developers.google.com/machine-learning/crash-course"
        }
      ],
      "url": "https://aimap.page/en/learn/ai-basics/ai-ml-dl-genai/",
      "markdown": "## The short answer\n\n**Artificial intelligence (AI)** is the biggest circle: getting machines to do tasks that need “intelligence”. **Machine learning (ML)** is one way to do it: instead of people writing the rules, a program learns them from data. **Deep learning (DL)** is the part of machine learning that uses many-layer neural networks. What people now call **generative AI** — large language models, text-to-image models — is almost entirely deep learning models that *produce* content.\n\n```mermaid\nflowchart TB\n  subgraph AI[\"Artificial intelligence: machines doing tasks that need intelligence\"]\n    R[\"Rule-based AI: expert systems, search, planning\"]\n    subgraph ML[\"Machine learning: learning rules from data\"]\n      T[\"Classic ML: linear regression, decision trees, gradient boosting\"]\n      subgraph DL[\"Deep learning: many-layer neural networks\"]\n        D[\"Discriminative: image classification, speech recognition\"]\n        G[\"Generative AI: LLMs, text-to-image, speech synthesis\"]\n      end\n    end\n  end\n```\n\n## Rule-based AI vs learned AI\n\nEarly AI was mostly hand-written rules. A spam filter might say “if the subject contains ‘you won’, mark as spam”. This **rule-based AI** (symbolic AI, expert systems) is transparent and controllable, but you can never write enough rules: spammers simply rephrase.\n\n**Machine learning** flips the approach: collect many emails already labelled spam or not, and let an algorithm find which features predict the label. The rules are no longer written one by one — they live in the model's parameters. When the data changes, you retrain.\n\n## Three main ways to learn\n\n| Approach | What the model gets | Typical tasks |\n|---|---|---|\n| Supervised learning | Inputs plus correct answers (labels) | Spam classification, price prediction, image recognition |\n| Unsupervised / self-supervised learning | Inputs only, no human labels | Clustering, dimensionality reduction; LLM pre-training (“predict the next token”) is self-supervised |\n| Reinforcement learning | An environment plus a reward signal | Game playing, robot control; RLHF in LLM alignment |\n\nTraining a modern LLM uses all three: self-supervised pre-training on huge text corpora, supervised fine-tuning on human-written demonstrations, then reinforcement learning from human preferences (see [How LLMs Learn](/learn/how-llms-learn)).\n\n## Why deep learning won\n\nClassic machine learning often needs people to design “features” first (edges in an image, colour histograms). **Deep learning** stacks many neural-network layers: early layers learn simple features and later layers combine them into complex concepts, removing most hand-built feature engineering ([LeCun, Bengio & Hinton, 2015](https://www.nature.com/articles/nature14539)).\n\nThe turning point came in 2012, when AlexNet — a deep convolutional network trained on GPUs — won the ImageNet image-recognition challenge by a wide margin ([Krizhevsky et al., 2012](https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html)). Speech recognition and machine translation followed. The 2017 Transformer architecture ([Vaswani et al.](https://arxiv.org/abs/1706.03762)) made training highly parallel and became the base of almost every large model today. For how neural networks themselves work, see [Neural Networks](/learn/neural-networks).\n\nIt took three ingredients together: **more data** (the internet), **more compute** (GPUs) and **better architectures and training methods**.\n\n## Generative vs discriminative models\n\n- A **discriminative model** learns “given this input, what is the answer?”: is this a cat or a dog, is this transaction risky? It outputs a class or a score.\n- A **generative model** learns what the data looks like, so it can **create new samples**: a paragraph, an image, a voice clip. GANs ([Goodfellow et al., 2014](https://arxiv.org/abs/1406.2661)), diffusion models and LLMs are all generative.\n\nLLMs generate text by repeatedly predicting the next token (see [What Is a Large Language Model?](/learn/what-is-an-llm)). The GPT-3 paper also showed that a large enough model can do tasks it was never specifically trained for, just from a few examples in the prompt ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)) — the starting point of the next lesson, [Prompting Basics](/learn/prompting-basics).\n\n## Common misconceptions\n\n- **“AI = large language models.”** LLMs are just the newest, most visible branch. Recommenders, fraud detection, navigation and OCR rely heavily on other AI methods.\n- **“Deep learning always beats classic ML.”** On small, well-structured tabular data, gradient-boosted trees are often more accurate, faster and easier to explain.\n- **“What a model learns from data is fact.”** Models learn statistical patterns; biased data gives biased models, and generative models can also hallucinate.\n\n## Try it yourself\n\n1. Open [Teachable Machine](https://teachablemachine.withgoogle.com/) and, without code, take a few dozen webcam pictures of two hand gestures to train a classifier — that is supervised learning.\n2. Open [TensorFlow Playground](https://playground.tensorflow.org/) and go from 0 to 3 hidden layers; watch the decision boundary bend from a straight line into complex curves — that is what “deep” buys you.\n3. For a structured start, try the free [Elements of AI](https://www.elementsofai.com/), [AI for Everyone](https://www.deeplearning.ai/courses/ai-for-everyone/) or Google's [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course)."
    },
    "zh-hans": {
      "title": "AI、机器学习、深度学习、生成式 AI 有什么区别？一张图讲清关系",
      "description": "用一张嵌套图讲清人工智能、机器学习、深度学习和生成式 AI 的包含关系：规则式 AI 与学习式 AI、三种学习方式、深度学习为什么胜出、生成式与判别式模型。附论文与免费课程出处。",
      "updated": "2026-10-22",
      "takeaways": [
        "四个词是层层包含的关系：人工智能（AI）⊃ 机器学习（ML）⊃ 深度学习（DL）⊃ 今天的生成式 AI（大模型、文生图等）。",
        "规则式 AI 由人写规则；机器学习从数据里自己学规则。监督、无监督、强化学习是三种主要的学习方式。",
        "深度学习用多层神经网络自动学特征，在大数据和 GPU 出现后，从 2012 年的图像识别开始全面胜出。",
        "判别式模型回答“这是什么”（分类、打分），生成式模型回答“再造一个像这样的”（文字、图片、代码）。大语言模型是生成式模型。"
      ],
      "faq": [
        {
          "q": "ChatGPT 属于哪一层？",
          "a": "四层都属于：它是 AI，靠机器学习训练，用的是深度神经网络（Transformer），并且是生成式的——逐个 token 生成文字。"
        },
        {
          "q": "所有 AI 都要用机器学习吗？",
          "a": "不是。导航里的最短路径算法、早期的专家系统、象棋程序里的搜索都属于 AI，但规则和搜索方法由人设计，不从数据学习。"
        },
        {
          "q": "深度学习和机器学习是对立的吗？",
          "a": "不是。深度学习是机器学习的一个分支，特点是用多层神经网络。很多表格数据任务上，梯度提升树等“传统”机器学习方法依然常用且好用。"
        },
        {
          "q": "生成式 AI 会取代判别式模型吗？",
          "a": "两者常常一起用：生成式大模型也可以通过提示来做分类；而垃圾邮件过滤、风控打分等场景，专门训练的小型判别模型往往更快、更便宜、更好评估。"
        }
      ],
      "sources": [
        {
          "title": "LeCun、Bengio、Hinton（2015），Deep learning，Nature 521",
          "url": "https://www.nature.com/articles/nature14539"
        },
        {
          "title": "Krizhevsky、Sutskever、Hinton（2012），ImageNet Classification with Deep Convolutional Neural Networks（AlexNet），NeurIPS",
          "url": "https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html"
        },
        {
          "title": "Goodfellow 等（2014），Generative Adversarial Networks",
          "url": "https://arxiv.org/abs/1406.2661"
        },
        {
          "title": "Vaswani 等（2017），Attention Is All You Need",
          "url": "https://arxiv.org/abs/1706.03762"
        },
        {
          "title": "Brown 等（2020），Language Models are Few-Shot Learners（GPT-3）",
          "url": "https://arxiv.org/abs/2005.14165"
        },
        {
          "title": "Elements of AI（赫尔辛基大学免费课程）",
          "url": "https://www.elementsofai.com/"
        },
        {
          "title": "DeepLearning.AI，AI for Everyone（吴恩达）",
          "url": "https://www.deeplearning.ai/courses/ai-for-everyone/"
        },
        {
          "title": "Google，Machine Learning Crash Course",
          "url": "https://developers.google.com/machine-learning/crash-course"
        }
      ],
      "url": "https://aimap.page/zh-hans/learn/ai-basics/ai-ml-dl-genai/",
      "markdown": "## 一句话回答\n\n**人工智能（Artificial Intelligence，AI）** 是最大的圈：让机器完成需要“智能”的任务。**机器学习（Machine Learning，ML）** 是其中一种做法：不由人写规则，而让程序从数据里学规则。**深度学习（Deep Learning，DL）** 是机器学习里用多层神经网络的那一支。今天常说的 **生成式 AI（Generative AI）**，比如大语言模型和文生图模型，基本都是深度学习做出来的“会生成内容”的模型。\n\n```mermaid\nflowchart TB\n  subgraph AI[\"人工智能 AI：让机器完成需要智能的任务\"]\n    R[\"规则式 AI：专家系统、搜索、规划\"]\n    subgraph ML[\"机器学习 ML：从数据中学规则\"]\n      T[\"传统 ML：线性回归、决策树、梯度提升\"]\n      subgraph DL[\"深度学习 DL：多层神经网络\"]\n        D[\"判别式：图像分类、语音识别\"]\n        G[\"生成式 AI：大语言模型、文生图、语音合成\"]\n      end\n    end\n  end\n```\n\n## 规则式 AI 与学习式 AI\n\n早期的 AI 主要靠人写规则。比如一个识别垃圾邮件的程序，可以写“标题里有‘中奖’就判为垃圾”。这种**规则式 AI**（也叫符号 AI、专家系统）透明、可控，但规则写不完：骗子换个说法就绕过去了。\n\n**机器学习**换了思路：收集一大批已标好“垃圾/正常”的邮件，让算法自己找出哪些特征和结果有关。规则不再由人逐条写出，而是存在模型的参数里。数据变了，重新训练即可。\n\n## 三种主要的学习方式\n\n| 方式 | 给模型什么 | 典型任务 |\n|---|---|---|\n| 监督学习（supervised） | 输入 + 正确答案（标签） | 垃圾邮件分类、房价预测、图像识别 |\n| 无监督 / 自监督学习（unsupervised / self-supervised） | 只有输入，没有人工标签 | 聚类、降维；大模型预训练“预测下一个 token”属于自监督 |\n| 强化学习（reinforcement learning） | 环境 + 奖励信号 | 下棋、机器人控制；大模型对齐中的 RLHF |\n\n大模型的训练恰好把三种方式都用上了：先在海量文本上自监督预训练，再用人写的示范做监督微调，最后用人类偏好做强化学习（见 [大模型如何学习](/learn/how-llms-learn)）。\n\n## 深度学习为什么胜出\n\n传统机器学习往往需要人先设计“特征”（例如图片的边缘、颜色直方图）。**深度学习**用很多层神经网络，让前几层自动学到简单特征、后几层组合成复杂概念，省掉了大部分手工特征工程（[LeCun、Bengio、Hinton，2015](https://www.nature.com/articles/nature14539)）。\n\n它在 2012 年迎来转折：AlexNet 用 GPU 训练的深度卷积网络，在 ImageNet 图像识别比赛上大幅领先（[Krizhevsky 等，2012](https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html)）。此后语音识别、机器翻译陆续转向深度学习。2017 年的 Transformer 结构（[Vaswani 等](https://arxiv.org/abs/1706.03762)）让模型能高效地并行训练，成为今天几乎所有大模型的底座。神经网络本身怎么工作，见 [神经网络入门](/learn/neural-networks)。\n\n三个条件缺一不可：**更多的数据**（互联网）、**更强的算力**（GPU）、**更好的结构与训练方法**。\n\n## 生成式模型与判别式模型\n\n- **判别式模型**学的是“给定输入，答案是什么”：这张图是猫还是狗？这笔交易有没有风险？输出是类别或分数。\n- **生成式模型**学的是“数据长什么样”，因此能**造出新的样本**：写一段文字、画一张图、合成一段语音。GAN（[Goodfellow 等，2014](https://arxiv.org/abs/1406.2661)）、扩散模型和大语言模型都属于这一类。\n\n大语言模型通过反复“预测下一个 token”来生成文字（见 [大模型是什么](/learn/what-is-an-llm)）。GPT-3 的论文还展示了：模型足够大后，只要在提示里给几个例子，它就能完成没专门训练过的任务（[Brown 等，2020](https://arxiv.org/abs/2005.14165)）。这也是下一课 [提示词基础](/learn/prompting-basics) 的出发点。\n\n## 常见误区\n\n- **“AI = 大模型”**：大模型只是最新、最显眼的一支。推荐系统、风控、导航、OCR 里大量用的是其他 AI 方法。\n- **“深度学习一定比传统机器学习好”**：数据少、特征清晰的表格任务，梯度提升树往往更准、更快、更好解释。\n- **“模型从数据里学到的就是事实”**：模型学到的是统计规律，数据有偏差，模型也会有偏差；生成式模型还会“幻觉”。\n\n## 动手试试\n\n1. 打开 [Teachable Machine](https://teachablemachine.withgoogle.com/)，不写代码，用摄像头给两种手势各拍几十张图，训练一个分类器——这就是监督学习。\n2. 打开 [TensorFlow Playground](https://playground.tensorflow.org/)，把隐藏层从 0 层加到 3 层，看决策边界如何从直线变成复杂曲线——这就是“深度”的作用。\n3. 想入门系统学习，可以从免费的 [Elements of AI](https://www.elementsofai.com/)、[AI for Everyone](https://www.deeplearning.ai/courses/ai-for-everyone/) 或 [Google 机器学习速成课](https://developers.google.com/machine-learning/crash-course) 开始。"
    }
  }
}