What is a Language Model?
Learning objectives
- Define "language model" precisely
- Understand probability and next-token prediction
- See how this differs from traditional software
- Run a language model and observe behavior
Content outline
01Traditional Software vs. LLMs// 8 min
- ›Rule-based systems: if-then logic
- ›Statistical models: learning from data
- ›Language models: predicting the next word given context
- ›Example: "The capital of France is ___" → P(Paris) = 0.98, P(London) = 0.001
02The Core Idea: Autoregressive Generation// 12 min
- ›How LLMs work step-by-step
- ›Token-by-token generation (show animation)
- ›Why randomness exists (sampling, not deterministic)
- ›Probability distributions over vocabulary
- ›Walk through a full example (prompt → 10 tokens generated, step-by-step)
03Vocabulary and Tokens// 10 min
- ›What's a token? (not a word)
- ›Byte-pair encoding (BPE): how text gets tokenized
- ›Why "ChatGPT" = 3 tokens, "I'm" = 2 tokens
- ›Token counting matters for cost and context
- ›Hands-on: tokenize a sentence, show byte-level breakdown
04First Interaction: Prompt an LLM// 15 min
- ›Access Claude API / ChatGPT API
- ›Structure: system prompt → user message → model response
- ›Demo: simple Q&A
- ›Demo: giving the same prompt twice (same vs. different outputs)
- ›Observation: the model isn't deterministic
Lab assignment
- Generate 5 different outputs from the same prompt
- Token-count 3 prompts of varying length
- Calculate cost (tokens × price per token)
- Screenshot results; submit
Discussion
“Is an LLM just a 'stochastic parrot' that mimics training data, or does it understand something? Why does this distinction matter for products?”