Building a Language Model from Scratch with Felix Rieseberg
打开互动全文版(中英对照 + 朗读 + 问答)→Felix Rieseberg 做客节目,畅谈他让 AI 变得平易近人的教育性语言模型构建器,让任何人都能亲手构建并理解语言模型。
Felix Rieseberg joins Scott Hanselman to discuss his educational language model builder that makes AI approachable by letting anyone build and understand language models themselves.
对,正是如此。所以一切都源于:好吧,我们怎么才能在一天之内让它勉强说出句子?比如我昨天试了一下。我为了好玩,在最新版本上又训练了一个小模型,只给了它一天时间,它说出来的东西特别可爱。但我问它太阳是什么,它说,哦,太阳是地球底部的一个月亮——这确实是个真正的句子。
Yeah, exactly. So everything sort of flowed from, okay, how do we get to somewhat work in sentences in one day? Like I tried it yesterday. I trained another small model just for fun on the latest version, and I only gave it a day, and it's saying really cute things. But it's like, I ask it what is the sun, and it's like, oh, the sun is a moon at the bottom of the earth, which is a real sentence.
这其实有点像——这是深刻还是只是蠢?
That's actually kind of like, is that deep or is that just dumb?
就是蠢。
It's just dumb.
这是两岁小孩才会说的话。就像,太可爱了。
That's something a two-year-old would say. It's like, that's adorable.
嗯,酷的地方在于,它甚至能理解我在问太阳的事,而且它给我的回答——甚至它能理解我在问它一个问题、它应该回答,对吧?
Well, like the cool thing is that it's like even understanding that I'm asking about the sun, and it's giving me like, even like the fact that it understands that I'm asking it a question, it should answer, right?
嘿,朋友们,我是 Scott Hanselman,这是又一期 Hanselminutes。今天我很荣幸和 Felix Rieseberg 聊天。他长期致力于打造令人愉悦的开发者工具,那些你用过的工具。他在 Slack 工作过,参与过 Electron,也在微软工作过。他最近的副业项目非常受欢迎,因为它们让 AI 变得平易近人,而不只是追逐基准分数。他最新的语言模型构建器正是这一传统的延续。它基本上是一个教育类应用,让你亲手构建并理解语言模型本身。你好吗,先生?
Hey friends, I'm Scott Hanselman, and it's another episode of Hanselminutes. Today I have the pleasure of chatting with Felix Rieseberg. He has a long history of building delightful developer tools, tools that you have used. He's worked at Slack. He worked on Electron. He worked at Microsoft. And his recent side projects have become very popular because they make AI feel approachable rather than just chasing benchmark scores. And his latest language model builder is in that tradition. It's basically an educational app that lets you build and understand language models themselves. How are you, sir?
我很好。谢谢你,Scott。谢谢你邀请我。我一直想来上这个节目。
I am doing well. Thank you, Scott. Thanks for having me on. Always wanted to come to the show.
我很感激。其实很多很多年前就该请你来了,因为我们也共事过一段时间。我一直很喜欢你做的东西。你有时候就是会做些古怪又讨喜的东西。你就像,哦看,这是 Clippy。这是跑在浏览器里的 Windows 95。为什么?就因为好玩,没别的理由。而且你一直在做开源,做了很久。你在微软做过开源工程师。你通过把东西放到 GitHub 上,努力让人们的生活更好。所以你总是从人文视角出发,这一点我很欣赏。现在你的本职工作是 Anthropic,但这期播客不是关于 Anthropic 的。这是关于你,以及你在做的那些酷东西。不过我们还是要提一句,你负责 Claude AI、co-work 和 Code Desktop 的工程。所以也许改天我们再做一期,但今天这期是讲别的。
I appreciate that. That should have had you on many, many years ago, you know, because we worked together for a time. I always loved the stuff that you do. You sometimes you'll just do weird delightful stuff. You just like, oh, look. Here's Clippy. Here's Windows 95 running in a browser. Like, why? Because it's delightful for no other reason. But, you know, you work uh you've been working in open source forever. You worked at Microsoft as an open source engineer. Um you tried to make people's lives better by putting things on GitHub. So, you always come at things from a humanistic perspective, which I appreciate. Now, you do in your day job work at Anthropic, but this this podcast is not about Anthropic. This is about you and the cool stuff that you're building. But we do want to shout out that you do lead engineering for Claude AI, for co-work, and for for Code Desktop. So, maybe we'll have another show another day, but this is about something else.
有个叫 Ben Eater 的人,做的是从零开始造处理器。
There's a guy named Ben Eater who makes a create-your-own-processor from scratch.
对。
Yeah.
好。他就像,嘿,我们来搞这些,我们要从零开始造。就像我们拿两块石头互相敲出火花。我们要用 7400 系列零件。我们要把它焊起来,在这个疯狂实验的最后,你会得到一台能说 hello world 的计算机。
Okay. And he's like, hey, let's go and get these like we're going to build it from scratch. Like we're going to get two rocks and we're going to spark them together. We're going to get 7400 series parts. We're going to solder it and at the end of this crazy experiment, you will have a computer that can say hello world.
对,听起来——我觉得你做到了。我觉得你用语言模型构建器做到了这件事。
Yeah, that sounds— I feel like you did that. I feel like you did that with language model builder.
这大概是这周别人对我说过的最好听的话了。我觉得这差不多就是目标,对吧?我做语言模型构建器,是因为我在 AI 领域也待了一小段时间了。你提到我们曾在微软共事。不知道你记不记得 Project Oxford,那个——
That's like the nicest thing anyone has said to me like this week. I think that's sort of the goal, right? Like I looked at language model builder because I've been in AI for like a little bit now. And you mentioned that we were at Microsoft together. I don't know if you remember project Oxford, like from—
哦,记得。
Oh yeah.
对。里面有个 n-gram 模型,那时候我在微软级别很低,但我给那个 n-gram 模型做了 npm 模块。你给它一个词,它会想上五分钟,然后回来说,啊,worldwide web,也许这是对你刚给我的词一个不错的补全。
Yeah. There was like an n-gram model in there, and back then I was super junior at Microsoft, but I made like the npm modules for that n-gram model, and you could give it like a word and it would think for five minutes and it would come back with like, ah, worldwide web, maybe that's like a good completion of like what you just gave me.
显然 AI 进步得非常剧烈,但我发现自己经常要跟人解释这东西。我觉得 AI 酷的一点是,对我来说,核心想法——我不想说简单,但我认为其实相当简单、很好理解——与它们看起来有多神奇之间的落差太大了,以至于我经常把人按下来,说,好吧,拿张餐巾纸,我来给你演示语言模型是怎么工作的。至少对我来说,这比向别人解释现代芯片怎么工作要容易得多。我完全不知道现代芯片怎么工作。对我来说那全是黑魔法,对吧?有时候我看那些纳米级示意图,就想,这看起来很难解释。
And obviously like AI has moved pretty dramatically, but I find myself like explaining the thing to people a lot. And I think one thing that is cool about AI is that for me the perceived delta between how— I don't want to say simple, but the core ideas I think are actually quite simple and very understandable— to how magical they are is like so big that I often find myself sitting people down, be like, all right, let's take a napkin, I'm going to show you how a language model works. And I think for me at least that feels so much easier than explaining to someone how like a modern chip works. I had no idea how a modern chip works. To me, it's like all black magic, right? Like sometimes I look at the nanometer diagrams and I'm like, this seems hard to explain.
有个漫画家叫——那漫画叫《The Far Side》。那是周日报纸上会登的漫画,两个科学家坐在白板前,上面有一堆复杂的计算和数学符号,中间有个小闪光。看起来很像 Claude 的那个闪光。然后写着:一个奇迹。右边又是一堆复杂的数学。另一个科学家说,我觉得第二步这里你需要再具体一点。我觉得现在的语言模型就是这样:我们能理解数字 10,然后乘以 10,再乘以 10。但一旦加上几个数量级,我们就只能说,然后奇迹发生了。
There was a cartoon from a guy called— it was called The Far Side. It was like a cartoon that they would have in this Sunday newspaper, and there's two scientists sitting in front of a whiteboard and they've got a bunch of complicated calculations and math symbols and then a little sparkle in the middle. It looks a lot like the Claude sparkle. And then it says, a miracle. And then on the right of it, there's like a bunch of other complicated, you know, math. And the other scientist says, I think you need to be a little more specific here in step two. I feel like that's what's going on with language models right now is that like we can understand the number 10. We can then times that by 10 and then times that by 10. But then you add a couple of orders of magnitude and then we just go, and then a miracle happens.
而现在这个魔法猜词器感觉像个人了。
And now the magic word guesser feels like it's a person.
对,对,正是。我觉得这特别酷,尤其是——你提到我的本职工作。在本职工作里,我有幸能看到烤箱里的 Claude 宝宝,看着它演化、成长。而你能享受到看着一个东西把随机词拼在一起,得到完整的词语沙拉,得到一堆完全乱码的字符,然后看着它在采样中从,你知道,一头栽在键盘上,到,哦,我认出其中一些声音了,再到,哦,现在有句子了——这很酷。非常有趣。跟自己造出来的东西聊天非常有趣,哪怕它只是个模型。那是一种深深的愉悦体验。
Yeah. Yeah. Exactly. And I think it's so cool, especially— I think you mentioned my day job. Like in my day job I get the privilege of like, you know, seeing baby Claude in the oven and just seeing it evolve and grow. And you get the joy of watching something just like put together random words and like you get these complete word salads and you get like this complete noise of characters back, and like watching that in sampling go from just, you know, face planting onto your keyboard to like, oh, I recognize some of those sounds, to like, oh, now a sentence is happening, is pretty cool. It's very fun. It's very fun to like talk to something that you made, even if it's just a model. It's just like a deeply enjoyable experience.
但这里难道没有一个飞跃吗?难道没有一个时刻,它就从很酷的下一个词预测器,变成了感觉比鹦鹉还聪明?这部分我不理解。我们是怎么从猜词器到鹦鹉,再到人们把这东西当心理治疗师一样跟它说话——这挺让人担忧的。
But isn't there a leap? Isn't there a moment there where it's just like, that went from cool next-token guesser to this feels smarter than a parrot? That's the part I don't understand. How do we get from word guesser to parrot to people are talking to this thing like it's their therapist, which is concerning.
对。我觉得这就进入那些非常深的——天哪。但我得小心,别在这上面太招人烦。我进入计算机领域比较晚。我学的是诗歌。后来某个时候我发现诗歌工厂不招人,得另想办法赚钱。
Yeah. I think there you go into these like deeply— God. But I got to be careful not to be too annoying in this. I came to computing fairly late. I studied poetry. I at some point discovered that the poetry factory was not hiring and like needed to make money some other way.
然后我想我现在是在做软件。但我认为语言模型给了我们一个非常有趣的机会来讨论所有这些大概念,对吧?比如我们已经有了关于道德主体性的重要讨论。比如我们到底在什么时候才认真考虑一个模型是否具有道德主体性?但它也给了我们这些非常有趣的想法,比如,你知道,某样东西有智能意味着什么?显然我们知道它是如何工作的。如果你获得了有意义的治疗洞察,你会用它做什么,对吧?我认为那里的问题可能比语言模型如何工作要大得多。它们更多是关于,比如,我们是不是都只是鹦鹉?它在哪里失效?对吧。
And then I guess now I'm building software. But I think language models give us such an interesting opportunity to talk about all of these big concepts, right? Like we already have these big conversations about moral patienthood. Like at what point do we even consider seriously whether or not a model gets moral patiency? But it also gives us these really interesting ideas about, like, you know, what does it mean for something to be intelligent? Like clearly we know how it works. If you get meaningful therapeutic insight, what do you do with that, right? And I think the questions there are probably much bigger than, like, how does the language model work? And they're more about, like, are we all just parrots? Like, where does it break down? Right.
是的。是的。我试着向人们解释上下文窗口,我在演讲中总是举的例子是:今天天气真好,我们去……然后模型总是选择公园或海滩。
Yeah. Yeah. I try to explain context windows to people and the example I always give in my talks is: it's a beautiful day, let's go to the... and then the model always picks park or beach.
然后你给它一点上下文,你告诉它你在伦敦,它会说我们去伦敦眼吧。你告诉它你在柏林,我们去这里吧。你告诉它你在波特兰,我们去那里吧。上下文越多,词语猜测就越好。然后你说,嗯,你是 Scott Hanselman,你已经结婚 25 年了,现在是周六下午,答案是我们要去百吉饼店,因为那是我和妻子过去 25 年常去的地方。
And then you give it a little context, you tell it you're in London, it'll say let's go to the London Eye. You tell it you're in Berlin, let's go to here. You tell it you're in Portland, let's go there. And the more context, the better the word guessing gets. And then you say, well, you're Scott Hanselman and you've been married for 25 years, it's a Saturday afternoon, and the answer is we'll go to the bagel shop because that's where my wife and I go for the last 25 years.
哦,太美了。
Oh, beautiful.
那是我们的周六传统。那么问题来了,我是不是只是一个她忍受了 25 年的大语料库,她知道要猜那个,因为她是我的个性的词语猜测者,而我只是在编造东西吗?
That's our Saturday tradition. So then the question is, am I just a big corpus at 25 years of her putting up with me and she knows to guess that because she's the word guesser for my personality and am I just making stuff up?
是的。
Yeah.
或者存在自由意志,然后就是另一回事了?
Or is there free will and then it's a whole thing?
是的。是的。就像你很快,你很快,或者至少我,这是一个非常个人的经历,但我认为这是让我构建这个语言模型构建器东西的部分经历,但就像当我盯着模型或大模型时,我有时会有和盯着篝火、森林或星星时一样的感觉。
Yeah. Yeah. Like you very quickly, you very quickly or I at least this is like a very personal experience but I think it's like part of the experience that had me build this language model builder thing but like when I stare at the model or like the big models I sometimes get the same feeling that I get when I like stare at the campfire or like a forest or like the stars.
对。就像这个概念,我认为人们有不同的经历,但就像我去天文馆时的经历,我喜欢天文馆,对吧,我就喜欢坐下来,我感到如此渺小和微不足道,它真的让我思考人类经验的独特性,老实说,大语言模型,当我看着这个,就像统计,就像数学,对吧,当我们看一个语言模型时,我在这里的意思是,我可能对某个特定应用或某个特别训练的模型不那么兴奋,但如果我把模型看作核心思想,我们有数学,而我在和数学对话。
Right. Like this notion of I think people have different experiences but like the experience I have when I look at when I go to a planetarium I love the planetarium right I just like sit down and I feel so small and insignificant and it really makes me consider the uniqueness of the human experience and like honestly the big language models when I look at when I look at this like statistical like just math right like when we look at a language model what I mean here is I'm like less excited maybe about a particular application or like a particularly trained model but like if I look at a model as the core idea of we have math and I'm talking to the math.
我有点感觉像是宇宙在回望着我,那是一种非常酷的体验,因为它让我重新思考自己,以及我如何把词语组合在一起,你知道吗?
I sort of feel like the universe is like staring back at me and that is a very cool experience because it makes me reconsider myself and like how do I put words together, you know?
对。
Right.
嗯,语言模型构建器在 languagemodelbuilder.com。你现在就可以下载。目前它只在 Mac 上运行,并且需要 Apple Silicon,所以请注意。你从一种互动书开始,你知道,它更像是一个比 PDF 更丰富的东西。你可以点击一切。一切都可以改变。每个,呃,它有点像《纽约时报》最好的部分,当你去看那些《纽约时报》的信息图表时,你会说:“哦,天哪,那不是 GIF。我可以点击那个。天哪,太棒了。”
Well, language model builder is at languagemodelbuilder.com. You can just download it now. Right now it only works on a Mac and it expects Apple Silicon so be aware. And you start with a kind of an interactive book, you know, it's like a it's more than a PDF. You're every thing can be clicked on. Everything can be changed. Every uh it's kind of like the best of the New York Times when you go to one of those New York Times infographics and you're like, "Oh man, that's not a GIF. I can click on that. Holy crap, that's awesome."
我要把其中一些引用打印出来,然后挂在我的办公室里。
I'm going to I'm going to print some of those quotes and just like hang them in my office.
哦,你可以全部拿走。这是我的节目,也是你的节目,我的朋友。所以,如果你想让我推荐你的产品,你可以尽情推荐我。现在,我想指出的是,当你讲到分词器部分时,你说,
Oh, you can take it all. This my show is your show, my friend. So, if you want me to blurb blurb your product, you can blur me as much as you want. Now, I want to call out though when you get to the tokenizer part and you say,
“我要写我自己的分词器,字节级分词器”,你可能只有 10,000 个词的词汇表。所以,那可能就像个婴儿,对吧?
"I'm going to write my own tokenizer bite level tokenizer," you might just have a vocabulary of 10,000 words. So, that might be like a baby, right?
是的。
Yeah.
然后你可以做一个类似 GPT-2 的东西。我认为重要的是让人们记住,就像 GPT-5,之前还有四个其他版本,它们做了些事情,对吧?所以你基本上是把人们放在曲棍球棒曲线弯曲部分之前,对吧?你是在说,就在一切爆发之前,这是我们可以制作的模型大小,人类大脑仍然能理解。
And then you can make like a GPT2. And I think it's important for people to remember that like GPT5, there were four others before that and they did stuff, right? So you're basically putting people just before the bendy part of the hockey stick of the graph, right? You're saying right before everything exploded, this is the size of a model we can make where the human mind can kind of still get it.
这就是为什么我用 Ben Eater 的东西作为例子,因为人类可以完全且 100% 理解 6502 微处理器,
Which is why I use that Ben eater thing as an example because a human being can completely and 100% understand a 6502 microprocessor,
对吧?
right?
他们无法理解奔腾处理器,他们不可能理解像 Apple Silicon 这样的东西,并把它保持在他们的上下文窗口中。是的。你是如何决定语言模型构建器的合适大小,以便你能理解全部内容,因为我认为你成功做到了。
They cannot understand a Pentium and they there's no way they can understand like Apple silicon and and hold it in their context window. Yeah. How did how did you decide the right size for language model builder to be so that you could understand it all because I think you succeeded in doing that.
嗯,我认为这可能不像我们现在看起来那么有策略性。但基本上我是从,好吧,我的朋友、我的家人,我可以假设什么样的注意力持续时间,
Um I think it was probably like less strategic than it might seem like now that we look at it. But it was I was basically working backwards from okay my friends, my family, like what kind of attention span can I assume,
对吧?我们能在那个时间内训练什么?分词器是一个很好的例子,因为我实际上最终选择了大约 10k 的分词器,那个非常小的,但主要是因为在个人电脑上运行它,比如 M4 Max,我认为那台电脑总体来说相当不错。即使使用后来的分词器,你花太多时间只是对语料库进行分词,你就像盯着,你就像,你知道,
right? What can we train within that time? And the tokenizer is a good example because I actually I eventually settled on the like 10k tokenizer, the one that is like very small, but mostly because running it on my personal computer is like an M4 Max, which I think is like a pretty good computer all things considered. And with even with later tokenizers, you spend so much time just tokenizing the corpus that you just like stare you're just like, you know,
你只是盯着预训练。甚至不是预训练,只是在分词器上空转。
you're just staring at the pre-training. Not even pre-training, just spinning its wheels on the tokenizer.
就像给宝宝捣碎食物。你只是坐在那里捣碎土豆。
It's just like mashing up a food for a baby. You're just sitting there mashing up potatoes.
是的,没错。所以一切都源于,好吧,我们怎样才能在一天内让模型说出有点意义的句子?比如我试过。昨天我为了好玩在最新版本上训练了另一个小模型,我只给了它一天时间,它说了非常可爱的东西,但就像我问它太阳是什么,它说哦太阳是地球底部的月亮,这确实是一个真实的句子。
Yeah, exactly. So everything sort of flowed from, okay, what can we how do we get to somewhat work in sentences in one day? Like I tried it. Yesterday I trained another small model just for fun on the latest version and I only gave it a day and it's saying really cute things but it's like I ask it what is the sun and it's like oh the sun is a moon at the bottom of the earth which it is a real sentence.
那实际上有点像,那是深刻还是只是愚蠢?
That's actually kind of like is that deep or is that just dumb?
只是愚蠢。嗯
It's just dumb. Um
那听起来像是一个 2 岁孩子会说的话。就像,那太可爱了。
that sounds like a thing a 2-year-old would say. It's like that's adorable.
嗯,很酷的一点是,它甚至能理解我在问太阳,然后给我——光是它能理解我在问它一个它应该回答的问题,对吧?光这一点就已经——或者说它知道那是一个天上的圆形东西。向量空间至少有一定的邻近性,比如“月亮”和“太阳”在空间里是挨着的。
Well, the cool thing is that even understanding that I'm asking about the sun and giving me — even the fact that it understands that I'm asking it a question it should answer, right? That alone is — or that it's a round thing in the sky somewhere. The vector space at least has some amount of proximity where it's like, okay, moon and sun are near each other in the space.
对。
Yeah.
然后另一件事是,我大概做了三个不同版本的这个应用。第一个版本只是那本教科书,我原本想要的是——你提到过那些“游乐场”,但有一些小游乐场,比如“把你的语料给我,我们一起做一个分词器”。我最初的想法是,哦,在那本教科书的最后你会得到一个模型。但很快我就发现,我想要一点我们在行业里看到的那种创新。所以在某个时候我做了个决定,把游乐场单独拆出来,说好吧,我们先学基础,然后再动手构建。但我不想让这个跨度太大,对吧?这样你学的东西仍然能用得上。
And then the other thing that happened is I sort of lowered like three different versions of this app. The first version was just the textbook, and what I kind of wanted was — you mentioned these playgrounds, but there are these little playgrounds of like, okay, give me your corpus, we'll make a tokenizer together. And the initial idea I had was, oh, at the end of that textbook you have a model. But then very quickly I found myself wanting just a little bit of innovation that we found in the industry. So at some point I made the call to separate out the playgrounds and say, okay, we're going to learn the foundations and then we're going to build. But I didn't want the gap to be too big, right? Just so that what you're learning is still applicable.
你说得对。分词器就是个很好的例子。现代的分词器——里面有点太多“魔法科学”了,人类很难快速理解。
Guess you're right. Like tokenizers is a great example. Like the modern tokenizers — they're just a little too much magical science going on for a human to quickly understand.
我有个比喻,大家都听腻了,但学开手动挡、手动换挡,会改变你和这辆车的关系。
I have an analogy that I use that everyone is sick of hearing, but learning to drive stick shift, manual shift on a car, changes your relationship with the vehicle.
对。
Yeah.
一个语言模型构建者,本质上会改变你和聊天机器人、和大语言模型的关系,因为现在突然你会觉得——在我们跟这个机器人对话之前,我们要先把这辆车拆开,聊聊内燃机和它的历史。
A language model builder would by its nature change your relationship with a chatbot or with a large language model, because now suddenly you're like — before we get to talk to the bot, we're going to take apart this car and we're going to talk about the internal combustion engine and the history of that.
你没有太深入历史。你没讲 40 年前的 Eliza 之类的。你是怎么平衡的?有纯数学的部分——你基本假设 Transformer 已经存在,但并没有真正解释它从哪来、过去 50 年发生了什么。你有没有考虑过历史背景、数学背景,还是只解释我们当下所处的时刻?
You don't go too deep into the history. You don't talk about like 40 years ago, Eliza, you know. How did you balance there? There's the pure math — there you just kind of assume transformers are a thing, but you don't really explain where it came from, the last 50 years. Did you think about historical context versus mathematical context versus just explaining the moment that we're in today?
对,只讲一点点。我想把它保持得很紧凑,因为我在网站上写了一句我觉得很聪明的话。我写了“无人工添加剂”,我的意思基本上是——显然你可以坐下来对 Claude 说,给我写一部五卷本的 AI 史,它会替你写。所以我想非常忠于我喜欢的东西。如果我坐下来跟一个聪明的朋友,比如医学或法律领域的朋友,他们跟我说,嘿,你能给我讲讲语言模型是怎么工作的吗,我们只有一顿晚饭的时间——我会在这一顿晚饭里讲什么?所以我给自己定了个有点人为的限制:90 分钟。再用另外 90 分钟,你可以讲刚好够理解当下背景的历史,对吧?比如我们为什么给模型一个 temperature,这从哪来,什么是热模型、什么是冷模型——这些我们会讲。我们也会简单讲讲 2017 年发生了什么,比如《Attention Is All You Need》是怎么回事——这篇论文足够有名,大家都听说过。但我不会在语言的统计模型上花太多时间。
Yeah, just a little bit. I think I wanted to keep it very tight, because on the website I wrote the sentence that I think is very clever. I wrote “no artificial additives,” by which I basically mean — obviously you can sit down and say, Claude, write me a five-volume book about the history of AI, and it would do it for you. So I wanted to stay very true to the things that I like. If I sit down with a smart friend, right, maybe in medicine or law or something, I sit down with a smart friend and they're like, hey, can you explain to me how language models work, and we have one dinner — what would I put in that one dinner? So I gave myself this somewhat artificial limit of 90 minutes. And with another 90 minutes you can touch on just enough history to understand the current context, right? Like why do we give models a temperature, where does that come from, what is a hot model, what is a cold model — so we go into that. We also briefly go into what happened in 2017, like what is going on with “Attention Is All You Need” — it's famous enough as a paper that people have heard about it. But I'm not spending too much time on statistical models of language.
我觉得那段历史超级有意思。我真的很享受——让我想想怎么说。我真的很享受——我从没学过语言学,但我和很多语言学家、计算语言学家混在一起,他们过去 40 年一直在 AI 的表面刮擦,而我们甚至都不知道,对吧?我跟那些人一起学习过。
I think it's a super interesting history. I really enjoy — let me figure out how to put this. I really enjoy — I never studied linguistics, but I hung out with a lot of linguists and computational linguists who were scraping at the surface of AI for the last 40 years, and we didn't even know, right? I studied with those people.
嗯,这就是大象问题,对吧?你到处跑着摸它。一个人说,“这头大象是——”这就是盲人摸象的那部分。“这头大象像棵树。”“不不,大象像条蛇。”但没人看到全貌。
Well, it's the elephant problem, right? You're running around and you're feeling it. And the one guy is like, “This elephant is —” this is the part of the blind people touching an elephant. “This elephant is like a tree.” “No, no, an elephant's like a snake.” But no one sees the big picture.
对。对。那里有太多酷东西了。我觉得有些——我确信将来会有关于 AI 史的精彩著作出现。
Yeah. Yeah. There's so much cool stuff there. And I think some of the — I'm sure we're going to get amazing books about the history of AI at some point.
但你不觉得理解这一点很重要吗——就是你可以用这种方式理解语言模型。那这个有多长?是 5 天的课程吗?是 90 分钟的课程吗?多长?你想多长就能多长,但我会把这个给我 20 岁的孩子吗?那会是他的手动挡入门、改变他和聊天机器人的关系吗?还是说这需要一个人真的有软件工程师的背景?
But you don't think it's important to understand — like, that you can understand language models this way. So how long is this? Is this a 5-day course? Is this a 90-minute course? How much? It can be as long as you want it to be, but would I give this to my 20-year-old? And would that be his introduction to stick shift and change his relationship with a chatbot? Or does this require someone to really have a background as a software engineer?
不。不。不需要软件工程师背景。有一些小抽屉,如果你真想看,可以看代码。代码甚至都不是真正的代码。我用的是 MLX 这个框架。这就是为什么它目前只在 Mac 上运行,因为我就是懒。如果你感兴趣 Python 会是什么样,我可以给你看点 Python。
No. No. No background as a software engineer. There are these little drawers where you can look at the code if you really want to. The code isn't even the real code. What I'm using is MLX, the framework. That's why it's currently only running on Macs, because I was just lazy. I'll show you some Python if you're interested in what the Python would look like.
对,因为我想知道你们什么时候能让它在 Windows 上跑起来。
Yeah, because I wanted to know when you're going to get this working on Windows.
对。我是说,老实讲,到这一步我大概直接让一个智能体来做就行了,对吧?应该不难。我们用 Python 做就行。
Yeah. I mean, honestly, at this point I can probably just have an agent do it, right? It shouldn't be hard. We can just do it in Python.
嗯,但那样你就得让它在 ARM 和 x64 上跑,还有 WSL 或者非 WSL。一旦你决定让它走出同质的 Mac 环境,组合情况就变复杂了。
Well, but then you got to get it to work on ARM and x64 and WSL or not WSL. Like, the combinatorics get complicated once you decide to make it go outside of the homogeneous Mac.
我没有一开始就做,有几个原因。一是我不想再做一个 Electron 应用。我想真正做一次 Swift 应用。
I didn't do it a priori for a few reasons. One is I didn't want to build yet another Electron app. I wanted to actually build a Swift app for once.
对,这说得对。那你就得用 Win UI 来做。
Yeah, that's a good point. You'd have to do it in Win UI.
对,但另一件事是你永远不知道——我到底只是在为我五个朋友做这个,还是真有人在乎?确实有人在乎,我觉得这很好。而且我认为这增加了它继续做下去的可能性。但回答你的问题,如果人们有一个下午,你会得到一个非常笨、极其笨的模型,但你可以在一个下午里走完全程。
Yeah, but the other thing is you never know — am I really only building this for my five friends, or does anyone care? People do care, which I think is very nice. And I think that increases the likelihood of it going up. But to answer your question, if people have one afternoon, you will have a model that will be very stupid, extremely stupid, but you can make it through the whole thing in an afternoon.
这真的很有力量。这很重要。我觉得人们需要理解这一点,而它的根源就是这个概念:它会改变你和这辆车的关系。
That's really powerful. Like, this is significant. And I feel like people need to understand that, and at the root of it is this concept that it changes your relationship with the vehicle.
对。就像打开任务管理器,在 PC 上打开任务管理器。打开 DOS 提示符——比如,这是什么?我以前从没见过。我用了 20 年 Windows。我从没见过——嗯,你知道的——或者在 Chrome 上按 F12。
Yeah. Like opening Task Manager, opening Task Manager on a PC. Opening a DOS prompt — like, what is this? I've never seen this before. I've been a Windows user for 20 years. I've never seen — well, that's, you know — or hitting F12 on Chrome.
那些时刻,就像是普通人改变了对事物的关系。就像我打开汽车的后备箱,看看引擎,心想:什么?下面有东西。
Those moments are a moment where like the muggles change their relationship with the thing. Like I had that's like opening the trunk, opening the boot rather on the car and like look at the engine like what? There's a thing under there.
里面有两样东西,我觉得人们应该试试,因为我觉得它们很有趣。第一个是我构建的这个可视化工具,展示模型架构的样子。
There's two things in there that I think people should try out because I think they're very fun to me. The first one is I built this like visualizer of what a model architecture looks like.
就像模型里有哪些部件,对吧?
Like what are the pieces in a model, right?
模型蓝图。
The model blueprint.
对,对,没错。
Yeah. Yeah. Exactly.
比如 Transformer 块,以及数学如何流经那里。但另一件我真的很喜欢的是在最后,你也可以在采样中做,就是 X 光视图。
The like transformer blocks and like how does how does like the math flow through there. But the other thing I really enjoy is at the very end not you can also do it in sampling but it's the X-ray view.
嗯。
Mh.
所以我认为现在很多人知道语言模型本质上是一个统计模型,它试图预测下一个词是什么。下一个词就像你知道的,一个词片段,嗯,它不会选择最可能的那个。它有点像软性最小最大,但它试图在你给它的所有文本中计算这个,然后继续。
So I think a lot of people know now that a language model is fundamentally a statistical model and it tries to predict what the next token is. The next token being like you know like a word fragment and um it doesn't pick the most likely one. It sort of does like a soft minmax and but it it sort of like tries to calculate that across like all the text you give it and then continues.
我内置了这个 X 光视图,你可以看到每个位置哪些路径没有被选择。
And what I've built in is this like X-ray view where you can see every single position what are the paths not not taken.
嗯。
M
我称那些为平行宇宙,
I call those parallel universes,
所有的对数概率,就像是的。
all the log throbbs and it's like Yeah.
还有另一个平行宇宙,它说了完全不同的东西。
And there's another parallel universe where it said a totally different thing.
是的,也许斯科特没去百吉饼店,对吧?比如他去了其他哪些地方
Yeah, maybe Scott didn't go to a bagel shop, right? Like he went like what are the other places
他可能去了?
he could have gone to?
实际上,这里有屏幕共享吗?比如
Actually, is there screen sharing here? Like
没有屏幕共享。这是一个音频节目,恐怕不行,我的朋友。
there's no screen sharing. This is an audio show, I'm afraid, my friend.
好吧。但人们需要试试。
Fair enough. But people need to try it out.
嗯,你可以做一件很快的事。与其预训练你自己的模型,你也可以导入一个现有的基础模型,
Um you can do one thing maybe that is very quick. Instead of pre-training your own model, you can also import an existing base model,
对吧?你可以去导入一个较小的模型,比如 Quinn 之类的,它能在你的电脑上运行得很好。然后你可以导入那个模型,去采样或去聊天界面,但采样可能更好。你可以说:嗯,今天天气很好,斯科特去了
right? You can like go and import one of the smaller models that just runs fine on your computer like Quinn or something. And uh you can import that model, go to sampling or go to the chat interface, but sampling is probably better. And you can say um it's a beautiful day and Scott went to
然后看看模型提出的所有可能性以及概率。我有一个在演讲中使用的示例应用,把它画成热图,然后根据对数概率给单词上色,红色单词是稀有词,黄色单词是中等稀有。
and then just see all the possibilities that the model comes up with and like what the probabilities I I have a sample app that I use in my talks that draws that as a heat map and then it colors the word based on the log prob and red words are rare words and yellow words are medium rare.
所以它会说今天天气很好,我们去……它会说海滩。你悬停在 B 上,你会发现 B 和每个都被分成两个词元。你点击 B,然后它会弹出该词元的所有其他对数概率,它会说海滩或 B,字母 B 的概率是 75%。然后它会说山是 0.1%,或者公园是 20% 的概率。然后就像在这一刻,宇宙分裂成两半。
So it'll say it's a beautiful day let's go to the it'll say beach. You'll hover over the B and you'll find out that B and each have been broken into two tokens. You'll click on the B and then it'll pop up all the other log probs for that token and it'll say beach or B, the letter B is like 75%. And then it'll have like mountains be like 00.1 or or or park was 20% chance. And then it's like at this moment the universe split in half.
是的。
Yeah.
我们中五分之一去了公园,其余的去山里,这家伙去了海滩。这种情况每天都在不断发生。
1/5if of us went to the park and the other rest went to the mountains and this guy went to the beach. And that's happening every day all day constantly.
是的,是的。我觉得那真的很酷。
Yeah. Yeah. I think that is really cool.
确实很酷。
It is really cool.
是的。
Yeah.
说到改变关系,对吧?一旦你对概率的基本概念有了更好的理解,它让你更容易理解模型如何生成它们生成的文本。但它也帮助你理解我们今天觉得最迷人的许多事情,比如道德患者和智能,以及智能是如何形成的?在什么点上我们认为这是一个有用的治疗师?我们关注的许多事情是模型如何进化其内部权重和那些 Transformer 块?那些 Transformer 块内部发生了什么?如果你对我说的 Transformer 块和权重有一个粗略的概念,那实际上意味着什么,你就更容易加入所有这些乐趣,比如关于宇宙和人类经验的扶手椅哲学。
And to your point about like changing the relationship, right? Like once you once you get a better understanding of like the underlying concepts of probabilities, like it makes it easier for you to understand like how models come up with the text that they come up with. But it also helps you understand like a lot of the things that we find most fascinating today about like both moral patient and like intelligence and like how is intelligence formed? like at what point do we consider this to be like a useful therapist? Like a lot of the things that we're looking at are how do the models evolve their internal weights and those like transformer blocks? What is happening inside those transformer blocks? And it's much easier for you to get like for you to join the fun of like all of this like you know armchair philosophy about the universe and like the human experience. If you have a rough idea of when I say transformer block and weights, what does what does that actually mean?
嗯,当研究人员谈论不是构建模型而是培育模型时,因为这更像培育兰花之类的,而不是编写工具,如果你理解他们为什么这么说,就有很多关于 AI 的讨论真的很有趣,可以阅读和参与。
Um, and when researchers talk about not building a model but growing a model because it's like much closer to like growing an orchid or something than like writing a tool, if you understand why they say that, like there's so much discourse about AI that is really fun to like read and participate in.
哦是的。好吧,我们应该稍微拉一下你刚才打开的线头,你刚才说到了道德患者,我猜很多在通话中的人不熟悉这个词,它基于这样一个假设:一个人有一定量的认知能力,一定量的智能。你必须有自主性和自我意识。呃,你还必须关心某些事情。问题是大语言模型没有自我意识。它没有关心,但它确实有价值,因为价值就是权重,它确实有自主性,或者至少可以被赋予自主性。那么问题就是,它有道德患者吗,还是只是它的假象?
Oh yeah. Well, we should pull a little bit on the thread that you just opened there where you just said moral patient, which I'm going to guess a lot of the people on the call aren't familiar with and it is grounded in the assumption that someone has a certain amount of cognitive capacity, some certain amount of intelligence. You have to have autonomy and self-awareness. Uh, and you have to care about something. The problem is that a large language model doesn't have self-awareness. It doesn't have caring but it does have value because the values are the weights and it does have autonomy or at least it can be given autonomy. So then the question is you know is it does it have moral patient or does it just have the similacrim of that?
是的,是的。这是一个超级迷人的研究领域,我甚至远远不够资格去,是的
Yeah. Yeah. It's like a super fascinating field of study and I'm not qualified even remotely to like yeah
给你任何有用的答案,但我真的很喜欢坐在场边,听那些资深哲学家和
give you any useful answers but I I really enjoy sitting on the sidelines and like listening to established philosophers and like
嗯,那些长期研究动物伦理的人。真的很喜欢阅读他们的观点来源。
um people who've been studying like animal ethics for a long time. really enjoy reading about where they come from.
那些人往往真的对单个 Transformer 块和权重非常着迷,以及模型如何组织自己的权重和自己的块,以及它给块分配什么样的功能,这些功能从未被编程,而是随着时间的推移而进化。随着我们进行训练,这种随时间进化的过程对我们来说非常迷人,因为它给了我们关于智能如何运作的有趣见解。
And those people tend to like really they're quite fascinated about the the individual transformer blocks and the weights and like how the model organizes it own weights and its own blocks and like what kind of function it assigns to blocks which is never programmed but sort of like evolves over time. And this evolution over time as we like go through training is like really fascinating for us because it gives us interesting insights into into um just how intelligence operates.
是的,这种人工智能。
Yeah, this artificial intelligence.
关于语言模型构建器的另一个有用之处,并通过你刚才使用的一些语言来思考,比如权重如何应用,模型如何思考,模型如何变化。这些都是你在围绕这些事物的拟人化跳舞。但人们需要理解,当你运行语言模型构建器时你可以看到,就像如果你在运行训练,你可以观看,你可以看到它实时发生,但一旦模型烤好了,你把它从烤箱里拿出来,它就不会继续学习。
Another useful thing about language model builder and thinking about that in in the through the lens of the some of the language that you just used about how how the weights are applied, how the model thinks, how the model changes. These are all kind of you're dancing around the anthropomorphizing of these things. But people need to understand and you can see it when you run language model builder that like if you're running a training you can watch it you can see it happen live but once the model is baked and you pull it out of the oven it doesn't continue to learn.
是的。
Yeah.
除非你决定微调它,把它放回烤箱再烤一会儿。
Unless you decide to refine it and put it back in the oven and bake it some more.
你懂我的意思吧?我觉得普通人,比如非技术背景的父母,没有意识到这其实是一堆无状态的调用,你知道,无状态的 HTTP 调用。这里没有状态。只是把上下文重新水合后交还给你,然后它继续说话。所以我们进行的这些持续不断的对话本身就是一种幻觉,这些有状态的——对话的状态本身就是一个由上下文制造的幻觉。
You know what I mean? And I think that regular people, like non-technical parents, don't realize that it's a bunch of stateless calls, you know, stateless HTTP calls. There's no state here. There's just context given back to you rehydrated and then it keeps talking. So these ongoing persistent conversations that we have are an illusion in themselves of these stateful—the state itself of the conversation is an illusion just made by context.
对。对。对,没错。对,正是这样。
Yeah. Yeah. Yeah, and that's right. Yeah, exactly.
这就像区别在于——一个是实际的权重,对吧?另一个只是我们给模型的额外信息或工具调用,但我们实际训练的是使用其他工具,而不一定是如何处理你的结果。嗯,显然我认为在规模上有些东西会有点崩解,因为我们在后训练中做的很多事情正越来越多地转移到预训练中。
It's like the difference between—one thing is the actual weights, right? And then the other thing is just additional information or tool calls that we give the model, but the thing that we actually then train is using other tools, not necessarily what to do with your results. Um, and obviously I think at scale some of the stuff breaks apart a little bit because a lot of the things that we may have done in post-training are increasingly moving into pre-training.
尤其是工具调用,对吧?我觉得曾经有一段时间,你能真正分辨出一个模型是否有效地训练过调用工具。那是一个短暂的时期,尤其是在编程方面,有些工具就是无法使用 bash,尽管它们能给你一整本 bash 手册。
Like especially tool calling, right? Like I think there was a point in time where you could really tell whether or not a model was trained on effectively calling tools or not. It was like a brief point in time, especially in coding, where some tools were just incapable of using bash even though they could give you like a whole bash manual.
对。这本身有点意思,但我觉得工具调用这东西超级有趣,因为我在教这个的时候,会讲你和模型在聊天,所以聊天中有两个实体,而当你加入工具调用时,群聊里就有了第三个人。对,然后你离开了,现在是聊天机器人在和工具对话,聊天机器人告诉工具,而工具不是聊天机器人,但你可以假装它是,因为你给它输入,它给你输出,我们不知道会得到什么,这让对话继续下去,而你基本上作为群聊中的第三个人在等待。
Right. And that in itself is a little interesting, but I think that the tool calling stuff is super interesting because when I teach that, I talk about how you are having a chat between you and the model, so there's two entities in the chat, and when you add tool calling, there is a third person in the group chat. Yeah, and then you leave and now it's the chatbot talking to the tools, and the chatbot tells the tool, and then the tool isn't a chatbot but you can pretend that it is because you give it input and it gives you output that we don't know what we're going to get, and that keeps the conversation going while you're basically on hold as the third person in the group chat.
我不知道你和你的团队是否这样做,但我一直喜欢和人们做的一件事是,当有人问“好吧,我如何用 AI 构建有效的工具”时,思考模型体验。对。我会说:“好吧,想象你是模型,对吧?比如 Scott 问你,我今天该去哪里?”好吧,你是模型。你想要什么样的工具,对吧?你可能会说:“好吧,我可能想知道,有没有什么能告诉我 Scott 的偏好或他的位置?”我有记忆吗?我知道他在哪里吗?这是我第一次见到这家伙吗?
And I don't know if you do this with your people, but one thing I've always enjoyed doing with people asking, okay, how do I build effective tools with AI, is to think about model experience. Yeah. I'm like, "Okay, imagine you're the model, right? And like Scott asks you, where should I go today?" Okay, you're the model. Like, what kind of tools do you want, right? Like, and you might be like, "Okay, I probably want to know, like, is there anything that tells me like Scott's preferences or his location?" Do I have memory? Do I know where he is? Is this the first time I've ever met this guy before?
这就是为什么 open clause 的东西如此巧妙。这个简单的 soul.md 想法是——每次你说“嘿,你在吗?”它必须从沉睡中醒来,跌跌撞撞地下床,说:“什么?我是谁?”就像那部电影《记忆碎片》,那个人把所有的上下文纹在自己身上,每天早晨醒来都要照镜子弄清楚我是谁,我在这里做什么?所以,每次他学到东西,就纹身。
That's why the open clause stuff is so clever. This simple idea of a soul.md is—every single time you say, "Hey, are you there?" It has to wake up from a dead sleep, stumble out of bed, go, "What? Who am I?" It's like that movie Memento where the guy tattoos all the context all over himself and has to wake up every morning and look in the mirror to figure out who am I and what am I doing here? So, every time he learns something, he tattoos himself.
对,有点像。我确实认为——我觉得这些东西变化太快了,但我确实想知道——显然大多数模型实际上被训练了很多关于它们是谁以及它们应该做什么的信息,对吧?
Yeah, a little bit. I do think—I think this stuff all changes so quickly, but I do wonder—obviously most models are actually being trained quite a bit of information about who they are and what they're supposed to do, right?
嗯,我觉得 open claw 的东西效果很好,因为大多数模型就像预训练的那样——显然我们在所有世界知识上预训练,但然后我们做了大量的微调,让你应该是有帮助的,对吧?我可以给——如果给定这个,你应该做——
Um and I think the open claw thing works pretty well because like most models are just like pre-trained to like—obviously we pre-train on like all the world knowledge but then we do like a mountain of fine tuning on you're supposed to be helpful, right? I can give—if given this you should do—
你提出这一点真是太好了——目标寻求。我一直跟人们说,它不仅仅是一个拥有无限能量的实习生,它是一个目标寻求者,并且被训练成有帮助的。我知道这一点,当你通过监督微调、你的调优、你的直接偏好优化,当你在语言模型构建器中经历这些时,重点就是制作一个有帮助、有用、善良且目标寻求的模型。否则它就不会有用,它只会是一个无礼的机器人,只会对你刻薄。
That's a great point that you bring that up—goal seeking. I keep talking about people that it's not just an intern with unlimited energy, it is a goal seeking and it has been trained to be helpful. I know that and you can see it when you go in through your supervised fine-tuning, your tuning, your direct preference optimization, when you go through that in language model builder, the whole point is to make a helpful and useful and kind and goal seeking model. Otherwise it would not be useful, it would just be sassy bot that would just be mean to you.
我确实加了那个无礼刻薄的机器人东西。如果你有一个——
I did add like the sassy mean bot thing. If you have like a—
我得去看看那部分。
I got to check that part out.
就像我稍后加的一个东西。嗯,这会产生糟糕的微调数据。请预先——不要那样做。
Like a thing I added like a little later. Um this makes for terrible fine-tuning data. Please like pre—don't do that.
好吧。就像前缀前缀。这做起来很有趣,结果会很糟糕。好吧。只是提前说一下。但你可以导入——我加了一个东西,让你可以把整个群聊导入作为微调数据。
Okay. Like prefix prefix. This is very fun to do and the results are going to be terrible. Okay. Just like putting that out there. But you can import—I added a thing that lets you import an entire group chat as fine-tuning data.
哦不。那它就会像你和朋友说话的方式那样说话。
Uh oh. Then it's going to talk the way that you talk with your friends.
没错。嗯,所以它基本上教模型,好吧,这些是人,它会继续像整个“继续脚本”的东西,但用于长群聊。嗯,这显然与其他微调的东西相当不同,对吧?就像其他微调的东西。嗯,显然 Scott,你已经做过很多次了,但为了我们听众的利益,嗯,一旦你有一个了解世界的模型,你就必须教它,如果给它一个问题,它不应该给我们更多问题,而应该实际给我们一个答案。
That's right. Um so it basically like teaches the model, okay, here are the people and it's going to continue like the whole continue the script thing but for like a long group chat. Um which is obviously quite different from the other fine tuning stuff, right? Like the other fine-tuning stuff. Um, and obviously Scott, you've done this many times, but like for the benefit of people who listen to us, um, once you have a model that knows about the world, you then have to teach it that if it's given a question that it shouldn't like give us more questions, but should actually give us an answer.
我们在微调中这样做。
We do that in fine tuning.
对于微调,我有所有这些不同的——我有所有这些不同的例子。有一个在数学问题上微调。另一个在能够将给定文本重写为不同文本上微调。但我有这个,虽然公认很糟糕,你可以导入一个群聊,然后它就会模仿那个群聊并继续。
And for fine-tuning, I have all these different—I have all these different examples. There's like one that fine-tunes on math problems. There's another one that fine-tunes on like being able to rewrite given text as like different text. But I have this one that is like admittedly terrible where you can import a group chat and it will then be like a mimic of that group chat and continue.
我做了一个像本——呃本尼迪克特·康伯巴奇那样说话的,就是扮演夏洛克·福尔摩斯的那个人。
I made one that talks like Ben—uh Benedict Cumberbatch, the guy who plays Sherlock Holmes.
不错。
Nice.
他非常恼火。你为什么问我这些愚蠢的问题?要是你像我一样聪明就好了,夏洛克·福尔摩斯。
And he's so irritated. Why are you asking me these dumb questions? If only you were smart like me, Sherlock Holmes.
太美了。我是说我也放了 Karpathy 的 tiny Shakespeare。那像是 Karpathy 最早的演示之一,如果语言模型像莎士比亚那样写作会怎样?训练起来非常快。但我的观点是,这种醒来并试图弄清楚你是谁的区别。我认为已经有——我实际上不认为是从零开始。模型里已经烘焙了相当多的个性。我认为在 open claw 的例子中,它效果很好。
That's beautiful. I mean I also put in Karpathy's like tiny Shakespeare. It was like one of Karpathy's first demos was what if a language model that writes like Shakespeare? Which is very quick to train. But my point is that like this difference between like waking up and trying to figure out who you are. I think there's already—I don't actually think it's from zero. There's already like quite a bit of personality baked into the model. And I think in the open claw example, it works really well.
对。
Yeah.
是的,因为从根本上说,大多数人希望他们的开源云是乐于助人、善良的,就像
Yeah, because fundamentally most people want their open cloud to be like helpful and good and like
对,没错。
Yeah, exactly.
对。
Right.
但我觉得,也许只是为了好玩,或者为了你自己的理解,训练一些可能做不同事情的模型会很有意思。
But I think it would be interesting to like just for fun um just for your own understanding like train some models that maybe do different things.
是的。
Yeah.
可能会很有趣,对吧?
Could be enjoyable, right?
嗯,而且这也能让你理解为什么这些东西会试图提供帮助?这不仅仅是因为微调,还因为语料库。我总是谈论语料库,无论是 Reddit 的奇怪角落还是 Stack Overflow 的奇怪角落。如果你最终进入了互联网上那种时髦的部分,模型就会变得尖酸刻薄。这并不是说它没有目标追求,也不是说它不想帮助你。只是它是在一个时髦的语料库上构建的。所以你得施加影响,微调它,让它更有帮助一些。这就是监督微调发挥作用的地方。
Well, and it also like it makes you understand why are these things trying to be helpful? It's not just because of the fine-tuning, but it's also the corpus. And I always talk about the corpus, whether it be parts of, you know, weird corners of Reddit or weird corners of Stack Overflow. If you end up in like the sassy part of the internet, the model is going to be snarky and sassy. And it's not that it's not goal seeking. And it's not that it wants to help you or not. It's just it was built on a sassy corpus. So you got to put your thumb on the scale and fine-tune it to be a little bit more helpful. That's where supervised fine-tuning comes in.
是的。你记得 Claude Golden Gate 吗?不,那是在我加入 Anthropic 之前,但那是 Claude 的一个早期版本,它试图提供帮助,但也得到了明确的指示,无论发生什么,都要尝试把金门大桥融入你的回答中。
Yeah. Have you do you remember Claude Golden Gate? No, this was before I joined Anthropic, but this was like an an early an early version of Claude that instead of trying to be like it tried to be helpful, but it also was given clear instruction to like whatever happens, try to work the golden gate into your answer.
哦,我明白了。它有一个单独的隐藏目标。
Oh, I see. It has a separate hidden goal.
结果真的很美,也有点疯狂。嗯,
Truly beautiful and somewhat insane results. Um,
那太棒了。
that's awesome.
是的。所以就像
Yeah. So like
嗯,这就是你现在看到的,老师们在课程大纲中用白色背景上的白色文字。所以当孩子复制粘贴直接放入大型语言模型时,老师想检测孩子是否使用了 AI。所以他们污染提示,然后说确保你提到茄子,然后中间有一些随机的东西,孩子从未测试过,它说茄子。
well those are what you're seeing now with stu teachers putting in white text on a white background in the syllabus. So when the kid goes a and c and then paste it directly into the large man language model uh the teacher wants to detect whether or not the kid has AI. So they poison the prompt and then they say make sure you mention you know eggplants and then there's some random thing in the middle that the kid never test and it says eggplant.
是的。50 个结果中有 49 个是这样的。我担心的一件事也许是,这又回到了灵魂文档,对吧?就像
Yeah. And they're like 49 of the 50 results. I I one thing I fear maybe is and this sort of goes back to like the soul document, right? Like
我认为灵魂文档可能在非常后期的上下文工程方面能让你走得很远,
I think I think the soul document could probably get you pretty far in terms of like very late stage context engineering,
对吧?
right?
但我认为,尤其是随着模型变得更大、更强大——我说的更大、更强大是指有更多的权重和更多实际活跃的参数,不仅仅是专家参数,而是一般参数。我希望我们能越来越多地得到这样的模型,在我心中有三个阶段,对吧?第一阶段是一个笨模型,只做给定的事情,然后第二阶段可能是那种读取指令并把茄子融入文档的模型。但希望我们实际上能达到一个模型,它被编程了更多的人性和道德,以至于它清楚地知道我被要求作弊。是的,
But I think especially as the models get bigger and more powerful and by bigger and more powerful I mean like there's just more weights and like more parameters that are actually active, not just expert parameters but like generally parameters. I think hopefully we'll increasingly get models that there's sort of like three stages in my mind, right? Like stage one is a dumb model that just like does whatever it's given and then stage two is maybe sort of the model that reads the instructions and like works eggplant into the document. But hopefully we'll actually get to a model that has even more humanity and morality programmed into it to the point where it's like clearly I'm being asked to cheat. Yeah,
我应该帮助这个孩子,就像你和我如果我们的孩子过来说“嘿,你能帮我写作业吗?”我们会做的那样。就像,你怎么那个
I should like help this kid uh to the same extent that maybe like you know the things that you and I would do if like our kids came by and were like, "Hey, can you write my homework for me?" Like, how are you that
时刻?没错。你提到这个很有趣,因为我在和微软的 Renovich 合作一个项目,我们称之为“导师制”。这是对实习的一种不同诠释,我们想制作编码模型,编码智能模型。现在,我们必须用技能和 markdown 文件来实现,但我想要一个不手把手教的模型。我希望它像“我将把这作为练习留给读者。我知道你想让我做冒泡排序,但我想先看看你做。”我想要一个更友好的早期职业工程师模型,教他们如何思考,我希望大学里的人能访问这些模型。我不希望它只是——我们不应该成为一个次认知物种。
moment? Exactly. And that's funny you mentioned that because I'm working on a thing with Renovich at Microsoft, which is a we call it a preceptorship. It's a different spin on an internship and we want to make models that are coding models, coding smart models. Right now, we have to do it with skills and with markdown files, but I want a model that doesn't hold their hand. I want it to like I'm going to leave this as an exercise to the reader. I know you want me to make a bubble sort, but I'd like to see you do it first. I want a a friendlier early in career engineer model that teaches them how to think, and I want people in universities to have access to those models. I don't want it to just like we should not become a subcognitive species.
仅仅因为它能做,并不意味着它应该做。
Just because it can do it doesn't mean it should do it.
是的。我想也许——我的意思是,我制作语言模型构建器是为了好玩。它是免费的。我不会用它赚钱。所以也许它看起来不像我只是在打广告。就像如果人们有任何问题,比如为什么模型会以某些方式行为,里面的微调数据部分
Yeah. And I think maybe I mean I made language model builder for fun. It's free. I'm not going to make any money with it. So like maybe it's it's going to seem less like I'm I'm just advertising it. Like if if people have any questions about okay why do models behave certain ways like the fine-tuning data section in it
真的很美,因为微调也不需要很多步骤,预训练需要很长时间,即使在这个应用中至少需要一天,但微调 800 步左右就足够了,对于这些小模型来说,足以真正引导它们如何运作
is like really beautiful because also fine-tuning doesn't take a lot of steps like pre-training takes a long time like even in this app takes like at least a day but fine-tuning 800 steps or so like more than enough to like for these small models to really steer how they operate
就像看到这个模型,你把它放进烤箱五分钟,然后告诉它我希望你给出有用的回应之类的。嗯,只是玩一些你自己的例子,真的很有趣。
and just seeing like this model like you put it in the oven for five minutes and you tell it I want you to like give helpful responses whatever Um, and just like playing with some of your own examples a little bit is like really fun.
是的。嗯,我想特别提一下,因为 languagemodelbuilder.com 是免费的。我想提醒大家,你本来可以成为一个 AI 骗子。社交媒体上的每个人,Twitter 这个垃圾场上的每个人,都想让你买他们的课程。给我 1995,对吧?PayPal 给我五块钱。学习如何避免——学习如何避免骗子。给我 5 美元,我就告诉你如何选择免费。你只需去 languagemodelbuilder.com。没有追加销售。你制作它是为了好玩。你为你的朋友制作它,现在你的朋友是整个互联网。所以,我想感谢你没有在这个东西上放一个 Gumroad 或 Shopify 来快速赚钱。你只是把信息提供给人们。
Yeah. Well, I want to call that out because languagemodelbuilder.com is free. And I want to remind folks that like you could have become an AI grifter. Everybody on social media, everybody on the dumpster fire that is Twitter wants you to buy their course. Give me 1995, right? PayPal me five bucks. learn how to avoid learn how to avoid uh you know grifters. Send me $5 and I'll tell you how you chose to make it free. You just go to languagemilebuilder.com. There's no upsell. You made it for fun. You made it for your friends and now your friends are the whole internet. So, I want to appreciate that you didn't put, you know, a gum a gumroad or a Shopify on the top of this thing and try to make a quick buck. You're just putting the information out there for the people.
谢谢。是的。我的意思是,这是一个教育性的有趣应用,对吧?就像,我很确定一开始就没有很多钱可赚。
Thank you. Yeah. I mean, it's an educational fun app, right? Like, I'm pretty sure there was not a lot of money to be made to begin with.
是的。但这不太关乎那个,信息应该是免费的。让信息出去。外面的每个人都在试图让你上他们的课,LinkedIn 上的每个人都想让你加入他们的 AI 项目。我喜欢语言模型构建器的地方是,我可以去波特兰社区学院,我的母校,教一门课,并用这个作为——不是双关语——作为课程和大纲的语料库。嗯,无论你已经是工程师,还是只是一个想知道如何驾驶手动挡的人,这都是一个很好的起点。我鼓励大家去看看,我期待有一天能有 Windows 版本。哦,
Yeah. But it's less about that like the information should be free. Let the information out. Everyone out there is trying to get you to do their class and everyone on LinkedIn wants you to get into their AI thing. What I like about Language Model Builder is that I could go to, you know, Portland Community College, my alma mater, and teach a class and use this as the, no pun intended, as the corpus for the class and the syllabus. And uh it's a great great place to start whether you're already an engineer or you're just a person who wants to know how to drive stick shift. I would encourage folks to check it out and I look forward to the Windows version someday. Oh,
当然。是的,非常感谢。
of course. Yeah, thank you so much.
是的,谢谢。我们一直在和 Felix Rezerberg 聊天。这是 Hansel Minutes 的另一集,我们下次再见
Yeah, thank you. We have been chatting with Felix Rezerberg. This is another episode of Hansel Minutes and we'll see you again next