查看原文
其他

GPT-4 混合模型:8 个 2200 亿参数的专家模型?

lencx 浮之静 2023-09-24

GPT-4:训练了 8 个 2200 亿参数的专家模型,这些模型使用不同的数据/任务分布进行训练,并进行了 16 次迭代推理。

注意:此文信息整理自播客 swyx 对 George Hotz 的采访,以及 Twitter 延伸出的讨论,并不一定代表事实,真实性大家自行判断。

播客

将千万亿次浮点运算商品化 —— 与小型公司的 George Hotz 交谈(Commoditizing the Petaflop — with George Hotz of the tiny corp[1]

swyx

swyx[2] 原名 Shawn,是一位备受瞩目的开发者、项目经理和天使投资人。他在开发者关系和开发者工具社区中作为博主和演讲者而知名。他是 GitHub Star 🌟[3] 和 Stripe 社区专家,曾经帮助运营超过 200,000 名开发者的 React 子论坛,并成功地将 Svelte Society 从零发展到超过 15,000 名开发者。

出生并成长在新加坡的 swyx,大部分职业生涯都在美国和英国度过。最近,他在佛罗里达州的迈阿密远程工作,为 Netlify、亚马逊网络服务、Temporal 和 Airbyte 提供开发者体验。目前在 Airbyte 担任开发者体验总监。

swyx 以其对开发者体验的热情和专业知识而闻名,他是公开学习运动的积极倡导者。对 React、JavaScript 和 Web 的未来的洞察性演讲和写作也赢得了业界的赞誉。他还以他的技术和书籍评论而知名,包括 TypeScript in 50 Lessons[4]Programming TypeScript[5]Landing Page Hot Tips[6]The GraphQL Guide[7]

在他的过去生活中,他曾是一名货币期权交易员,后来转行成为TMT对冲基金分析师,他经常从投资和风险管理的角度看待科技。最近,他还出版了 The Coding Career Handbook[8],为从初级到高级的工程师提供了更多建议。

George Hotz

George Hotz[9]:是第一个解锁 iPhone 的人,也是第一个破解 PS3 的人,后来他创立了Comma.ai[10],还曾在埃隆·马斯克运营的 Twitter 公司做过短暂的"实习"。

博客内容

Alessio: What are some of the numbers people should think of when they compare compute to like people? So GPT-4 was 100 person years of training. That's more like on the timescale. 20 petaflops is one person. I think you, right now the math was that for the price of the most expensive thing we build, which is the International Space Station, we could build one Tampa of. Yeah, yeah, one Tampa of compute. [00:43:16]

Alessio: 当人们将计算能力和人力进行对比时,他们应该考虑哪些数字呢?就像 GPT-4 花费了 100 个人年的训练时间。这更多的是在时间尺度上考虑。20 petaflops 的计算能力等同于一个人的计算能力。我想,现在的计算结果是,对于我们建造的最昂贵的东西——国际空间站,我们可以用它的造价来建造一个 Tampa 的计算能力。是的,我们可以建造一个 Tampa 的计算能力。[00:43:16]

"20 petaflops" 是指一种计算性能的度量。"FLOPS" 是 "每秒浮点运算次数" 的缩写,这是一个常用的计算机性能指标。"Petaflops" 则表示每秒可以进行一千万亿次浮点运算。这句话中的 “one person” 可能是将人脑的计算能力抽象为 20 petaflops,即人类大脑的信息处理能力大约等于每秒进行 20 兆次浮点运算。这种比较仅用于展示量级,并不精确,因为人脑的工作原理与计算机不同,不能完全通过浮点运算次数来度量。

Swyx: Yeah, which is the ultimate currency of measurement. [00:43:20]

Swyx: 是的,这就是最终的度量标准。[00:43:20]

George: Yeah, yeah, we could build. So like the biggest training clusters today, I know less about how GPT-4 was trained. I know some rough numbers on the weights and stuff, but Lama- [00:43:28]

George: 是的,我们可以建造。就像今天的最大训练集群,我对 GPT-4 的训练了解的不多。我只知道一些大致的权重数据,但是 Lama- [00:43:28]

Swyx: A trillion parameters? [00:43:30]

Swyx: 一万亿个参数?[00:43:30]

George: Well, okay, so GPT-4 is 220 billion in each head, and then it's an eight-way mixture model. So mixture models are what you do when you're out of ideas. So, you know, it's a mixture model. They just train the same model eight times, and then they have some little trick. They actually do 16 inferences, but no, it's not like- [00:43:45]

George: 嗯,好的,GPT-4 的每个头部有 2200 亿参数,然后它是一个八路混合模型。所以混合模型是你没有别的主意时才会采用的。所以,你知道,它是一个混合模型。他们训练了八次相同的模型,然后他们有一些小窍门。他们实际上做了 16 次推断,但是,这并不像- [00:43:45]

Swyx: So the multimodality is just a vision model kind of glommed on? [00:43:49]

Swyx: 所以多模态就是一种被强加上的视觉模型吗?[00:43:49]

George: I mean, the multimodality is like obvious what it is too. You just put the vision model in the same token space as your language model. Oh, did people think it was something else? The mixture has nothing to do with the vision or language aspect of it. It just has to do with, well, okay, we can't really make models bigger than 220 billion parameters. We want it to be better. Well, how can we make it better? Well, we can train it longer, and okay, we've actually already maxed that out. We're getting diminishing returns there. [00:44:13]

George: 我的意思是,多模态其实就是很明显的东西。你只需要把视觉模型放在与你的语言模型相同的记号空间中。哦,人们以为它是别的东西吗?混合模型与视觉或语言部分无关。它只与我们无法制作出超过 2200 亿参数的模型有关。我们想要让它变得更好。那我们怎么让它变得更好呢?好吧,我们可以更长时间地训练它,好的,我们其实已经把这个推到了极限。我们正在收获递减的回报。[00:44:13]

Swyx: Okay. A mixture of experts. [00:44:14]

Swyx: 好的。一种专家混合。[00:44:14]

George: Yeah, a mixture of experts. We'll train eight of them, right? [00:44:16]

George: 是的,一种专家混合。我们将会训练八个,对吧?[00:44:16]

Swyx: So, all right. [00:44:17]

Swyx: 所以,好吧。[00:44:17]

George: So, you know, the real truth is whenever a start, whenever a company is secretive, it's because they're hiding something that's not that cool. And people have this wrong idea over and over again that they think they're hiding it because it's really cool. [00:44:28]

George: 所以,你知道,真相是,无论何时,无论一家公司有多么保密,都是因为他们在隐藏一些并不那么酷的东西。人们一遍又一遍地错误地认为他们之所以保密,是因为那个东西非常酷。[00:44:28]

Swyx: It must be amazing. [00:44:29]

Swyx: 它必须非常棒。[00:44:29]

George: It's a trillion parameters. No, it's a little bigger than GPT-3, and they did an eight-way mixture of experts. Like, all right, dude, anyone can spend eight times the money and get that. Coming back to what I think is actually gonna happen is, yeah, people are gonna train smaller models for longer and fine-tune them and find all these tricks. OpenAI used to publish stuff on this, you know, [00:44:47]

George: 是的,它是一个万亿参数的模型。不,它只是比 GPT-3 大一点,他们做了一个八路的专家混合。好吧,任何人只要花八倍的钱就可以得到那个。回到我认为实际会发生的事情,是的,人们会更长时间地训练更小的模型,并对其进行微调,找出所有的技巧。OpenAI 以前会发布一些关于这个的信息,你知道,[00:44:47]

Swyx: when they would publish stuff [00:44:48]

Swyx: 当他们发布东西的时候。[00:44:48]

George: about how much better the training has gotten holding compute constant. It's gotten a lot better, right? Think, compare like BatchNorm to NoBatchNorm. [00:45:00]

George: 是关于如何在不改变计算量的情况下提高训练效果。它变得更好了,对吧?想想看,比如 BatchNorm 和 NoBatchNorm。[00:45:00]

Swyx: Is you're finding algorithms like FlashAttention? [00:45:02]

Swyx: 你是在找像 FlashAttention 这样的算法吗?[00:45:02]

George: Yeah, well, FlashAttention, yeah. And FlashAttention is the same compute. FlashAttention is an interesting fact where it's actually the identical compute. It's just a more efficient way to do the compute. But I'm even talking about like, look at the new embeddings people are using, right? They used to use these like boring old embeddings. Now, like, Lama uses that complex one, and now there's like Alibi. I'm not up-to-date on all the latest stuff, but those tricks give you so much. [00:45:23]

George: 是的,FlashAttention,是的。FlashAttention 是一个有趣的事实,它实际上是完全相同的计算。这只是一种更有效的计算方法。但我甚至在谈论像,看看人们现在使用的新嵌入,对吧?他们过去用这些无聊的老嵌入。现在,比如 Lama 使用那个复杂的,现在有像 Alibi 这样的。我没有跟上所有最新的东西,但是那些技巧给你带来了很多。[00:45:23]

Swyx: There's been a whole round trip with positional embeddings. I don't know if you've seen this discussion. I haven't followed exactly. [00:45:29]

Swyx: 有一整个循环关于位置嵌入的讨论。我不知道你有没有看到这个讨论。我没有完全关注。[00:45:29]

George: I mean, you quickly run into the obvious problem with positional embeddings, which is you have to invalidate your KV cache if you run off the context. So that's why I think these new ones, [00:45:38]

George: 我的意思是,你很快就会遇到位置嵌入的明显问题,那就是如果你走出上下文,你必须使你的 KV 缓存失效。所以我认为这些新的,[00:45:38]

Swyx: they're playing with them, [00:45:38]

Swyx: 他们正在尝试,[00:45:38]

George: but I'm not an expert on like the latest up-to-date language model stuff. [00:45:43]

George: 但我并不是最新语言模型的专家。[00:45:43]

Twitter 动态

🧵

Unexpected description of GPT4 architecture from geohotz in a recent interview he gave. At least it’s plausible.

在最近的一次采访中,geohotz 对 GPT4 架构的描述出人意料。至少它是可信的。

🧵

But why would they do this when they could scale? And @sama said explicitly that GPT-4 isn't going to have many more parameters than GPT-3, and this would be over x10

he implied that its a MoE which is loosely coupled idk, so maybe that doesnt count

Sam lies obviously. If he didn't want to, they would just publish a normal paper. But they decided to keep their tiny secret to make more money. Though I could imagine that a distilled version is 20*8 parameters too.

但是,既然他们可以进行扩展,为什么还要这么做呢?而且 sama 明确表示,GPT-4 的参数并不会比 GPT-3 多很多,而这个说法已经超过了 10 倍。

他暗示这是一个松散耦合的专家模型,我不知道,所以可能这个不算数。

显然,Sam 在撒谎。如果他不想这样做,他们会直接发布一篇正常的论文。但是他们决定保留他们的小秘密来赚更多的钱。尽管我可以想象,一个提取精华的版本也有 20*8 的参数。

🧵

So many questions! How did they choose 8? Datasets? Also, how effectively can they prune for specific tasks (assume small domain).

Interesting to see Bob Sutton’s (@work_matters) ~8 people in a meeting come back here in machine learning ensemble scaling 🤔

Thanks for that intuition. I imagine with experts willing to learn from each other without ego, that number is even lower. But I suspect it’s based on 8 internal teams and the benchmarks they are responsible for.

In other words, there really might have been 8 engineers in the room, each working on their benchmark.

他们为什么选择 8?数据集是怎样的?另外,他们如何针对特定任务(假设是小领域)有效地进行剪枝呢?


看到 Bob Sutton (@work_matters) 的约 8 人在一次会议中的理论在这里以机器学习集成扩展的形式再次出现,真是有趣。

感谢你的直观解释。我想如果专家们愿意放下自我,从彼此中学习,那这个数字可能会更低。但我怀疑这是基于他们的 8 个内部团队以及他们负责的基准。

换句话说,可能真的有 8 个工程师在房间里,每个人都在研究他们的基准。

🧵

Mark Zuckerberg said it was at least 10 times larger than their LLaMA-65B.

10 times larger than LLaMA-65B:
10 x (65 x 10^9)
= 6.5 x 10^11 (Zuckerberg)

8-way 220B parameter heads:
8 x (220 x 10^9)
= 1.76 x 10^12 (Hotz)

Parameter size estimates:
6.5 x 10^11 <= GPT-4 <= 1.76 x 10^12

马克·扎克伯格说,GPT-4 的规模至少比他们的 LLaMA-65B 大 10 倍。

LLaMA-65B 的 10 倍大:
10 x (65 x 10^9)
= 6.5 x 10^11 (扎克伯格的估计)

8 路 220B 参数头:
8 x (220 x 10^9)
= 1.76 x 10^12 (Hotz的估计)

参数大小估计:
6.5 x 10^11 <= GPT-4 <= 1.76 x 10^12

Mark Zuckerberg: Future of AI at Meta, Facebook, Instagram, and WhatsApp | Lex Fridman Podcast[11]

拓展阅读

通过无监督领域发现扩展专家语言模型

论文:Scaling Expert Language Models with Unsupervised Domain Discovery[12]

大型语言模型通常进行密集训练:所有参数都相对于所有输入进行更新。这需要在数千个 GPU 中同步数十亿的参数。我们引入了一种简单但有效的方法,来对任意文本语料库进行大型稀疏语言模型的异步训练。我们的方法将语料库聚类为一组相关文档,在每个聚类上训练一个单独的专家语言模型,并在推断时将它们组合成一个稀疏集合。这种方法通过自动发现每个专家的领域,来泛化平凡并行训练,并消除了现有稀疏语言模型几乎所有的通信开销。我们的技术在多个语料库和少数样本任务上优于密集基线,我们的分析显示,将专家专门化到有意义的聚类是取得这些增益的关键。随着专家的数量和训练数据的大小的增加,性能也有所提升,这表明这是一种高效且易于访问的大型语言模型训练方法。

为何大团队低效:七(正负二)再次成为神奇的数字

Why Big Teams Suck: Seven (Plus or Minus Two) Is the Magical Number Once Again[13]

在“大团队的弊端:七(正负二)再次成为神奇的数字”这篇文章中,Bob Sutton 阐述了一个看似平常,但常被忽视的观点:过大的团队或组织规模会对效率、社会纽带产生负面影响,并可能导致不必要的冲突。他引用了英国海军历史学家 Northcote Parkinson 的观点,描绘了一个规模过大的典型委员会如何变得效率低下,所有重要的工作最终仍由少数关键成员完成。

多项研究证实了,随着团队规模的增加,工作并不会变得更轻松。哈佛研究员 J. Richard Hackman 的研究甚至显示,最佳的团队规模是四到六人,超过十人则可能导致“性能问题和人际摩擦指数级增加”。过大的团队规模会带来认知负荷,成员在协调工作上的时间花费越来越多,同时也容易引发误解和错误。

这个观点既适用于小型组织,也适用于大型组织。Pulse News 公司在扩大规模后,沟通和误解问题开始增多,但当他们将人员重新分组后,软件的产出速度提高,争论减少。每个团队都有一个公告板记录他们的工作,每天下午也会对公司进行简短的报告,这有助于保持清晰的信息交流。

Sutton 提出了一个观点,如果大团队常常出错,团队成员间的关系冷淡,相互争斗,那么可以尝试减少或分解团队规模。哈佛商学院的 Melissa Valentine 和 Amy Edmondson 在一家大型医院的急诊科进行的研究验证了这一观点。他们发现将医护人员分成多个六人小组后,关于患者的信息流动更快、更准确,且人际关系也明显改善。

创建小组后的效率提升也十分显著。数据显示,在创建小组后的一年内,急诊科为 16 万名患者提供服务的平均就诊时间从八小时减少到五小时,这并未增加员工的工作压力,同时也提升了患者的体验。

总结来看,规模化需要既要增加又要减少。尤其在团队规模上,许多手并不总是能使工作变得轻松。当一个团队陷入功能失调的冲突,或者表现出冷漠,做出错误的决定,或者错过了截止日期,那么问题的根源可能就在于团队规模过大。在这种情况下,适当的减法或除法往往能带来显著的改善,使领导者变得更有效,提高效率,减少人际摩擦,让陌生人变成朋友。

References

[1]

Commoditizing the Petaflop — with George Hotz of the tiny corp: https://www.latent.space/p/geohot#details

[2]

swyx: https://www.swyx.io/about

[3]

GitHub Star 🌟: https://stars.github.com

[4]

TypeScript in 50 Lessons: https://twitter.com/swyx/status/1361712610593316866

[5]

Programming TypeScript: https://twitter.com/swyx/status/1135525665971695617

[6]

Landing Page Hot Tips: https://twitter.com/swyx/status/1303062410157158401

[7]

The GraphQL Guide: https://share.transistor.fm/s/aebece15

[8]

The Coding Career Handbook: https://learninpublic.org

[9]

George Hotz: https://en.wikipedia.org/wiki/George_Hotz

[10]

Comma.ai: https://comma.ai

[11]

Mark Zuckerberg: Future of AI at Meta, Facebook, Instagram, and WhatsApp | Lex Fridman Podcast: https://youtu.be/Ff4fRgnuFgQ

[12]

Scaling Expert Language Models with Unsupervised Domain Discovery: https://arxiv.org/abs/2303.14177

[13]

Why Big Teams Suck: Seven (Plus or Minus Two) Is the Magical Number Once Again: https://bobsutton.typepad.com/my_weblog/2014/03/why-big-teams-suck-seven-plus-or-minus-two-is-the-magical-number-once-again.html

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存