<?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>Position-Encoding on k4i's blog</title><link>https://k4i.top/zh/tags/position-encoding/</link><description>Recent content in Position-Encoding 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>Thu, 28 May 2026 21:53:12 +0800</lastBuildDate><atom:link href="https://k4i.top/zh/tags/position-encoding/index.xml" rel="self" type="application/rss+xml"/><item><title>从绝对位置编码到 RoPE：位置为什么可以被旋转表示</title><link>https://k4i.top/zh/posts/positional-encoding-to-rope/</link><pubDate>Thu, 28 May 2026 21:53:12 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Thu, 04 Jun 2026 01:12:37 +0800</atom:modified><guid>https://k4i.top/zh/posts/positional-encoding-to-rope/</guid><description>&lt;h2 id="introduction"&gt;引言&lt;/h2&gt;
&lt;p&gt;Transformer 的自注意力有一个看似反直觉的性质：如果不给 token 额外的位置提示，它本身并不知道一句话里的词序。&lt;/p&gt;
&lt;p&gt;比如下面两句话：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;我 喜欢 你&lt;/li&gt;
&lt;li&gt;你 喜欢 我&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;它们的 token 集合几乎一样，但语义完全不同。RNN 会按时间步读取输入，CNN 会用局部窗口保留邻近关系，而标准 self-attention 对一组输入向量做的是全局两两匹配。只看 attention 公式：&lt;/p&gt;</description><dc:creator>K4i</dc:creator><media:content url="https://k4i.top//images/posts/positional-encoding-to-rope/rope-rotation-icon.svg" medium="image"><media:title type="html">featured image</media:title></media:content><category>llm</category><category>transformer</category><category>attention</category><category>position-encoding</category><category>rope</category><category>AI</category></item></channel></rss>