Modules 11.1–11.3 built the machinery of language modeling: tokens, next-token prediction, context windows, and the decoder-only GPT stack. This lecture names the product of that stack at scale: the large language model (LLM).
Module 11.4 then asks how we adapt LLMs—instruction tuning, fine-tuning, PEFT, RLHF/DPO—and how we reason about alignment, hallucination, and context length. Module 11.5 surveys the major model families.
Learning Objectives
By the end of this lesson, students should be able to:
- Define an LLM as a scaled transformer language model trained for next-token prediction.
- Separate pretraining, post-training (SFT/alignment), and inference stages.
- Contrast LLMs with classical n-gram and small neural LMs on capability and cost.
- Name the main levers of scale: parameters, data, and compute.
- List typical LLM capabilities and failure modes at a systems level.
- Locate LLMs inside the Volume 11 curriculum map.
A large language model (LLM) is a neural language model—almost always a decoder-only transformer—trained on massive text (and often code/multimodal) corpora so that next-token prediction yields broad in-context abilities: generation, summarization, question answering, coding help, and tool use when wrapped in an application stack.
What “Large” Usually Means
“Large” is not a sharp cutoff. In practice it means models with billions of parameters, trained on trillions of tokens, that exhibit strong few-shot and instruction-following behavior after post-training. Smaller specialized models can still be excellent; the label marks the general-purpose foundation regime.
| Era | Typical size | Training signal | User interface |
|---|---|---|---|
| Classical LM | n-grams / tiny nets | Local counts | Spellcheck, speech lattices |
| Early neural LM | Millions of params | Next token / MLM | Embeddings, classifiers |
| Modern LLM | Billions+ | Next token at web scale | Chat, agents, APIs |
Lifecycle of an LLM
Self-supervised next-token loss on huge corpora.
Instruction SFT, preference tuning, domain fine-tunes.
Inference with sampling, tools, RAG, safety filters.
Benchmarks + product metrics + human review.
Capabilities vs. Limits
What LLMs Do Well
- Fluent generation and rewriting.
- In-context learning from examples in the prompt.
- Code scaffolding and explanation.
- Routing work when paired with tools/RAG.
What They Struggle With
- Guaranteed factual truth without retrieval.
- Long-horizon planning without scaffolding.
- Private / up-to-date facts not in context.
- Cost and latency at high throughput.
Strengths
- One model covers many NLP tasks.
- Prompting enables rapid iteration.
- Post-training steers behavior without full retrain.
Tradeoffs
- Training and serving are expensive.
- Opaque failure modes (hallucination, bias).
- Evaluation is harder than for single-task models.
“An LLM is a database or a search engine.” It is a generative probability model over tokens. It can imitate knowledge from training data and context, but it does not retrieve facts by default unless you add retrieval, tools, or grounding.
Knowledge Check
- Short Answer: What training objective do modern LLMs primarily use? Answer: Next-token prediction (autoregressive language modeling).
- True/False: Every useful language model must have hundreds of billions of parameters. Answer: False—size helps generality, but smaller specialized models can excel.
- Multiple Choice: Post-training typically includes: (a) only random init, (b) SFT / preference tuning, (c) only OCR, (d) only k-means. Answer: (b).
- Short Answer: Name three scale levers for LLMs. Answer: Parameters, data (tokens), and compute.
- True/False: LLMs guarantee factual correctness on every answer. Answer: False—they can hallucinate without grounding.
- Multiple Choice: The dominant LLM architecture today is: (a) pure RNN, (b) decoder-only transformer, (c) SVM, (d) k-NN. Answer: (b).
- Short Answer: What does in-context learning mean? Answer: Adapting behavior from examples/instructions inside the prompt without updating weights.
- True/False: Inference cost is negligible for production LLM apps. Answer: False—latency and token cost dominate many budgets.
- Multiple Choice: Module 11.4 focuses next on adapting LLMs via: (a) only CNNs, (b) instruction tuning and related methods, (c) only PCA, (d) only hashing. Answer: (b).
- Short Answer: Why is an LLM not “just a search engine”? Answer: It generates tokens from a probability model; it does not retrieve documents unless retrieval is added.
Key Takeaways
- LLMs are scaled transformer LMs whose core skill is next-token prediction.
- Value comes from pretraining + post-training + application scaffolding.
- They are generalists with real limits: truthfulness, cost, and controllability.
- Next: Foundation Model generalizes the idea beyond text-only LLMs.
Demo: Show the same prompt on a tiny base model vs an instruction-tuned chat model—discuss fluency vs following instructions.
Discussion: Which product failures are model failures vs systems failures (missing RAG, bad prompts, no evals)?
Recap: An LLM is a large-scale generative language model; Module 11.4 studies how we adapt and govern it. Continue with Foundation Model.