Theory of Intelligence
1.1 What Is an LLM•Concept 1 of 7

1.1.1 Language Modelling: The Core Task

lightbulb

Book 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:

  1. What is an LLM at a high level?
  2. 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):

P(w1,w2,…,wT)=∏t=1TP(wt∣w1,w2,…,wt−1)P(w_1, w_2, \dots, w_T) = \prod_{t=1}^{T} P(w_t \mid w_1, w_2, \dots, w_{t-1})

Given the prompt:

lightbulb

"The capital of France is ___"

The model computes a probability distribution over its vocabulary:

  • P("Paris"∣prompt)=0.94P(\text{"Paris"} \mid \text{prompt}) = 0.94
  • P("Lyon"∣prompt)=0.02P(\text{"Lyon"} \mid \text{prompt}) = 0.02
  • P("banana"∣prompt)=0.000001P(\text{"banana"} \mid \text{prompt}) = 0.000001

What makes it "Large"?

  1. Parameter Scale: Traditional neural networks have thousands or millions of parameters. Large Language Models have tens to hundreds of billions of parameters.
  2. Data Scale: Pre-trained on trillions of tokens from books, codebases, academic papers, and the open web.
  3. Emergent Capabilities: At scale, models exhibit few-shot learning, cross-lingual reasoning, translation, and structured code synthesis without task-specific retraining.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!