【译文】
[1小时讲座]大型语言模型入门
3,003,062次观看 2023年11月23日
这是一个1小时的大型语言模型(Large Language Model)的普通读者介绍:大型语言模型是ChatGPT、Claude和Bard等系统背后的核心技术组件。它们是什么,它们将走向何方,与当今操作系统的比较和类比,以及这种新的计算范式中的一些与安全相关的挑战。
截至2023年11月(该领域发展迅速!)
背景:这段视频基于我最近在AI安全峰会上发表演讲时所用的幻灯片。这次谈话没有被录下来,但之后很多人来找我,告诉我他们很喜欢。鉴于我已经花了一个漫长的周末来制作幻灯片,我决定稍微调整一下,录制第二轮演讲并上传到YouTube。请原谅随机的背景,那是我在感恩节假期的酒店房间。
幻灯片PDF格式:https://drive.google.com/file/d/1pxx_... (42MB)
幻灯片。作为主题:https://drive.google.com/file/d/1FPUp... (140MB)
有几件事我希望我能说(我会在出现时在这里补充):
这些梦和幻觉不会通过微调得到修正。微调只是将梦境“引导”为“有用的助手梦”。总是要小心 LLMs 告诉你的东西,特别是如果它们仅从记忆中告诉你一些东西。也就是说,与人类类似,如果 LLM 使用浏览或检索,并且答案进入了其上下文窗口的“工作内存”,你可以更加信任 LLM 将这些信息处理成最终的答案。但是现在,请不要相信 LLMs 说的话或做的事情。例如,在工具部分,我总是建议仔细检查LLM所做的数学/代码。
LLM如何使用浏览器这样的工具?它会发出特殊的单词,例如|BROWSER|。当推断 LLM 的代码“上面”检测到这些词时,它捕获以下输出,将其发送到工具,返回结果并继续生成。LLM是如何知道发出这些特殊单词的?通过示例,对数据集进行微调,教它如何以及何时浏览。和/或工具使用说明也可以自动地放置在上下文窗口中(在“系统消息”中)。
你可能还喜欢我2015年的博客文章《递归神经网络的不合理有效性》。我们今天获取基本模型的方式在高层次上几乎是相同的,除了RNN被换成了Transformer。http://karpathy.github.io/2015/05/21/...
run.c文件里有什么?功能更全的1000行版本 hre:https://github.com/karpathy/llama2.c/...
章节:
第1部分: LLMs
00:00:00 简介:大型语言模型(LLM)讲座
00:00:20 LLM 推理
00:04:17 LLM培训
00:08:58 LLM 梦想
00:11:22它们是如何工作的?
00:14:14 对助手进行优化
00:17:52 目前的总结
00:21:05附录:比较,标签文档,RLHF,合成数据,排行榜
第二部分:LLMs的未来
00:25:43 LLM尺度法
00:27:43 工具使用(浏览器、计算器、解释器、DALL-E)
00:33:32 多模态(视觉,音频)
00:35:00 思考,系统 1/2
00:38:02自我提升,LLM AlphaGo
00:40:45 LLM 定制, GPTs 商店
00:42:15 LLM OS
第三部分:LLM安全性
00:45:43 LLM安全入门
00:46:14越狱
00:51:30 提示注入
00:56:23数据中毒
00:58:37 LLM 安全结论
结尾
00:59:23 输出
教育使用许可
此视频可免费用于教育和内部培训目的。教育工作者、学生、学校、大学、非营利机构、企业和个人学习者可以自由使用这些内容用于课程、课程、内部培训和学习活动,前提是他们不从事商业转售、再分发、外部商业使用,或修改内容以歪曲其意图。
【原文】
[1hr Talk] Intro to Large Language Models
3,003,062次观看 2023年11月23日
This is a 1 hour general-audience introduction to Large Language Models: the core technical component behind systems like ChatGPT, Claude, and Bard. What they are, where they are headed, comparisons and analogies to present-day operating systems, and some of the security-related challenges of this new computing paradigm.
As of November 2023 (this field moves fast!).
Context: This video is based on the slides of a talk I gave recently at the AI Security Summit. The talk was not recorded but a lot of people came to me after and told me they liked it. Seeing as I had already put in one long weekend of work to make the slides, I decided to just tune them a bit, record this round 2 of the talk and upload it here on YouTube. Pardon the random background, that's my hotel room during the thanksgiving break.
Slides as PDF: https://drive.google.com/file/d/1pxx_... (42MB)
Slides. as Keynote: https://drive.google.com/file/d/1FPUp... (140MB)
Few things I wish I said (I'll add items here as they come up):
The dreams and hallucinations do not get fixed with finetuning. Finetuning just "directs" the dreams into "helpful assistant dreams". Always be careful with what LLMs tell you, especially if they are telling you something from memory alone. That said, similar to a human, if the LLM used browsing or retrieval and the answer made its way into the "working memory" of its context window, you can trust the LLM a bit more to process that information into the final answer. But TLDR right now, do not trust what LLMs say or do. For example, in the tools section, I'd always recommend double-checking the math/code the LLM did.
How does the LLM use a tool like the browser? It emits special words, e.g. |BROWSER|. When the code "above" that is inferencing the LLM detects these words it captures the output that follows, sends it off to a tool, comes back with the result and continues the generation. How does the LLM know to emit these special words? Finetuning datasets teach it how and when to browse, by example. And/or the instructions for tool use can also be automatically placed in the context window (in the “system message”).
You might also enjoy my 2015 blog post "Unreasonable Effectiveness of Recurrent Neural Networks". The way we obtain base models today is pretty much identical on a high level, except the RNN is swapped for a Transformer. http://karpathy.github.io/2015/05/21/...
What is in the run.c file? A bit more full-featured 1000-line version hre: https://github.com/karpathy/llama2.c/...
Chapters:
Part 1: LLMs
00:00:00 Intro: Large Language Model (LLM) talk
00:00:20 LLM Inference
00:04:17 LLM Training
00:08:58 LLM dreams
00:11:22 How do they work?
00:14:14 Finetuning into an Assistant
00:17:52 Summary so far
00:21:05 Appendix: Comparisons, Labeling docs, RLHF, Synthetic data, Leaderboard
Part 2: Future of LLMs
00:25:43 LLM Scaling Laws
00:27:43 Tool Use (Browser, Calculator, Interpreter, DALL-E)
00:33:32 Multimodality (Vision, Audio)
00:35:00 Thinking, System 1/2
00:38:02 Self-improvement, LLM AlphaGo
00:40:45 LLM Customization, GPTs store
00:42:15 LLM OS
Part 3: LLM Security
00:45:43 LLM Security Intro
00:46:14 Jailbreaks
00:51:30 Prompt Injection
00:56:23 Data poisoning
00:58:37 LLM Security conclusions
End
00:59:23 Outro
Educational Use Licensing
This video is freely available for educational and internal training purposes. Educators, students, schools, universities, nonprofit institutions, businesses, and individual learners may use this content freely for lessons, courses, internal training, and learning activities, provided they do not engage in commercial resale, redistribution, external commercial use, or modify content to misrepresent its intent.