Stephen Wolfram:ChatGPT 的训练

news/2024/11/29 22:41:29/

The Training of ChatGPT 

ChatGPT 的训练

OK, so we’ve now given an outline of how ChatGPT works once it’s set up. But how did it get set up? How were all those 175 billion weights in its neural net determined? Basically they’re the result of very large-scale training, based on a huge corpus of text—on the web, in books, etc.—written by humans. As we’ve said, even given all that training data, it’s certainly not obvious that a neural net would be able to successfully produce “human-like” text. And, once again, there seem to be detailed pieces of engineering needed to make that happen. But the big surprise—and discovery—of ChatGPT is that it’s possible at all. And that—in effect—a neural net with “just” 175 billion weights can make a “reasonable model” of text humans write.

好了,我们现在已经描述了一旦 ChatGPT 建立起来,它是如何工作的。但是它是如何建立起来的呢?神经网络中的那 1750 亿个权重是如何确定的?基本上,它们是基于大量的文本(来自网络、书籍等)所进行的大规模训练的结果,这些文本都是人类编写的。正如我们所说,即使有了所有的训练数据,神经网络能够成功地生成“类人”的文本也绝非显而易见。而且,再次强调,似乎需要详细的工程部分来实现这一目标。但 ChatGPT 的一个巨大的惊喜和发现是,这样的事情竟然是可能的。实际上,一个拥有“仅仅” 1750 亿权重的神经网络,就可以成为一个对人类书写文本的“合理模型”。

In modern times, there’s lots of text written by humans that’s out there in digital form. The public web has at least several billion human-written pages, with altogether perhaps a trillion words of text. And if one includes non-public webpages, the numbers might be at least 100 times larger. So far, more than 5 million digitized books have been made available (out of 100 million or so that have ever been published), giving another 100 billion or so words of text. And that’s not even mentioning text derived from speech in videos, etc. (As a personal comparison, my total lifetime output of published material has been a bit under 3 million words, and over the past 30 years I’ve written about 15 million words of email, and altogether typed perhaps 50 million words—and in just the past couple of years I’ve spoken more than 10 million words on livestreams. And, yes, I’ll train a bot from all of that.)

在现代社会,人类编写的大量文本以数字形式存在。公共网络上至少有数十亿个由人类编写的页面,总共可能有一万亿字左右的文本。如果算上非公共网页,这个数字可能至少增加 100 倍。到目前为止,已经有 500 多万本数字化图书可供使用(从历史上看,共出版了约 1 亿本图书),另有大约 1000 亿字的文本。这还不包括来自视频中的语音转化成的文本等。(作为个人对比,我一生中出版的材料总共不到 300 万字,过去 30 年里我写了大约 1500 万字的电子邮件,总共可能敲了 5000 万字。仅在过去的几年里,我在直播中就说了超过 1000 万字。而且,是的,我将从所有这些内容中训练一个机器人。)

But, OK, given all this data, how does one train a neural net from it? The basic process is very much as we discussed it in the simple examples above. You present a batch of examples, and then you adjust the weights in the network to minimize the error (“loss”) that the network makes on those examples. The main thing that’s expensive about “back propagating” from the error is that each time you do this, every weight in the network will typically change at least a tiny bit, and there are just a lot of weights to deal with. (The actual “back computation” is typically only a small constant factor harder than the forward one.)

那么,既然有了这些数据,如何从中训练神经网络呢?基本过程与我们在上面简单示例中讨论的非常相似。你呈现一批示例,然后调整网络中的权重以使网络在这些示例上产生的误差(“损失”)最小化。关于“反向传播”错误的主要昂贵之处在于,每次执行此操作时,网络中的每个权重通常都会发生至少微小的变化,而且还有许多权重需要处理。(实际的“反向计算”通常只比正向计算稍难一些。)

With modern GPU hardware, it’s straightforward to compute the results from batches of thousands of examples in parallel. But when it comes to actually updating the weights in the neural net, current methods require one to do this basically batch by batch. (And, yes, this is probably where actual brains—with their combined computation and memory elements—have, for now, at least an architectural advantage.)

