Chammarychammary

[1hr Talk] Intro to Large Language Models

Andrej Karpathy · 59:48 · 2 years ago

Large language models (LLMs) function like the kernel of an emerging operating system, using next-word prediction to coordinate memory, external tools, and reasoning, while facing inherent security vulnerabilities due to their reliance on empirical learning.

  • File composition — A standard LLM consists of just two parts: a large file containing weight parameters and a small program file that executes them .

  • Training process — The base model is created by compressing massive amounts of internet text into parameters via a computationally intensive next-word prediction task .

  • Assistant refinement — Developers transform base models into functional assistants through fine-tuning, where the model learns to follow question-and-answer formats and specific user instructions .

  • Scaling laws — Performance consistently improves as a predictable function of model size and the amount of data used for training, suggesting larger models will inherently perform better without needing new algorithms .

  • Tool integration — Advanced models act like OS kernels by orchestrating external resources to solve problems, such as:

    • Browsers for gathering real-time data .
    • Calculators for accurate math .
    • Code interpreters for data analysis and plotting .
  • System thinking — Current models rely on "System 1" (instinctive/fast) processing, but research is focused on implementing "System 2" capabilities, which allow for slower, deliberative reasoning .

  • Security risks — LLMs are susceptible to unique attack vectors:

    • Jailbreaks — using roleplay or adversarial patterns to bypass safety restrictions .
    • Prompt injection — embedding hidden instructions in data, such as images or websites, to hijack the model's behavior .
    • Data poisoning — injecting malicious text into training data to create "backdoors" that trigger harmful outputs upon specific cues .
  • How does fine-tuning differ from the initial pre-training phase?

  • What distinguishes "System 1" processing from "System 2" processing in the context of LLMs?