Machine Learning
LLM inference, KV caching, parameter counts, backtesting, and the linear algebra underneath.
2026
Aug 30Backtesting you can trust: determinism, costs and common errorsWhy most backtests lie — lookahead bias, fantasy fills, ignored Indian charges — and how deterministic Parquet outputs make results diffable, re-auditable, and reproducible.May 3KV Cache and PagedAttention: Why vLLM Actually WorksKV cache stores attention keys and values across tokens to avoid recomputation during autoregressive decoding. PagedAttention extends this with virtual memory paging, making vLLM's throughput possible.May 2LLM Inference Optimization: Stop Paying for Idle SiliconLLM inference is memory-bandwidth bound, not compute bound. Continuous batching, speculative decoding, quantization, and KV cache management — the techniques that actually move the needle.Jan 8Eigenvalues of a MatrixEigenvalues and eigenvectors — the linear algebra behind PCA, Google's PageRank, and the stability analysis of dynamical systems. Geometric intuition and computation.
2025
Sep 12Counting the Parameters in an LLMHow to count parameters in a transformer LLM — attention heads, MLP layers, embeddings, and normalization. Includes a worked example matching published model sizes.Sep 6Matrix-Vector Dot ProductMatrix-vector dot products are the inner loop of neural network inference. Understanding the memory access patterns and FLOP counts explains why hardware utilisation matters so much.