<?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>KV Cache on Richelieu's Blog</title><link>https://beaiera.top/tags/kv-cache/</link><description>Recent content in KV Cache on Richelieu's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 05 Jun 2026 12:00:00 +0800</lastBuildDate><atom:link href="https://beaiera.top/tags/kv-cache/index.xml" rel="self" type="application/rss+xml"/><item><title>vLLM 中的 Attention Sink 与 Sliding Window Attention 深度解析</title><link>https://beaiera.top/posts/vllm-deepseek-v4-attention-sink-swa/</link><pubDate>Fri, 05 Jun 2026 12:00:00 +0800</pubDate><guid>https://beaiera.top/posts/vllm-deepseek-v4-attention-sink-swa/</guid><description>&lt;h2 id="概述"&gt;概述&lt;/h2&gt;
&lt;p&gt;本文围绕 vLLM 推理引擎中的两个关键注意力机制展开深入分析：&lt;strong&gt;Attention Sink&lt;/strong&gt;（注意力沉没）和 &lt;strong&gt;Sliding Window Attention&lt;/strong&gt;（滑动窗口注意力，SWA）。内容涵盖它们的设计原理、vLLM 中的代码实现、KV cache 管理流程，以及 DeepSeek V4 模型如何运用这些技术。&lt;/p&gt;
&lt;p&gt;所有分析基于 vLLM 代码库中 DeepSeek V4 相关的实现。&lt;/p&gt;</description></item><item><title>vLLM TurboQuant 介绍：极低比特 KV Cache 量化</title><link>https://beaiera.top/posts/turboquant-intro/</link><pubDate>Mon, 01 Jun 2026 10:00:00 +0800</pubDate><guid>https://beaiera.top/posts/turboquant-intro/</guid><description>&lt;h2 id="引言"&gt;引言&lt;/h2&gt;
&lt;p&gt;大语言模型（LLM）推理时，KV Cache 是显存消耗的主要来源之一。以 LLaMA-70B 为例，在 4096 上下文长度下，KV Cache 占用超过 40 GB 显存。传统的 FP16 KV Cache 每个 token 需要 2 × head_dim × num_heads × 2 bytes = 大量显存。如果能将 KV Cache 压缩到 3-4 bit，就可以将显存占用降低到原来的 1/4 到 1/5，从而支持更长的上下文、更大的 batch size，或在更少的 GPU 上运行同一模型。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TurboQuant&lt;/strong&gt;（Zandieh et al., ICLR 2026）正是为此而生——它是 vLLM 中实现的一种极低比特 KV Cache 量化方法，通过 Hadamard 旋转 + Lloyd-Max 最优标量量化 + Norm Correction 的组合，将 KV Cache 压缩至 3-4 bit，最高实现 4.9× 压缩比。&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="为什么需要-turboquant"&gt;为什么需要 TurboQuant？&lt;/h2&gt;
&lt;p&gt;在 TurboQuant 之前，vLLM 已经支持了 FP8 KV Cache（2× 压缩，几乎无损）。但 2× 压缩在某些场景下仍然不够：&lt;/p&gt;</description></item></channel></rss>