<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Chi's Blog</title><link>https://zhangchitc.com/posts/</link><description>Recent content in Posts on Chi's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 05 Nov 2026 21:53:39 +0800</lastBuildDate><atom:link href="https://zhangchitc.com/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>How DeepSeek's Multi-Head Latent Attention Works</title><link>https://zhangchitc.com/posts/multi-head-latent-attention/</link><pubDate>Tue, 27 Oct 2026 01:44:00 +0800</pubDate><guid>https://zhangchitc.com/posts/multi-head-latent-attention/</guid><description>MLA caches one 512-dimensional latent per token instead of 128 heads&amp;rsquo; worth of keys and values, and matrix absorption means it never has to decompress them. We derive it step by step: joint compression, absorption, why RoPE breaks it, and the decoupled RoPE branch that fixes it.</description></item><item><title>How Continuous Batching Enables High-Concurrency LLM Inference</title><link>https://zhangchitc.com/posts/continuous-batching/</link><pubDate>Fri, 09 Oct 2026 16:23:00 +0800</pubDate><guid>https://zhangchitc.com/posts/continuous-batching/</guid><description>Naive batching holds every slot until the longest request finishes. Continuous batching swaps requests in and out at every forward step, which means packing prefill and decode tokens into one flat input and splitting attention back out per request with a cu_seqlens boundary table.</description></item><item><title>RadixAttention: How SGLang Reuses the KV Cache Across Requests</title><link>https://zhangchitc.com/posts/radix-attention/</link><pubDate>Sat, 26 Sep 2026 20:12:00 +0800</pubDate><guid>https://zhangchitc.com/posts/radix-attention/</guid><description>SGLang keeps the KV cache in a radix tree: edges hold runs of tokens, nodes hold the GPU slot indices where their KV lives. We walk through the slot pool, TreeNode, inserting and splitting nodes, LRU eviction, and four requests that fill the pool and force an eviction.</description></item><item><title>How RoPE Improves on Sinusoidal Positional Encoding</title><link>https://zhangchitc.com/posts/rope/</link><pubDate>Sun, 13 Sep 2026 16:34:00 +0800</pubDate><guid>https://zhangchitc.com/posts/rope/</guid><description>Sinusoidal encoding has a neat rotation property, but it breaks once the encoding goes through attention&amp;rsquo;s projection matrices. We expand the dot product to see why, then put RoPE through the same expansion and watch the absolute positions cancel out.</description></item><item><title>Why Transformers Need Positional Encoding</title><link>https://zhangchitc.com/posts/positional-encoding/</link><pubDate>Sat, 05 Sep 2026 19:28:00 +0800</pubDate><guid>https://zhangchitc.com/posts/positional-encoding/</guid><description>Attention can&amp;rsquo;t tell &amp;ldquo;dog bites man&amp;rdquo; from &amp;ldquo;man bites dog&amp;rdquo;. We try integer, fractional and binary encodings, see where each one breaks, and arrive at sines and cosines: a set of clock hands spinning at different speeds.</description></item><item><title>How Mixture of Experts Scales Model Parameters</title><link>https://zhangchitc.com/posts/mixture-of-experts/</link><pubDate>Sun, 30 Aug 2026 16:32:00 +0800</pubDate><guid>https://zhangchitc.com/posts/mixture-of-experts/</guid><description>Mixture of Experts lets a model&amp;rsquo;s parameter count grow tens of times over while the compute per token barely moves. We build it up step by step: copying the FFN into experts, the router, dispatch and combine, top-K routing, and the auxiliary loss that keeps experts balanced.</description></item><item><title>Why FlashAttention is So Fast</title><link>https://zhangchitc.com/posts/flash-attention/</link><pubDate>Sun, 23 Aug 2026 17:09:00 +0800</pubDate><guid>https://zhangchitc.com/posts/flash-attention/</guid><description>FlashAttention does every multiplication standard attention does, yet runs several times faster. We build it up step by step from the GPU memory hierarchy: kernel fusion, safe softmax, online softmax, and tiling.</description></item><item><title>How PagedAttention Works: Paging the KV Cache Like an Operating System</title><link>https://zhangchitc.com/posts/paged-attention/</link><pubDate>Tue, 18 Aug 2026 21:09:00 +0800</pubDate><guid>https://zhangchitc.com/posts/paged-attention/</guid><description>Why serving LLMs fragments GPU memory, and how vLLM&amp;rsquo;s PagedAttention fixes it with OS-style paging: physical blocks, a block table, chained block hashes, and a walkthrough of how blocks are allocated, shared, freed and evicted.</description></item><item><title>How Much GPU Memory Does the KV Cache Really Take?</title><link>https://zhangchitc.com/posts/kv-cache-memory/</link><pubDate>Tue, 21 Jul 2026 15:33:00 +0800</pubDate><guid>https://zhangchitc.com/posts/kv-cache-memory/</guid><description>We build the KV cache size formula one factor at a time, from single-head attention to multi-head, stacked layers and MQA/GQA, then check it against a real calculator: 13.73 GiB for 100,000 tokens on Qwen3-8B.</description></item><item><title>KV Cache vs. Prompt Cache: What's the Difference?</title><link>https://zhangchitc.com/posts/kv-cache-vs-prompt-cache/</link><pubDate>Sun, 24 May 2026 14:53:00 +0800</pubDate><guid>https://zhangchitc.com/posts/kv-cache-vs-prompt-cache/</guid><description>A prompt cache doesn&amp;rsquo;t store your last answer. We walk through prefill, decode and attention to see what the KV cache keeps, and how a prompt cache reuses it across requests.</description></item></channel></rss>