借助现代 GPU 硬件,可以轻松地并行计算数千个示例的结果。但是在实际更新神经网络中的权重时,当前的方法需要逐批次进行。(是的,这可能是实际大脑(具有结合计算和存储单元)至少在架构上具有优势的地方。)

Even in the seemingly simple cases of learning numerical functions that we discussed earlier, we found we often had to use millions of examples to successfully train a network, at least from scratch. So how many examples does this mean we’ll need in order to train a “human-like language” model? There doesn’t seem to be any fundamental “theoretical” way to know. But in practice ChatGPT was successfully trained on a few hundred billion words of text.

即使在我们之前讨论过的学习数值函数的看似简单的情况下,我们也发现通常需要使用数百万个示例来成功训练网络,至少是从头开始的。那么,这意味着我们需要多少个示例来训练一个“类人语言”的模型呢?似乎没有任何基本的“理论”方法来知道。但实际上,ChatGPT 已经成功地通过几千亿字的文本进行了训练。

Some of the text it was fed several times, some of it only once. But somehow it “got what it needed” from the text it saw. But given this volume of text to learn from, how large a network should it require to “learn it well”? Again, we don’t yet have a fundamental theoretical way to say. Ultimately—as we’ll discuss further below—there’s presumably a certain “total algorithmic content” to human language and what humans typically say with it. But the next question is how efficient a neural net will be at implementing a model based on that algorithmic content. And again we don’t know—although the success of ChatGPT suggests it’s reasonably efficient.

有些文本被反复输入了多次,有些只输入了一次。但不知何故,它从所看到的文本中“获得了所需”。考虑到这么多的文本供其学习,需要多大的网络才能“学得好”呢?同样,我们尚没有一个基本的理论方法来回答这个问题。归根结底,正如我们将在下面进一步讨论的那样,人类语言及其典型表达应该具有一定的“总体算法内容”。但下一个问题是神经网络在实现基于该算法内容的模型时的效率如何。我们同样不知道,尽管 ChatGPT 的成功表明其效率相当不错。

And in the end we can just note that ChatGPT does what it does using a couple hundred billion weights—comparable in number to the total number of words (or tokens) of training data it’s been given. In some ways it’s perhaps surprising (though empirically observed also in smaller analogs of ChatGPT) that the “size of the network” that seems to work well is so comparable to the “size of the training data”. After all, it’s certainly not that somehow “inside ChatGPT” all that text from the web and books and so on is “directly stored”. Because what’s actually inside ChatGPT are a bunch of numbers—with a bit less than 10 digits of precision—that are some kind of distributed encoding of the aggregate structure of all that text.

最后我们可以注意到,ChatGPT 在处理时使用了大约几百亿个权重——与其接受的训练数据的总单词数(或标记数)相当。从某种程度上说,可能令人惊讶的是(尽管在 ChatGPT 的较小类似物中也经验观察到),似乎能够良好运作的“网络规模”与“训练数据规模”如此相近。毕竟,肯定不是因为“inside ChatGPT”,网络和书籍等所有文本都是“直接存储”的。因为实际上,ChatGPT 内部是一堆数字——精度略低于 10 位数——这些数字以某种分布式编码方式表示了所有文本的总体结构。

Put another way, we might ask what the “effective information content” is of human language and what’s typically said with it. There’s the raw corpus of examples of language. And then there’s the representation in the neural net of ChatGPT. That representation is very likely far from the “algorithmically minimal” representation (as we’ll discuss below). But it’s a representation that’s readily usable by the neural net. And in this representation it seems there’s in the end rather little “compression” of the training data; it seems on average to basically take only a bit less than one neural net weight to carry the “information content” of a word of training data.

换句话说,我们可能会问,人类语言及其典型表达的“有效信息内容”是什么。有原始的语言示例语料库,然后还有 ChatGPT 神经网络中的表示。这种表示很可能远非“算法最小”的表示(我们将在下文讨论)。但这是神经网络容易使用的表示。在这种表示中,最终对训练数据的“压缩”似乎相当有限;平均而言,大约每个神经网络权重只携带了训练数据中一个词的“信息内容”。

