Skip to content
0:00 / 0:00

#largelanguagemodels#jailbreaking#rlhf

[1hr Talk] Intro to Large Language Models

Andrej Karpathy

1.7M subscribers • 6 videos on Hallway

YouTube
  • Recommended by 10 people: 9 on Hacker News and 1 on Lobsters.
  • Presented by Andrej Karpathy, co-founder of OpenAI
  • Linked in the descriptionkarpathy/llama2.c

Beginner. No background in the topic needed.

4.3M views2 years ago10 recommendations

AI and machine learningTransformers and LLMsAI safety and impactNeural networks and deep learning

Andrej Karpathy provides a high-level introduction to Large Language Models, explaining how they are trained, their future, and security challenges.

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: drive.google.com/file/d/1pxx_ZI7O-Nwl7ZLNk5hI3WzAsTLwvNU7/vi… (42MB) - Slides. as Keynote: drive.google.com/file/d/1FPUpFMiCkMRKPFjhi9MAhby68MHVqe8u/vi… (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. karpathy.github.io/2015/05/21/rnn-effectiveness/ - What is in the run.c file? A bit more full-featured 1000-line version hre: github.com/karpathy/llama2.c/blob/master/run.c Chapters: Part 1: LLMs Intro: Large Language Model (LLM) talk LLM Inference LLM Training LLM dreams How do they work? Finetuning into an Assistant Summary so far Appendix: Comparisons, Labeling docs, RLHF, Synthetic data, Leaderboard Part 2: Future of LLMs LLM Scali

Why it's here

10 people recommend this

What people say. Highly recommended as an exceptionally clear and comprehensive high-level overview of how LLMs work, their security vectors, and future directions.

Moments people linked to

shrimpxon Hacker News • Recommends

On “Generative AI for Beginners”

Andrej Karpathy's "Zero to Hero" series on YouTube is the ultimate guide to building LLMs. Extremely information-dense but as complete as it gets: link Also, an amazing high-level overview of LLMs, including extensive discussion about attack vectors, that he published a couple days ago: link to this video

FlyingAvataron Hacker News • Recommends

On “Ask HN: Do LLMs get "better" with more processing power and or time per request?”

Short answer is No. I highly recommended watching Andrej Karpathy's Intro to LLMs talk, particularly the section on System 1 vs System 2 thinking. Long story short, what you are describing, using more processing to prepare a better response, is something that is an area of interest, but is not currently part of ChatGPT (or any other LLM that I am aware of). See: link to this video

mindwokon Hacker News • Recommends

On “Why has LLM progress seemingly stalled around the GPT-4 level? Or has it?”

All of Andrej Karpathy's stuff on YouTube is absolutely top tier. He's a rare example of a brilliant contributor in his field who is an equally brilliant educator. Start with his short intro to LLMs, only 1 hour long but is dense with valuable stuff: link to this video

vyrotekon Lobsters • Recommends

Intro to Large Language Models 1hr Talk

jpduson Hacker News • Recommends

On “Ask HN: AI/ML papers to catch up with current state of AI?”

Hey, imho best overall technical intro to LLMs (I guess that´s your main interest as you mentioned qlora + llama) is by Simon Willis 1. Additionally or if you prefer videos, the recent 1h "busy persons intro" by Andrei Karpathy is great + dense as well 2. 1 link 2 link to this video EDIT: Maybe I misunderstood as you asked about papers, not general intros. I don´t think that reading papers is the best way to "catch up" as the pace is rapid and knowledge very decentralized. I can confirm what Andrej recently wrote on X 3: "Unknown to many people, a growing amount of alpha is now outside of Arxiv, sources include but are not limited to: - link - HN - that niche Discord server - anime profil…

kozikowon Hacker News • Recommends

On “Ask HN: AI/ML papers to catch up with current state of AI?”

…nowadays. So just getting into the practitioner area is the best way to get productive with those models. And you improve as a practitioner by practicing, not by reading papers. If you're at the computer, your time is best spent writing code and interacting with those models in my opinion. If you cannot (e.g. commute) I listen to some stuff (e.g. link to this video - Anything from Karpathy on youtube, or link channel).…

sk11001on Hacker News • Recommends

On “Ask HN: Why has ChatGPT a bias towards correctness?”

Look into the training process - link to this video The goal of the initial pretraining phase is to make it good at predicting the next word. The rest of the training process is aimed at making it (1) helpful and (2) as correct as possible. I think some people oversimplify things by calling LLMs "next token predictors" and they leave out the tuning towards helpfulness and correctness.

runjakeon Hacker News • Recommends

On “Ask HN: 16 yo Nephew, in E. Africa, wants to train an LLM with on disk Wikipedia”

In addition to the other great suggestions, point him to Karpathy's YouTube channel1. Karpathy has an approachable communication style. Here's his "1 hour intro to LLMs" video: link to this video 1. link

tikkunon Hacker News • Recommends

On “Ask HN: AI Training for Executive Level”

I suspect these videos would be higher quality than most offerings from universities or business schools (given that it's a fast moving field, and most of the true experts are practitioners, and so if they're teaching, they're not teaching actual classes, at most they're doing youtube videos or interviews): - link (Jeremy Howard Hacker's Guide to LLMs) - link to this video (Karpathy Intro to LLMs)

philipkglasson Hacker News • Recommends

On “The Unbearable Cheapness of Open Weight Models”

The weights are just numbers. I don't what technical background you have in other areas of computing, but I think that this is a good, short introduction that doesn't assume too much: link To quote part of it, Training a model can be thought of as tuning the dials on a really big machine. The way that a language model behaves is entirely determined by these many different continuous values, usually called parameters or weights. Longer and slightly more technical, "Intro to Large Language Models" by Andrej Karpathy: link to this video

u/graphitoutin r/compsci • Mentions

On “Is there room for significant innovations in computer science, or has it reached its peak?”

Not purely computer science. I recently saw A. Karpathy discussing about LLM-OS. link to this video
6View on Reddit

JacobJeppesenon Hacker News • Mentions

On “Sam Altman's ouster was precipitated by letter to board about AI breakthrough”

Seems like they have made progress in combining reinforcement learning and LLMs. Andrej Karpathy mentions it in his new talk (~38 minutes in) 1, and Ilya Sutskever talks about it in a lecture at MIT (~29 minutes in) 2. Finding a proper reward function to train LLMs in a reinforcement learning setup, and using it to train a model to solve math problems in a similar fashion to how AlphaGo used self-play to learn Go, would indeed be a tremendous breakthrough. 1 link to this video 2 link

a_wild_dandanon Hacker News • Mentions

On “About That OpenAI "Breakthrough"”

…lated to using the neural nets' general intelligence/flexibility to better broadly estimate their own states/rewards/actions (like humans). [EDIT: To be clear, the Q-learning stuff is my own speculation, whereas the 'System Two' stuff is well known.] Serendipitously, Karpathy broadly discussed these two issues yesterday ! Toward the lecture's end: link to this video…

huijzeron Hacker News • Mentions

On “Training for one trillion parameter model backed by Intel and US govt has begun”

Karpathy in his recent video 1 agrees, but at this point scaling is a very reliable way to better accuracy. 1: link to this video

scriptsmithon Hacker News • Mentions

On “Training for one trillion parameter model backed by Intel and US govt has begun”

Seems like he actually disagrees here: If you train a bigger model on more text, we have a lot of confidence that the next-word prediction task will improve. So algorithmic progress is not necessary, it's a very nice bonus, but we can sort of get more powerful models for free, because we can just get a bigger computer, which we can say with some confidence we're going to get, and just train a bigger model for longer, and we are very confident we are going to get a better result. link to this video (23:43)

jstanleyon Hacker News • Mentions

On “MonadGPT – What would have happened if ChatGPT was invented in the 17th century?”

Are you sure? In Andrej Karpathy's intro to LLMs1, he says pre-training uses about 10TB of text from the web. It's hard to believe that a comparable amount of text had been created, even across all languages, in the entire history of humanity up to the 17th century. 1 link to this video