基础知识指南

深度学习

深度学习是机器学习的一个分支,它训练具有许多堆叠层的人工神经网络,每个层将其输入转换为稍微更有用的表示。

听听这个指南AI叙述 · ~9 min

在本页10 分钟阅读
  1. 概述
  2. 主要要点
  3. 深入探讨
  4. 手动追踪一个梯度下降
  5. 现实世界的实施
  6. 深度学习的未来
  7. 付诸实践
  8. 资料来源与延伸阅读
  9. 不断探索
  10. 常见问题

概述

它是现代图像识别、语音识别、翻译和聊天机器人背后的技术,因为各层从示例中学习自己的特征,而不是依赖于手工编写的规则或特征。

主要要点

  1. 深度学习训练多层神经网络,每一层从数据中学习自己的特征,而不是使用手写规则。
  2. 训练重复一个循环:预测、使用损失函数测量误差、使用反向传播计算梯度,并微调每个权重以减少误差。
  3. 反向传播于 1986 年在《自然》杂志上进行了描述,但该领域在 2012 年开始腾飞,当时 AlexNet 将 ImageNet top-5 错误率从亚军的 26.2% 降低到了 15.3%。
  4. 卷积网络适合图像,循环网络曾经在序列中占主导地位,而 2017 年推出的 Transformer 则可以同时处理整个序列。
  5. 深度网络需要大量数据,难以解释,容易出现过度拟合和捷径学习,并且在不熟悉的输入上可能会出错。
  6. Epoch AI 估计,自 2020 年以来,前沿训练计算每年增长约 5 倍,而固定性能水平的成本却大幅下降。

深入探讨

Deep learning is a way of building software that learns a task from examples. Its core object is an artificial neural network: a large collection of simple arithmetic units, loosely inspired by brain cells, arranged in layers. Each unit multiplies its inputs by adjustable numbers called weights, adds the results, and passes the total through a simple nonlinear function. The word deep refers to the number of layers between the raw input, such as the pixels of a photo, and the final answer, such as the label cat. In their 2015 review in Nature, Yann LeCun, Yoshua Bengio and Geoffrey Hinton describe the central idea as learning representations with multiple levels of abstraction. In an image model, early layers tend to respond to edges, middle layers to combinations of edges and textures, and later layers to parts of objects. Nobody programs those detectors. They emerge during training.

Training follows the same loop for almost every deep network. First, gather many examples with known answers, called labels. Second, run an example through the network to get a prediction; this is the forward pass. Third, score the prediction with a loss function, a formula that produces a large number when the prediction is far from the label and a small one when it is close. Fourth, use backpropagation to work out, for every weight, how much a tiny change would raise or lower the loss. That quantity is called the gradient. Fifth, nudge every weight a small step in the direction that lowers the loss, a method called gradient descent. Sixth, repeat over millions of examples, usually in small groups called batches. When training ends, the weights are frozen and the network is used on new inputs, which is called inference.

Backpropagation is the step that makes depth practical. David Rumelhart, Geoffrey Hinton and Ronald Williams described it in Nature in October 1986: the procedure repeatedly adjusts connection weights to shrink the gap between the network's actual output and the desired output. Their key observation was that hidden units, the ones that are neither input nor output, come to represent useful features of the task on their own. The 2015 Nature review explains why that matters. Conventional machine learning needed careful engineering and domain expertise to design a feature extractor before any learning could happen. Deep learning moves that work into the training process.

Different layer designs suit different data. Convolutional networks slide the same small filter across every position of an image, so a pattern learned in one corner is recognized anywhere. Recurrent networks read a sequence one step at a time and carry a memory forward, which suited speech and text for many years. Transformers, introduced by Ashish Vaswani and colleagues at Google in June 2017, replace that step-by-step reading with attention, a mechanism that lets every position in a sequence look directly at every other position. Because attention can be computed for all positions at once, the original Transformer trained to a new English-to-French translation record in 3.5 days on eight GPUs. Residual connections, introduced by Kaiming He and colleagues in December 2015, let a layer's input skip ahead and be added to its output. That simple shortcut made networks of 152 layers trainable, which the authors describe as eight times deeper than the earlier VGG networks.