When we run ChatGPT to generate text, we’re basically having to use each weight once. So if there are n weights, we’ve got of order n computational steps to do—though in practice many of them can typically be done in parallel in GPUs. But if we need about n words of training data to set up those weights, then from what we’ve said above we can conclude that we’ll need about n2 computational steps to do the training of the network—which is why, with current methods, one ends up needing to talk about billion-dollar training efforts.

当我们运行 ChatGPT 生成文本时,我们基本上需要一次性使用每个权重。因此,如果有 n 个权重,我们需要执行 n 个计算步骤,尽管实际上许多计算步骤通常可以在 GPU 中并行执行。但是,如果我们需要大约 n 个训练数据字来设置这些权重,那么根据我们上面的讨论,我们可以得出我们将需要大约 n² 个计算步骤来完成网络的训练——这就是为什么,使用当前方法,我们最终需要谈论十亿美元的训练投入。

11b115baeedf0f3d2a71f3879ae859df.jpeg

“点赞有美意,赞赏是鼓励”


http://www.ppmy.cn/news/1011140.html

相关文章

机器学习笔记 - 基于Python发现最佳计算机视觉模型的神经架构搜索技术NAS

一、简述 近年来,随着深度学习技术的兴起,计算机视觉领域取得了巨大进步。事实证明,卷积神经网络 (CNN) 在图像识别任务中异常强大,但针对特定问题设计最佳架构仍然是一项具有挑战性的任务。这就是神经架构搜索(NAS)发挥作用的地方。NAS 是一种尖端技术,可以自动发现高性…

ubuntu添加万能头文件

ubuntu的C头文件目录为/usr/include 在/usr/include下新建文件夹 bits sudo mkdir bits进入bits,新建stdc.h,并修改权限为744/777 cd bits;sudo touch stdc.h;sudo chmod 777 stdc.h将以下内容粘贴到stdc.h,保存退出 // C includes used …

流数据湖平台Apache Paimon(六)集成Spark之DML插入数据

文章目录 4.4. 插入数据4.5. 查询数据4.5.1 时间旅行4.5.2 增量查询 4.6 系统表4.6.1 快照表 Snapshots Table4.6.2 模式表 Schemas Table4.6.3 选项表 Options Table4.6.4 审计日志表 Audit log Table4.6.5 文件表 Files Table4.6.6 标签表 Tags Table 4.4. 插入数据 INSERT …

【ROS2】ROS2的框架知识

一、说明 对于初学ROS的同学,如果没有有效的学习规划,那么不妨看看该文,在这里,我们将对ROS2出现的知识板块进行介绍,期望对初识ROS2的同学起到导航作用。 二、ROS2的优势所在 2.1 ROS1的不足 ROS1项⽬的初衷是为了给…

Leetcode-每日一题【剑指 Offer 56 - II. 数组中数字出现的次数 II】

题目 在一个数组 nums 中除一个数字只出现一次之外,其他数字都出现了三次。请找出那个只出现一次的数字。 示例 1: 输入:nums [3,4,3,3]输出:4 示例 2: 输入:nums [9,1,7,9,7,9,7]输出:1 限制…

C语言错题之 8

前言: 今天依然是五道小题,都不难,主要是一些细节的知识。 这选择题做的真是让我大开眼界,长见识了(🤦‍) 1. 题干: 点击此处跳转 答案: ABCD 解析: …

无人驾驶实战-第八课(定位算法)

无人驾驶中定位的作用: 定位高精度地图:提供当前位置的静态环境感知 (车道线/交通指示牌/红绿灯/柱子/建筑物/等) 定位动态物体感知:将感知到的动态物体正确放入静态环境 定位获取位置姿态:用于路径规划/决…

Vue系列第八篇:echarts绘制柱状图和折线图

本篇将使用echarts框架进行柱状图和折线图绘制。 目录 1.绘制效果 2.安装echarts 3.前端代码 4.后端代码 1.绘制效果 2.安装echarts // 安装echarts版本4 npm i -D echarts4 3.前端代码 src/api/api.js //业务服务调用接口封装import service from ../service.js //npm …