{"id":121051,"date":"2026-11-02T01:09:56","date_gmt":"2026-11-01T17:09:56","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/121051.html"},"modified":"2026-11-02T01:09:56","modified_gmt":"2026-11-01T17:09:56","slug":"rope-%e8%9e%8d%e5%90%88%e5%88%b0-attention-%e5%89%8d%ef%bc%8c%e5%85%88%e7%a1%ae%e8%ae%a4%e4%bd%8d%e7%bd%ae%e4%b8%8e%e9%a2%91%e7%8e%87%e7%9a%84%e5%90%88%e5%90%8c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/121051.html","title":{"rendered":"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261101170951-6ae7725ff16f2.png\" alt=\"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c\uff1a\u4e3b\u9898\u5c01\u9762\" \/><\/p>\n<p>RoPE \u53ef\u4ee5\u4e0e Q\u3001K \u7684\u751f\u4ea7\u6216\u8bfb\u53d6\u878d\u5408&#xff0c;\u7701\u53bb\u5355\u72ec\u5f20\u91cf\u7269\u5316\u3002\u4f46\u201c\u878d\u5408\u201d\u4e0d\u5e94\u6539\u53d8\u6a21\u578b\u539f\u672c\u4f7f\u7528\u7684\u65cb\u8f6c\u5b9a\u4e49\u3002\u4e0d\u540c\u6a21\u578b\u7684\u9891\u7387\u3001\u901a\u9053\u914d\u5bf9\u3001\u4f4d\u7f6e\u504f\u79fb\u548c\u957f\u4e0a\u4e0b\u6587\u7f29\u653e\u914d\u7f6e\u53ef\u80fd\u4e0d\u540c&#xff1b;\u8fd9\u4e9b\u5185\u5bb9\u4e0d\u80fd\u4ece\u53e6\u4e00\u4e2a\u6a21\u578b\u76f4\u63a5\u642c\u8fc7\u6765\u3002<\/p>\n<p>RoFormer \u8bba\u6587\u6700\u521d\u63d0\u4ea4\u4e8e 2021 \u5e74 4 \u6708&#xff0c;\u4f7f\u7528\u65cb\u8f6c\u7f16\u7801\u4f4d\u7f6e\u4fe1\u606f\u3002\u8fd9\u91cc\u5148\u9a8c\u8bc1\u4e8c\u7ef4\u65cb\u8f6c\u7684\u4e24\u4e2a\u6027\u8d28&#xff1a;\u957f\u5ea6\u4e0d\u53d8&#xff0c;\u4e24\u4e2a\u4f4d\u7f6e\u7684\u70b9\u79ef\u53ea\u4f9d\u8d56\u76f8\u5bf9\u65cb\u8f6c\u3002\u5b83\u4eec\u80fd\u5e2e\u52a9\u68c0\u67e5\u5b9e\u73b0&#xff0c;\u5374\u4e0d\u8db3\u4ee5\u8bc1\u660e\u67d0\u4e2a\u6a21\u578b\u80fd\u76f4\u63a5\u66ff\u6362\u4f4d\u7f6e\u7f16\u7801\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261101170953-6ae77261b1de5.png\" alt=\"RoPE \u7684\u6210\u5bf9\u65cb\u8f6c\u4fdd\u6301\u8303\u6570\uff0c\u5e76\u5728\u70b9\u79ef\u4e2d\u4f53\u73b0\u76f8\u5bf9\u4f4d\u7f6e\" \/><\/p>\n<p>RoPE \u7684\u6210\u5bf9\u65cb\u8f6c\u4fdd\u6301\u8303\u6570&#xff0c;\u5e76\u5728\u70b9\u79ef\u4e2d\u4f53\u73b0\u76f8\u5bf9\u4f4d\u7f6e\u3002<\/p>\n<p>import math<\/p>\n<p>def rotate(v,theta):<br \/>\n    x,y&#061;v; c,s&#061;math.cos(theta),math.sin(theta)<br \/>\n    return (x*c-y*s,x*s&#043;y*c)<\/p>\n<p>def dot(a,b): return sum(x*y for x,y in zip(a,b))<br \/>\nq&#061;(2.,-1.); k&#061;(3.,4.); a,b&#061;.3,1.1<br \/>\nrq,rk&#061;rotate(q,a),rotate(k,b)<br \/>\nassert math.isclose(dot(rq,rq),dot(q,q),rel_tol&#061;1e-12)<br \/>\nassert math.isclose(dot(rq,rk),dot(q,rotate(k,b-a)),rel_tol&#061;1e-12)<br \/>\nprint(&#034;RoPE: norm and relative-angle identity passed&#034;)<\/p>\n<h4>\u5206\u9875\u7f13\u5b58\u91cc\u4f4d\u7f6e\u4ecd\u7136\u662f\u903b\u8f91\u4f4d\u7f6e<\/h4>\n<p>KV \u5b58\u50a8\u88ab\u91cd\u65b0\u5206\u914d\u4ee5\u540e&#xff0c;\u7269\u7406\u5757\u7f16\u53f7\u4e0d\u662f token \u4f4d\u7f6e\u3002\u5df2\u7ecf\u5e94\u7528 RoPE \u7684 K \u5982\u679c\u88ab\u590d\u7528&#xff0c;\u540e\u7eed\u5c31\u4e0d\u80fd\u518d\u6309\u65b0\u5757\u5730\u5740\u65cb\u8f6c\u4e00\u6b21\u3002\u524d\u7f00\u7f13\u5b58\u7684\u8eab\u4efd\u4e5f\u9700\u8981\u5305\u542b\u6a21\u578b\u4e0e\u4f4d\u7f6e\u914d\u7f6e&#xff1b;\u76f8\u540c token \u5728\u4e0d\u540c\u4f4d\u7f6e\u7b56\u7565\u4e0b\u4e0d\u4e00\u5b9a\u6709\u76f8\u540c K\u3002<\/p>\n<p>ALiBi \u5219\u901a\u5e38\u4f53\u73b0\u4e3a\u6ce8\u610f\u529b\u5206\u6570\u4e0a\u7684\u4f4d\u7f6e\u504f\u7f6e&#xff0c;\u4e0d\u80fd\u4e0e RoPE \u6df7\u79f0\u4e3a\u540c\u4e00\u79cd\u65cb\u8f6c&#xff0c;\u4e5f\u4e0d\u80fd\u5047\u5b9a\u4e24\u4e2a\u6a21\u5757\u53e0\u52a0\u5c31\u66f4\u51c6\u786e\u3002\u5982\u679c\u5e0c\u671b\u6539\u53d8\u5df2\u6709\u6a21\u578b\u7684\u4f4d\u7f6e\u7b56\u7565&#xff0c;\u9700\u8981\u8bad\u7ec3\u6216\u9002\u914d\u4f9d\u636e&#xff0c;\u5e76\u7528\u4efb\u52a1\u8bc4\u4f30\u9a8c\u8bc1\u3002<\/p>\n<h4>\u878d\u5408\u6536\u76ca\u53d6\u51b3\u4e8e\u6570\u636e\u5728\u54ea\u91cc<\/h4>\n<p>\u82e5 Q\u3001K \u539f\u672c\u5c31\u5728\u5bc4\u5b58\u5668\u4e2d&#xff0c;\u65cb\u8f6c\u540e\u76f4\u63a5\u8fdb\u5165 Attention&#xff0c;\u53ef\u80fd\u907f\u514d\u989d\u5916\u5199\u56de\u3002\u82e5\u8bfb\u53d6\u7f13\u5b58 K \u65f6\u91cd\u590d\u8ba1\u7b97\u4e09\u89d2\u51fd\u6570&#xff0c;\u8282\u7701\u4e00\u6b21 kernel \u542f\u52a8\u4e0d\u4e00\u5b9a\u5212\u7b97\u3002\u9891\u7387\u8868\u9884\u8ba1\u7b97\u3001\u5185\u5b58\u5e03\u5c40\u4e0e\u5411\u91cf\u914d\u5bf9\u90fd\u9700\u8981\u6309\u76ee\u6807\u5b9e\u73b0\u8bc4\u4f30\u3002<\/p>\n<h4>\u7f13\u5b58\u6062\u590d\u4e3a\u4ec0\u4e48\u8981\u643a\u5e26\u4f4d\u7f6e\u914d\u7f6e<\/h4>\n<p>\u5047\u8bbe\u4e00\u4e2a\u8bf7\u6c42\u5df2\u7ecf\u5728\u67d0\u5957\u9891\u7387\u914d\u7f6e\u4e0b\u751f\u6210 K&#xff0c;\u53e6\u4e00\u4e2a\u8bf7\u6c42\u4f7f\u7528\u76f8\u540c token \u5374\u91c7\u7528\u53e6\u4e00\u5957\u957f\u4e0a\u4e0b\u6587\u7f29\u653e\u3002\u5373\u4f7f\u903b\u8f91\u4f4d\u7f6e\u76f8\u540c&#xff0c;\u65cb\u8f6c\u540e\u7684 K \u4e5f\u53ef\u80fd\u4e0d\u540c\u3002\u7f13\u5b58\u53ea\u6309 token \u5217\u8868\u67e5\u627e&#xff0c;\u5c31\u4f1a\u628a\u4e00\u79cd\u8ba1\u7b97\u72b6\u6001\u4ea4\u7ed9\u53e6\u4e00\u79cd\u6a21\u578b\u8bed\u4e49\u4f7f\u7528&#xff1b;\u8fd9\u79cd\u9519\u8bef\u901a\u5e38\u4e0d\u4f1a\u8868\u73b0\u6210\u8d8a\u754c&#xff0c;\u800c\u662f\u8f93\u51fa\u9010\u6e10\u504f\u79bb\u53c2\u8003\u3002<\/p>\n<p>\u4f4d\u7f6e\u504f\u79fb\u4e5f\u503c\u5f97\u5355\u72ec\u68c0\u67e5\u3002\u589e\u91cf\u89e3\u7801\u7684\u7b2c\u4e00\u4e2a\u65b0 token \u5e94\u63a5\u5728\u5df2\u6709\u4e0a\u4e0b\u6587\u4e4b\u540e&#xff0c;\u4e0d\u80fd\u6bcf\u6b21\u90fd\u4ece\u4f4d\u7f6e\u96f6\u5f00\u59cb\u3002\u5206\u9875\u4e0e\u524d\u7f00\u590d\u7528\u4f7f\u6570\u636e\u5728\u5185\u5b58\u4e2d\u79fb\u52a8&#xff0c;\u5e76\u4e0d\u6539\u53d8\u5b83\u7684\u903b\u8f91\u4f4d\u7f6e\u3002\u82e5\u8981\u4fdd\u5b58\u65cb\u8f6c\u524d\u7684 K&#xff0c;\u518d\u5728\u8bfb\u53d6\u65f6\u5e94\u7528\u4f4d\u7f6e\u7f16\u7801&#xff0c;\u5c31\u9700\u8981\u53e6\u4e00\u4efd\u660e\u786e\u7684\u7f13\u5b58\u534f\u8bae&#xff0c;\u4e0d\u80fd\u4e0e\u5df2\u7ecf\u65cb\u8f6c\u8fc7\u7684 K \u6df7\u653e\u3002<\/p>\n<p>\u901a\u9053\u914d\u5bf9\u5219\u4f1a\u5f71\u54cd\u6bcf\u6b21\u52a0\u8f7d\u3002\u76f8\u90bb\u4e24\u4e2a\u901a\u9053\u6210\u5bf9&#xff0c;\u4e0e\u628a\u524d\u534a\u6bb5\u548c\u540e\u534a\u6bb5\u5bf9\u5e94\u901a\u9053\u914d\u5bf9&#xff0c;\u662f\u4e0d\u540c\u5e03\u5c40\u7ea6\u5b9a\u3002\u53ea\u7528\u4e24\u4e2a\u7ef4\u5ea6\u7684\u6d4b\u8bd5\u53ef\u4ee5\u9a8c\u8bc1\u65cb\u8f6c\u516c\u5f0f&#xff0c;\u5374\u65e0\u6cd5\u533a\u5206\u8fd9\u4e9b\u9ad8\u7ef4\u6392\u5217\u3002\u63a5\u5165\u771f\u5b9e\u6a21\u578b\u65f6&#xff0c;\u5e94\u9009\u5404\u7ef4\u5ea6\u4e0d\u540c\u7684\u8f93\u5165&#xff0c;\u5bf9\u7167\u6a21\u578b\u5b9a\u4e49\u9010\u5bf9\u68c0\u67e5\u3002<\/p>\n<p>\u878d\u5408\u7684\u5b9e\u65bd\u987a\u5e8f\u53ef\u4ee5\u5f88\u6734\u7d20&#xff1a;\u5148\u7528\u72ec\u7acb\u7b97\u5b50\u5bf9\u9f50\u53c2\u8003&#xff0c;\u518d\u5728\u540c\u4e00\u8f93\u5165\u4e0b\u6539\u6210\u878d\u5408\u7248\u672c&#xff0c;\u6700\u540e\u624d\u53bb\u6389\u4e2d\u95f4\u5f20\u91cf\u3002\u82e5\u76f4\u63a5\u540c\u65f6\u6539\u9891\u7387\u8868\u3001\u901a\u9053\u6b21\u5e8f\u548c\u5185\u6838\u878d\u5408&#xff0c;\u4e00\u6b21\u8bef\u5dee\u5c31\u53ef\u80fd\u6709\u4e09\u4e2a\u6765\u6e90\u3002\u4fdd\u7559\u5206\u6b65\u53ef\u56de\u9000\u7684\u8def\u5f84&#xff0c;\u4f1a\u8ba9\u6027\u80fd\u4f18\u5316\u7684\u4ee3\u4ef7\u66f4\u5bb9\u6613\u63a7\u5236\u3002<\/p>\n<p>\u672c\u4f8b\u4e2d\u7684 Python \u4e09\u89d2\u51fd\u6570\u4e0e\u5143\u7ec4\u64cd\u4f5c\u6ca1\u6709\u6a21\u62df GPU \u5468\u671f&#xff0c;\u4e5f\u6ca1\u6709\u4e0e\u771f\u5b9e\u6a21\u578b\u6bd4\u8f83\u3002\u5728 2026 \u5e74\u7684\u670d\u52a1\u540e\u7aef\u4e2d&#xff0c;\u652f\u6301\u591a\u79cd\u6a21\u578b\u914d\u7f6e\u5df2\u5f88\u5e38\u89c1&#xff1b;\u5de5\u7a0b\u4e0a\u6709\u4ef7\u503c\u7684\u878d\u5408&#xff0c;\u662f\u4fdd\u6301\u5408\u540c\u7684\u540c\u65f6\u51cf\u5c11\u642c\u8fd0&#xff0c;\u4e0d\u80fd\u4e3a\u4e86\u4e00\u4e2a\u878d\u5408\u6807\u7b7e\u6539\u53d8\u6a21\u578b\u5b9a\u4e49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RoPE \u53ef\u4ee5\u4e0e Q\u3001K \u7684\u751f\u4ea7\u6216\u8bfb\u53d6\u878d\u5408&#xff0c;\u7701\u53bb\u5355\u72ec\u5f20\u91cf\u7269\u5316\u3002\u4f46\u201c\u878d\u5408\u201d\u4e0d\u5e94\u6539\u53d8\u6a21\u578b\u539f\u672c\u4f7f\u7528\u7684\u65cb\u8f6c\u5b9a\u4e49\u3002\u4e0d\u540c\u6a21\u578b\u7684\u9891\u7387\u3001\u901a\u9053\u914d\u5bf9\u3001\u4f4d\u7f6e\u504f\u79fb\u548c\u957f\u4e0a\u4e0b\u6587\u7f29\u653e\u914d\u7f6e\u53ef\u80fd\u4e0d\u540c&#xff1b;\u8fd9\u4e9b\u5185\u5bb9\u4e0d\u80fd\u4ece\u53e6\u4e00\u4e2a\u6a21\u578b\u76f4\u63a5\u642c\u8fc7\u6765\u3002<br \/>\nRoFormer \u8bba\u6587\u6700\u521d\u63d0\u4ea4\u4e8e 2021 \u5e74 4 \u6708&#xff0c;\u4f7f\u7528\u65cb\u8f6c\u7f16\u7801\u4f4d\u7f6e\u4fe1\u606f\u3002\u8fd9\u91cc\u5148\u9a8c\u8bc1\u4e8c\u7ef4\u65cb\u8f6c\u7684\u4e24\u4e2a\u6027\u8d28&#xff1a;\u957f\u5ea6\u4e0d\u53d8&#xff0c;\u4e24\u4e2a\u4f4d\u7f6e\u7684\u70b9\u79ef\u53ea\u4f9d\u8d56\u76f8\u5bf9\u65cb\u8f6c\u3002\u5b83\u4eec\u80fd\u5e2e\u52a9\u68c0\u67e5\u5b9e\u73b0&#xff0c;\u5374\u4e0d\u8db3\u4ee5\u8bc1\u660e\u67d0\u4e2a\u6a21\u578b\u80fd<\/p>\n","protected":false},"author":2,"featured_media":121049,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13840,13841,13839,7873,13842],"topic":[],"class_list":["post-121051","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-attention","tag-kv","tag-rope","tag-7873","tag-13842"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/121051.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"RoPE \u53ef\u4ee5\u4e0e Q\u3001K \u7684\u751f\u4ea7\u6216\u8bfb\u53d6\u878d\u5408&#xff0c;\u7701\u53bb\u5355\u72ec\u5f20\u91cf\u7269\u5316\u3002\u4f46\u201c\u878d\u5408\u201d\u4e0d\u5e94\u6539\u53d8\u6a21\u578b\u539f\u672c\u4f7f\u7528\u7684\u65cb\u8f6c\u5b9a\u4e49\u3002\u4e0d\u540c\u6a21\u578b\u7684\u9891\u7387\u3001\u901a\u9053\u914d\u5bf9\u3001\u4f4d\u7f6e\u504f\u79fb\u548c\u957f\u4e0a\u4e0b\u6587\u7f29\u653e\u914d\u7f6e\u53ef\u80fd\u4e0d\u540c&#xff1b;\u8fd9\u4e9b\u5185\u5bb9\u4e0d\u80fd\u4ece\u53e6\u4e00\u4e2a\u6a21\u578b\u76f4\u63a5\u642c\u8fc7\u6765\u3002 RoFormer \u8bba\u6587\u6700\u521d\u63d0\u4ea4\u4e8e 2021 \u5e74 4 \u6708&#xff0c;\u4f7f\u7528\u65cb\u8f6c\u7f16\u7801\u4f4d\u7f6e\u4fe1\u606f\u3002\u8fd9\u91cc\u5148\u9a8c\u8bc1\u4e8c\u7ef4\u65cb\u8f6c\u7684\u4e24\u4e2a\u6027\u8d28&#xff1a;\u957f\u5ea6\u4e0d\u53d8&#xff0c;\u4e24\u4e2a\u4f4d\u7f6e\u7684\u70b9\u79ef\u53ea\u4f9d\u8d56\u76f8\u5bf9\u65cb\u8f6c\u3002\u5b83\u4eec\u80fd\u5e2e\u52a9\u68c0\u67e5\u5b9e\u73b0&#xff0c;\u5374\u4e0d\u8db3\u4ee5\u8bc1\u660e\u67d0\u4e2a\u6a21\u578b\u80fd\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/121051.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-01T17:09:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261101170951-6ae7725ff16f2.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121051.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/121051.html\",\"name\":\"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-01T17:09:56+00:00\",\"dateModified\":\"2026-11-01T17:09:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/121051.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/121051.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121051.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/121051.html","og_locale":"zh_CN","og_type":"article","og_title":"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"RoPE \u53ef\u4ee5\u4e0e Q\u3001K \u7684\u751f\u4ea7\u6216\u8bfb\u53d6\u878d\u5408&#xff0c;\u7701\u53bb\u5355\u72ec\u5f20\u91cf\u7269\u5316\u3002\u4f46\u201c\u878d\u5408\u201d\u4e0d\u5e94\u6539\u53d8\u6a21\u578b\u539f\u672c\u4f7f\u7528\u7684\u65cb\u8f6c\u5b9a\u4e49\u3002\u4e0d\u540c\u6a21\u578b\u7684\u9891\u7387\u3001\u901a\u9053\u914d\u5bf9\u3001\u4f4d\u7f6e\u504f\u79fb\u548c\u957f\u4e0a\u4e0b\u6587\u7f29\u653e\u914d\u7f6e\u53ef\u80fd\u4e0d\u540c&#xff1b;\u8fd9\u4e9b\u5185\u5bb9\u4e0d\u80fd\u4ece\u53e6\u4e00\u4e2a\u6a21\u578b\u76f4\u63a5\u642c\u8fc7\u6765\u3002 RoFormer \u8bba\u6587\u6700\u521d\u63d0\u4ea4\u4e8e 2021 \u5e74 4 \u6708&#xff0c;\u4f7f\u7528\u65cb\u8f6c\u7f16\u7801\u4f4d\u7f6e\u4fe1\u606f\u3002\u8fd9\u91cc\u5148\u9a8c\u8bc1\u4e8c\u7ef4\u65cb\u8f6c\u7684\u4e24\u4e2a\u6027\u8d28&#xff1a;\u957f\u5ea6\u4e0d\u53d8&#xff0c;\u4e24\u4e2a\u4f4d\u7f6e\u7684\u70b9\u79ef\u53ea\u4f9d\u8d56\u76f8\u5bf9\u65cb\u8f6c\u3002\u5b83\u4eec\u80fd\u5e2e\u52a9\u68c0\u67e5\u5b9e\u73b0&#xff0c;\u5374\u4e0d\u8db3\u4ee5\u8bc1\u660e\u67d0\u4e2a\u6a21\u578b\u80fd","og_url":"https:\/\/www.wsisp.com\/helps\/121051.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-01T17:09:56+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261101170951-6ae7725ff16f2.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/121051.html","url":"https:\/\/www.wsisp.com\/helps\/121051.html","name":"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-01T17:09:56+00:00","dateModified":"2026-11-01T17:09:56+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/121051.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/121051.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/121051.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"RoPE \u878d\u5408\u5230 Attention \u524d\uff0c\u5148\u786e\u8ba4\u4f4d\u7f6e\u4e0e\u9891\u7387\u7684\u5408\u540c"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=121051"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121051\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/121049"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=121051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=121051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=121051"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=121051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}