<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>优化 on k4i's blog</title><link>https://k4i.top/zh/tags/%E4%BC%98%E5%8C%96/</link><description>Recent content in 优化 on k4i's blog</description><generator>Hugo -- gohugo.io</generator><language>zh</language><managingEditor>sky_io@outlook.com (K4i)</managingEditor><webMaster>sky_io@outlook.com (K4i)</webMaster><copyright>All content is subject to the license of &lt;a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;CC BY-NC-SA 4.0&lt;/a&gt; .</copyright><lastBuildDate>Mon, 20 Apr 2026 12:00:00 +0800</lastBuildDate><atom:link href="https://k4i.top/zh/tags/%E4%BC%98%E5%8C%96/index.xml" rel="self" type="application/rss+xml"/><item><title>LLM 推理中为什么 K、V 可以被缓存</title><link>https://k4i.top/zh/posts/kv-cache/</link><pubDate>Mon, 20 Apr 2026 12:00:00 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Wed, 22 Apr 2026 01:27:12 +0800</atom:modified><guid>https://k4i.top/zh/posts/kv-cache/</guid><description>&lt;h2 id="introduction"&gt;引言&lt;/h2&gt;
&lt;p&gt;大语言模型以&lt;strong&gt;自回归&lt;/strong&gt;方式生成文本——每次生成一个 token，每个新 token 依赖于之前所有 token。这种串行特性带来了一个根本的优化机会：每一步中大部分计算是&lt;strong&gt;冗余&lt;/strong&gt;的。&lt;/p&gt;</description><dc:creator>K4i</dc:creator><media:content url="https://k4i.top//images/posts/kv-cache/cover.png" medium="image"><media:title type="html">featured image</media:title></media:content><category>llm</category><category>推理</category><category>kv-cache</category><category>transformer</category><category>优化</category><category>AI</category></item></channel></rss>