Language Model Foundations
The mathematical formulations and systems engineering mechanics that power modern Large Language Models — tracing the end-to-end computational pipeline from discrete byte streams to emergent generation.
1. Tokenization
The discrete symbol-to-index boundary: Information-theoretic subword compression, Byte-Pair Encoding (BPE), byte-level fallbacks, and cross-lingual fertility.
2. Embeddings
From discrete indices to continuous manifolds: Parameter matrices, cosine geometry, dual projection weight tying, and RMSNorm stabilization.
3. Positional Encoding
Breaking permutation symmetry in self-attention: Harmonic sinusoidal waves, complex 2D Rotary Position Embeddings (RoPE), ALiBi distance biases, and YaRN context scaling.
4. Attention Mechanisms
Parallel associative memory retrieval: Scaled dot-product matrix arithmetic, causal masking, KV-cache memory bandwidth walls, MQA/GQA, and FlashAttention SRAM tiling.
5. Model Architecture
The evolutionary arc: From 2017 Transformer encoder-decoders to BERT, GPT, T5, sparse Mixture of Experts (MoE), DeepSeek Multi-Head Latent Attention (MLA), and text diffusion.