Skip to content

Blog

LLM Field Guide 02 — Inside the Transformer: Position, Attention, and Feed-Forward Layers

Every LLM you'll deploy in 2026 is the same machine: one decoder block, copied 28 to 100+ times, with an embedding table on one end and a vocabulary-sized classifier on the other. Inside each block, attention lets tokens read each other and a feed-forward network rewrites each token on its own, while RoPE tells attention who sits where. Learn the block once and you can read any model's config.json, predict its memory footprint, and say where its 8 billion parameters live.

LLM Field Guide 03 — Training and Generation: Where Weights Come From and How Tokens Get Picked

Every one of an 8B model's 8 billion weights starts as random noise and ends up useful because of one loop: predict the next token, measure the error, nudge every weight a tiny bit, repeat about a million times. At inference time the same model outputs a probability for every token in its vocabulary, and a sampler you configure per request picks one. This post works both halves with real numbers on "The cat sat": logits, loss, gradients, AdamW, the cost of a pretraining run, then temperature, top-p, min-p, constrained decoding, and why temperature=0 still isn't deterministic.

LLM Field Guide 04 — Memory Is the Bottleneck: KV Cache, Attention Variants, and Long Context

The KV cache makes generation fast by never recomputing the past, and it costs memory that grows with every token in flight. On a Llama-3.1-8B-class model, one 128K-token conversation needs about 16 GiB of cache, roughly as much as the weights. Almost every modern attention variant, serving trick, and context-length caveat exists to manage this one cache.

LLM Field Guide 09 — Making It Smaller and Faster: Quantization, Mixture of Experts, and Speculative Decoding

Three tricks make a model cheaper to run without making it dumber: store fewer bits per weight, run fewer weights per token, and produce more tokens per pass. Quantization gets you 2–4× smaller and faster, MoE gets you big-model quality at small-model compute, and speculative decoding gets you 2–3× lower latency with identical outputs. Each one has a catch, and this post shows exactly where it bites.

LLM Field Guide 10 — Serving at Scale: Multi-GPU Parallelism and Inference Engines

Every multi-GPU strategy is a trade: you split the model to make it fit or go faster, and you pay in communication. Pick the split your interconnect can afford and 8 GPUs behave like one big GPU; pick wrong and they behave like 8 small ones waiting on each other. Then the inference engine decides whether that hardware produces 50 tokens/s or 5,000, by how it batches, pages memory, and picks kernels.