The modern boom has a clear starting point. In 2012, Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton entered AlexNet in the ImageNet image classification contest. The network had 60 million weights and 650,000 units, and it was trained for about 90 passes over 1.2 million labeled images, which took five to six days on two NVIDIA GTX 580 graphics cards with 3 GB of memory each. Its winning top-5 error of 15.3% compared with 26.2% for the next entry. The authors wrote that their results could likely improve simply by waiting for faster GPUs and bigger datasets, and the following decade largely followed that recipe: more data, more compute, and better architectures such as ResNet in 2015 and the Transformer in 2017. By 2024, according to the Stanford AI Index 2025, nearly 90% of notable new AI models came from industry rather than universities, up from 60% in 2023, a sign of how expensive frontier work has become.

It helps to place deep learning among its alternatives. Rule-based software follows instructions a person wrote, which is predictable and easy to audit but breaks on messy inputs like handwriting or accents. Classical machine learning, such as logistic regression or decision trees, learns from data but usually relies on features a person chose in advance. Deep learning learns the features too, which is why it dominates tasks with raw, unstructured inputs: images, audio, video and free text. For small tables of numbers, such as a spreadsheet of a few thousand loan records, simpler methods are cheaper to train and easier to explain, and they remain a sensible first try. Deep learning is also distinct from generative AI: generative systems are one use of deep networks, not a separate technology.

The method has real limits. Deep networks need large amounts of data, and they can memorize their training examples instead of learning general patterns, a failure called overfitting. The AlexNet authors reported substantial overfitting until they added dropout, a technique that randomly switches off half of the units in certain layers during each training step. A trained network's knowledge is spread across millions or billions of weights, so it is hard to say why it produced a particular answer. Networks can latch onto accidental shortcuts in the data, such as a background that happens to appear with one label, and they can fail without warning on inputs unlike anything in training. They also give confident answers when they are wrong unless they are specifically calibrated. None of these problems is solved by adding more layers.

The practical requirements depend heavily on scale. A small image classifier can be trained on a single consumer graphics card in hours, and most practitioners start from a network someone else already trained and adjust it for their task, which is called fine-tuning. Frontier models are a different world. Epoch AI estimates that training compute for frontier language models has grown about 5 times per year since 2020 and that frontier training costs have grown about 3.5 times per year, and it puts the up-front cost of a 1-gigawatt AI data center at roughly 38 billion dollars. Running models has become far cheaper, though: the Stanford AI Index 2025 reports that the price of GPT-3.5-level performance fell more than 280-fold between November 2022 and October 2024, while hardware costs fell about 30% per year and energy efficiency improved about 40% per year.

04工作示例

手动追踪一个梯度下降

  1. 采用尽可能最小的网络:预测 y = w * x 的一个权重 w。从 w = 0.5 开始。

  2. 使用一个训练示例:输入 x = 2 和正确答案 3。前向传播预测 0.5 * 2 = 1。

  3. 使用平方误差损失(预测 - 答案)平方对预测进行评分,得出 (1 - 3) 平方 = 4。

  4. 使用链式法则计算梯度:dLoss/dw = 2 * (预测 - 答案) * x = 2 * (-2) * 2 = -8。

  5. 使用学习率 0.05 更新权重:w := 0.5 - 0.05 * (-8) = 0.9。

  6. 再次运行前向传递:0.9 * 2 = 1.8,因此损失现在为 (1.8 - 3) 平方 = 1.44。

  7. 重复同样的四个步骤几次,并记录每一步后的体重和损失。

它显示了什么

一步后损失从 4 下降到 1.44,并不断缩小,w 接近 1.5,即 2 到 3 的精确映射值。真正的深度网络正是执行这种计算,一次仅针对数百万或数十亿的权重,并通过反向传播提供每个梯度。

现实世界的实施

图像识别:AlexNet 是一个具有 5 个卷积层和 3 个全连接层的网络,它以 15.3% 的 top-5 测试误差赢得了 ILSVRC-2012 竞赛,而第二名的得分为 26.2%。

非常深的视觉模型:Microsoft Research 的 2015 年 ResNet 论文使用快捷连接训练了高达 152 层的网络,并在 ILSVRC 2015 分类任务中以 3.57% 的错误率获得第一名。

机器翻译:2017 年 Transformer 在 WMT 2014 英语到德语基准测试中达到了 28.4 BLEU,比之前的最佳成绩高出了 2 BLEU 以上,并在英语到法语测试中创下了 41.8 BLEU 的单一模型记录。

