al.
A place to keep my sparks. All opinions are my own.
Browse series & topics
Latest posts
-
Can Attention Remember Without Keeping Every Token?
Start from a KV cache that keeps growing, see how associativity turns pairwise reads into one continually updated state, and work out what that state can remember and why it must mix things up.
-
How Does an LLM Generate One Token at a Time?
Follow a final vector into the vocabulary, then trace prefill, token-by-token decoding, and why each layer can reuse its old Keys and Values.
-
What Does a Transformer Block Actually Do?
Follow one three-cell record card through attention, residual addition, and a feed-forward network, then put normalization back into the block.
-
Why I Built LLM from First Principles
Why relying on coding agents made me uneasy, and how writing LLM and RL implementations by hand became a way to rebuild understanding.
-
How Does a Token Read Its Context?
From an intuitive reading request to self-attention, Q/K/V, learned matching, normalized reading, and causal masking.
-
Attention: How Does a Model Decide Where to Look?
From human selective attention to recurrent encoder–decoders, additive attention, and learning how to read from context.
-
How Does Text Become a Vector?
From tokenization and word embeddings to learned representations and positional encodings: how text becomes a trainable numerical input.
-
How Does a Neural Network Know Which Way to Move?
How Taylor approximation, gradient descent, and backpropagation turn a model's prediction loss into a concrete parameter update.
-
Why Does −log p Keep Appearing?
From surprisal to entropy, cross-entropy, and KL divergence: why the same logarithm measures information and prediction loss.
-
Where Do Probabilities Come From?
How observations become model distributions: shared parameters, logits, Softmax, the chain rule, maximum likelihood, and negative log-likelihood.