Skip to content

Last updated: 2026-08-08

Ch 24 · How Large Language Models Work ​

Stage: 第三阶 · Expert (L3 → L2) | Pillar: AI Depth

Core Question ​

How does predicting the next token produce "intelligence"?

Soul Insight ​

A language model is a compressed world model. The prediction task forces the model to learn the statistical structure of the world — not just words, but the relationships, facts, and reasoning patterns encoded in text. Emergent capabilities are not magic; they are what happens when a powerful enough function approximator is trained on a rich enough signal.

Concepts ​

  • Autoregressive generation: sampling from P(x_t | x_1...x_{t-1})
  • Scaling laws: compute, data, and parameter count — and why they interact
  • In-context learning: why examples in the prompt change behavior without weight updates
  • Instruction tuning and RLHF: aligning the model to intent, not just next-token prediction
  • Emergent capabilities: threshold behavior at scale — and why it's hard to predict
  • Tokenization: BPE/SentencePiece — why tokenization choices matter

Practice Anchor ​

Trace the GPT lineage to understand what each generation added:

ModelKey changeWhy it mattered
GPT-1Unsupervised pretraining + finetuningTransfer learning for NLP
GPT-2Scale + zero-shotCapabilities from scale alone
GPT-3In-context learningNo finetuning needed
InstructGPTRLHFAlignment to human intent
GPT-4Multimodal + scaleGeneral capability jump

Status ​

Placeholder — content to be developed.

Built as an open learning notebook