Welcome to the Singularity

While we're at it, let's learn about it a little bit.

Chapters

Chapter 1

Foundations

What a language model is, probability over sequences, n-grams, bag-of-words, and why counting fails.

Chapter 2

TF-IDF & Sparse Retrieval

Term frequency, inverse document frequency, and why sparse vectors fail to capture meaning — leading us toward dense, learned representations.

Chapter 3

Neural Networks: Perceptrons and Activations

From sparse counts to dense vectors: perceptrons, multi-layer networks, and activation functions.

Chapter 4

Neural Networks: Loss and Optimization

Loss functions, cross-entropy, softmax, and gradient descent — how a network knows it is wrong and how to improve.

Chapter 5

Neural Networks: Backpropagation

The chain rule applied backward through a network, turning one loss value into gradients for every weight and bias.

Chapter 6

RNN & Sequence Models

Recurrent neural networks, sequence tasks, unrolling through time, and the vanishing gradient problem that motivates gated architectures.

Chapter 7

LSTM & Seq2Seq

Long Short-Term Memory gates, sequence-to-sequence models, and why attention replaced recurrence for long contexts.

Chapter 8

Word Vectors and Embeddings

Dense vectors, Word2Vec, analogies, subword tokenization, static and contextual embeddings, positional encoding, and an interactive embedding-space playground.

Chapter 9

Attention Is All You Need

Self-attention, query-key-value, multi-head attention, and the math behind it — built on top of sequence models.

Chapter 10

The Transformer Block

Layer norm, residual connections, feed-forward networks, and encoder/decoder variants.

Chapter 11

Training Large Language Models

Tokenization at scale, next-token prediction, optimizers, and training dynamics.

Chapter 12

Generation and Sampling

Greedy, beam, temperature, top-k, top-p, and interactive text generation.

Chapter 13

Modern LLMs

Scaling laws, GPT/LLaMA/Mistral families, MoE, and multimodal extensions.

Chapter 14

Fine-Tuning and Alignment

SFT, RLHF, LoRA, instruction tuning, and parameter-efficient methods.

Chapter 15

Using and Evaluating LLMs

Prompt engineering, RAG, benchmarks, and failure modes.