lightbulbBook reference: Alammar & Grootendorst, Hands-On Large Language Models, Chapter 1.
Before dissecting complex generative architectures like GPT, Claude, or LLaMA, we must answer two fundamental questions:
- What is an LLM at a high level?
- What is the mathematical engine running under the hood?
An LLM is not magic; it is an astronomical assembly of simple mathematical computing units—artificial neurons—working together through matrix transformations and activation functions.
At its core, a Language Model (LM) is a statistical or mathematical system that assigns probabilities to sequences of words (or tokens):
Given the prompt:
lightbulb"The capital of France is ___"
The model computes a probability distribution over its vocabulary:
What makes it "Large"?
- Parameter Scale: Traditional neural networks have thousands or millions of parameters. Large Language Models have tens to hundreds of billions of parameters.
- Data Scale: Pre-trained on trillions of tokens from books, codebases, academic papers, and the open web.
- Emergent Capabilities: At scale, models exhibit few-shot learning, cross-lingual reasoning, translation, and structured code synthesis without task-specific retraining.