"So what matters when training LLMs? One is the architecture. Another component is the training loss and training algorithm. Then it's data. And evaluation. And then the system component. … I'm actually not going to talk about the architecture today. One, because I gave a whole lecture on transformers a few weeks ago. And two, because you can find so much information online. I think there's much less information about the other four topics."
💡 "Most of academia actually focuses on architecture and training algorithm… But in reality, what matters in practice is mostly the three other topics: data, evaluation, systems. That's what most of industry actually focuses on."
他自嘲道:"I was one of those researchers for a large part of my career."——他自己也是做了很多年架构创新的人,但现在回头看,小改激活函数、调调层数,在 Scaling Laws 面前只是"改变截距"。
这是整场讲座的核心立场:工业界务实主义 vs 学术界创新偏好。他后来反复引用 Richard Sutton 的 "Bitter Lesson" 来支撑这个观点——算力持续指数增长,唯一重要的是能随算力扩展的方法,而不是精心设计的巧技。
🧠 二、"预测下一个词"——语言建模的极简哲学
🎙️
"Language models at a high level are simply models of a probability distribution of sequences of tokens. If you have a sentence like 'the mouse ate the cheese', the language model gives you a probability of this sentence being uttered by a human."
P("the mouse ate the cheese")
= P(the) × P(mouse|the) × P(ate|the mouse) × P(the|the mouse ate) × P(cheese|the mouse ate the)
这是概率论的链式法则,没有任何近似。代价是——生成时只能一个词一个词地来:生成第 n 个词时,前面 n−1 个词都必须作为上下文输入。句子越长,生成越慢。
训练 vs 推理:同一个任务,两个模式
训练时
推理时
做什么
计算真实 Token 的概率,和 one-hot 标签做交叉熵
从概率分布中采样下一个 Token,拼回去再跑一遍
并行?
✅ 可以(所有位置的 Token 已知)
❌ 不行(后一个依赖前一个)
目标
最大化对数似然
产生流畅文本
讲者特别强调了一个容易被忽略的点:"The last two steps only needed during inference. When you do training, you just need to predict the most likely token."——训练时不需要采样!这是一个纯分类任务,所有优化技巧(批量并行、Teacher Forcing)都建立在这个事实上。
🔤 三、Tokenization:"This is one thing people usually don't talk that much about"
🎙️
"Tokenizers are extremely important. It's really important that you kind of understand at least what they do at a high level. … Honestly, I think a lot of people think we should just get away from tokenizers."
"For a long time, different companies and organizations were using different ways of evaluating MMLU. As a result, you get completely different results. For example, LLaMA 65B had 63.7 accuracy on HELM, but 48.8 on this other benchmark. So really, the way that you evaluate matters."
❓ 学生问:怎么确保这些模型没在 benchmark 上训练过(数据污染)? 讲者答:"One trick is: most datasets online are not randomized. You look at the entire test set. If it's more likely to generate examples in order versus shuffled, then it was probably in the training set."——如果按原始顺序生成比打乱顺序更容易,说明模型"记得"这些数据。
🗄️ 五、"你下载一个随机网页看看,会震惊的"
🎙️
"People say 'train on all of internet'. What does that even mean? Internet is very dirty and really not representative of what we want. If I download a random website right now, you would be shocked at what is in there. It's definitely not your Wikipedia."
讲者随后展示了一个 Common Crawl 里的真实页面——HTML 源码混杂,正文被埋在一堆标签里,有些句子甚至没写完:"Testing World is your ultimate source for the System X high performance server…" 后面直接截断。
📈 六、"It looks innocuous, but it's crazy"——Scaling Laws
🎙️
"It looks innocuous when you look at these type of plots, but that's crazy, because it means that you can predict how well we're going to perform in 2–3 years, depending on how much compute we will add."
❓ 学生问:这个 Scaling 还会持续下去吗?会 plateau 吗? 讲者答:"It is still holding, surprisingly. Will it happen? Probably. It doesn't need to—because it's on log scale. It could continue decreasing like this. Most people think they will probably plateau at some point. We all know when." ——目前还没有平台期的信号,但在 log 尺度上每进一步都需要指数级增加的算力。
💰 七、"假设我给你 10,000 张 GPU 一个月,你训练什么模型?"
🎙️
"Imagine I give you 10,000 GPUs for this month. What model will you train? How do you even go about answering that question? This is hypothetical, but that's exactly what these companies are faced with."
随后他用 Llama 3 405B 做了一次现场估算:
项目
数值
备注
参数量
405B
训练 Token
15.6T
约 40 tokens/param
总算力
~3.8×10²⁵ FLOPs
公式:6 × params × tokens
GPU 数量
16,000 × H100
训练时长
~70 天
GPU 租金
~$5,200 万
$2/h × 2600 万 GPU 小时
人员
~$2,500 万
50 人 × $500K/年
总成本
~$7,500 万
Meta 官方报 3000 万 GPU 小时
🎙️ 讲者(一个微妙的细节):"They went 2× less than the Biden executive order threshold of 10²⁶ FLOPs—so they really went right below this to not have special scrutiny."——算力是故意控制在审查阈值以下的。
关于碳排放,他给了一个出乎意料的视角:"Only 2,000 return tickets from JFK to London. Right now, carbon emitted is not a meaningful issue yet. GPT-6, GPT-7, once you multiply by 100, that might become a real issue."
🎯 八、从 GPT-3 到 ChatGPT 的那一跃
🎙️
"If you ask GPT-3, which is a pure language model, 'Explain the moon landing to a 6-year-old,' the completion you get is something like 'Explain the theory of gravity to a 6-year-old.' Because what it learned is that on the internet, if you have one question, you usually have another bullet point of similar questions. This is not what you want from an AI assistant."
这是讲座中最生动的对比。GPT-3 不是不会——它只是学会了错误的格式。互联网上,"Explain X to a 6-year-old" 后面通常跟着 "Explain Y to a 6-year-old",而不是真正的解释。
后训练的核心任务就是纠正这个:让模型的输出分布,从"互联网的文本分布"变成"助手的行为分布"。
这就解释了为什么后训练不是"教模型新知识"——模型在预训练阶段已经学完了所有语言和知识。后训练只是在选择哪种输出风格。用讲者的话说:"You're not teaching anything new in SFT. All you do is tell the model to optimize for one type of user."
📝 九、SFT 的震撼发现:2000 条就够了
🎙️
"What LIMA showed is that if you scale the amount of data for SFT from 2,000 to 32,000, it really doesn't help much. Scaling laws definitely don't help here. The intuition is that all you learn is how to format your desired answers."
💡 "What if the human gives an answer that the model didn't know was true? From the model's perspective, you the human are telling the model: generate this thing that seems plausible. But actually, I have no idea if it's true or not. Hallucination might be caused by this SFT."
这是对幻觉成因的一个非常原创的解释——不是模型"不知道",而是 SFT 教了它错误的策略。这也能解释为什么 RLHF 有助缓解幻觉:偏好数据(A 比 B 好)可以惩罚编造行为,而 SFT 的行为克隆做不到这一点。
🔄 十、RLHF:让人类只做擅长的事
🎙️
"Humans won't generate the best possible answer. If you ask me to write a book, I can definitely judge which book is better, but I'm not going to be as good at writing the book I want to read. You're bound by human ability to generate things, even though humans are better at distinguishing."
"The key idea of DPO is that instead of using reinforcement learning, you can just maximize the probability of generating the stuff you like, and minimize the probability of the stuff you don't like. All the rest is chosen such that the global minima of PPO and DPO—under some assumptions—are essentially equivalent."