语音、科学和医学:LeCun、Bengio 和 Hinton 在 2015 年《自然》杂志上发表的评论认为,深度网络在语音识别、物体检测、药物发现和基因组学等手工设计功能停滞不前的领域取得了巨大进展。

深度学习的未来

Several open problems shape current research. The first is efficiency. If frontier training compute keeps growing near the 5-times-per-year pace Epoch AI measured since 2020, the energy and capital required rise steeply; Epoch notes that the largest AI data centers were already approaching a gigawatt of power capacity in 2025. That pressure drives work on smaller models, better training recipes and cheaper chips, and the Stanford AI Index 2025 recorded hardware costs falling about 30% a year. The second is convergence among competitors. The AI Index 2025 found that the score gap between the top model and the tenth-ranked model shrank from 11.9% to 5.4% in a year, and the gap between leading open-weight and closed models narrowed from 8% to 1.7% on some benchmarks. Whether advantages now come more from data, compute or engineering is an open question. The third is understanding. Deep networks still work better than anyone can fully explain, and interpretability research tries to map what individual units and circuits compute. Reliability on unfamiliar inputs, honest uncertainty estimates and resistance to shortcut learning remain unsolved. Whether simply scaling current architectures will keep producing gains, or whether new ideas are needed, is actively debated rather than settled.

付诸实践

为什么这很重要

  • 更清晰的判决. 它可以帮助您将清晰的技术声明与营销语言分开。
  • 成本与预算. 在花费金钱或时间之前,您可以提出更好的实施问题。
  • 团队与工作流程. 具有共同理解的团队可以做出更好的产品、政策和学习决策。

留意

  • 不同的团队可能会以不同的方式使用同一术语,因此请尽早定义范围。
  • 基准测试可能看起来很强大,但实际性能却参差不齐。
  • 忽视数据质量和评估计划通常会产生脆弱的结果。

后续步骤

  1. 从您需要的结果的简单语言定义开始。
  2. 在测试之前选择一种成功指标和一种失败条件。
  3. 使用代表性数据运行小型试点,而不是完善的演示集。
  4. 记录深度学习在哪些方面有帮助以及在哪些方面更简单的方法更好。

资料来源与延伸阅读

  1. Nature (LeCun, Bengio and Hinton, 2015)深度学习
  2. Nature (Rumelhart, Hinton and Williams, 1986)通过反向传播误差来学习表示
  3. NeurIPS 2012使用深度卷积神经网络进行 ImageNet 分类
  4. arXiv (Microsoft Research, 2015)用于图像识别的深度残差学习
  5. arXiv (Google, 2017)您所需要的就是关注
  6. Stanford Institute for Human-Centered AI2025年人工智能指数报告
  7. Epoch AI机器学习趋势

不断探索

免费通讯

获取每日AI简报

每个工作日早晨提供三条经过验证的AI故事,使用简明英文撰写。永久免费,无广告。

每个工作日发送一封邮件。一键退订。我们永不出售或分享您的地址。

测试一下自己

参加深度学习测验

每个答案即时反馈,课程通过后可获得可验证ID的可分享证书。

开始测验

支持免费AI教育。AI Understanding是一家501(c)(3)非营利组织——无广告,无付费墙,永不收费。 捐款

常见问题

什么是深度学习?

深度学习是机器学习的一个分支,它训练具有许多堆叠层的人工神经网络,每个层将其输入转换为稍微更有用的表示。它是现代图像识别、语音识别、翻译和聊天机器人背后的技术,因为各层从示例中学习自己的特征,而不是依赖于手工编写的规则或特征。

深度学习模型中的“深度”描述什么?

在本指南中,深度是指多层网络结构;它没有建立类似人类的理解或表现。

网络有 2 个输入、3 个和 2 个单元的隐藏层以及 1 个输出。对于每个隐藏/输出单元的偏差,有多少个权重和偏差?

这些层贡献 (2×3+3)=9、(3×2+2)=8 和 (2×1+1)=3,总共 20 个。

为什么在隐藏层之间使用非线性激活?

该指南解释说,线性运算的堆栈仍然是线性的;非线性激活让网络表示非线性关系。

在推理过程中,训练后的模型参数通常会发生什么?

使用训练好的模型进行推理;训练是更新参数的过程。

模型非常适合其训练示例,但在可比较的保留数据上表现不佳。这说明了什么规律呢?

过度拟合是指较强的训练性能与较弱的新数据性能相结合。