{"id":5195,"date":"2024-11-27T15:26:08","date_gmt":"2024-11-27T07:26:08","guid":{"rendered":"https:\/\/nullthought.net\/?p=5195"},"modified":"2025-02-23T11:08:36","modified_gmt":"2025-02-23T03:08:36","slug":"star-attention%e7%ae%97%e6%b3%95%ef%bc%9a%e6%9c%89%e6%95%88%e6%8f%90%e5%8d%87%e5%a4%a7%e5%9e%8b%e8%af%ad%e8%a8%80%e6%a8%a1%e5%9e%8b%ef%bc%88llm%ef%bc%89%e5%9c%a8%e9%95%bf%e5%ba%8f%e5%88%97%e6%8e%a8","status":"publish","type":"post","link":"https:\/\/nullthought.net\/?p=5195","title":{"rendered":"Star Attention\u7b97\u6cd5\uff1a\u6709\u6548\u63d0\u5347\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u5728\u957f\u5e8f\u5217\u63a8\u7406\u4efb\u52a1\u4e2d\u7684\u6548\u7387"},"content":{"rendered":"\n<p>\u8bba\u6587\u300a<strong><a href=\"https:\/\/arxiv.org\/abs\/2411.17116\" target=\"_blank\" rel=\"noreferrer noopener\">Star Attention: Efficient LLM Inference over Long Sequences<\/a><\/strong>\u300b\u63d0\u51fa\u4e86\u4e00\u79cd\u540d\u4e3a\u201c\u661f\u72b6\u6ce8\u610f\u529b\uff08Star Attention\uff09\u201d\u7684\u7b97\u6cd5\uff0c\u7528\u4e8e\u63d0\u9ad8\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u5728\u957f\u5e8f\u5217\u63a8\u7406\u4efb\u52a1\u4e2d\u7684\u6548\u7387\u3002Star Attention \u63d0\u51fa\u7684\u4e24\u9636\u6bb5\u5757\u7a00\u758f\u6ce8\u610f\u529b\u673a\u5236\u4e3a\u957f\u5e8f\u5217\u63a8\u7406\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u6548\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u901a\u8fc7\u5f15\u5165\u951a\u5757\u6765\u4fdd\u6301\u6ce8\u610f\u529b\u7684\u5168\u5c40\u4e00\u81f4\u6027\uff0c\u51cf\u5c11\u4e86\u8ba1\u7b97\u548c\u5185\u5b58\u8d1f\u62c5\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u80fd\u591f\u5728\u63a8\u7406\u4efb\u52a1\u4e2d\u663e\u8457\u63d0\u5347\u6548\u7387\uff0c\u8fd8\u4e3a\u672a\u6765\u7684\u957f\u5e8f\u5217\u5efa\u6a21\u63d0\u4f9b\u4e86\u65b0\u7684\u601d\u8def\uff0c\u5373\u901a\u8fc7\u5206\u5e03\u5f0f\u7684\u65b9\u5f0f\u4fdd\u6301\u5168\u5c40\u4fe1\u606f\u7684\u4e00\u81f4\u6027\uff0c\u540c\u65f6\u5b9e\u73b0\u9ad8\u6548\u7684\u5c40\u90e8\u8ba1\u7b97\u3002<\/p>\n\n\n\n<p>\u8bba\u6587\u4f5c\u8005\u4e3aShantanu Acharya, Fei Jia, Boris Ginsburg\uff0c\u5747\u6765\u81eaNvidia\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"764\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/11\/image-28-1024x764.png\" alt=\"\" class=\"wp-image-5196\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/11\/image-28-1024x764.png 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/11\/image-28-300x224.png 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/11\/image-28-768x573.png 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/11\/image-28.png 1051w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong><a href=\"https:\/\/arxiv.org\/abs\/2411.17116\" target=\"_blank\" rel=\"noreferrer noopener\">Star Attention: Efficient LLM Inference over Long Sequences<\/a><\/strong><\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u80cc\u666f\u4e0e\u6311\u6218<\/h4>\n\n\n\n<p>\u8fd1\u5e74\u6765\uff0c\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff08LLMs\uff09\u7684\u53d1\u5c55\u6781\u5927\u5730\u63a8\u52a8\u4e86\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u7684\u8fdb\u6b65\uff0c\u7279\u522b\u662f\u5728\u957f\u5e8f\u5217\u63a8\u7406\u4efb\u52a1\u4e2d\uff08\u5982\u591a\u6587\u6863\u6458\u8981\u3001\u4ee3\u7801\u5e93\u5206\u6790\u7b49\uff09\u3002\u968f\u7740\u6a21\u578b\u4e0a\u4e0b\u6587\u957f\u5ea6\u7684\u589e\u52a0\uff0c\u4f20\u7edf\u7684 Transformer \u6a21\u578b\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u9762\u4e34\u5de8\u5927\u7684\u8ba1\u7b97\u548c\u5185\u5b58\u5f00\u9500\uff0c\u8fd9\u662f\u7531\u4e8e\u81ea\u6ce8\u610f\u529b\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\u662f\u4e8c\u6b21\u7684\uff08O(n^2)\uff09\u3002\u56e0\u6b64\uff0c\u5f53\u4e0a\u4e0b\u6587\u957f\u5ea6\u8fbe\u5230\u6570\u5341\u4e07\u751a\u81f3\u767e\u4e07\u4e2a\u6807\u8bb0\u65f6\uff0c\u6ce8\u610f\u529b\u8ba1\u7b97\u5e26\u6765\u7684\u5185\u5b58\u548c\u8ba1\u7b97\u8d1f\u62c5\u6781\u5927\u5730\u9650\u5236\u4e86\u6a21\u578b\u7684\u5e94\u7528\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u8bb8\u591a\u65b9\u6cd5\u88ab\u63d0\u51fa\u4ee5\u964d\u4f4e\u5185\u5b58\u6d88\u8017\u548c\u63d0\u5347\u63a8\u7406\u901f\u5ea6\uff0c\u4f8b\u5982 Flash Attention \u901a\u8fc7\u5728 GPU \u4e0a\u9ad8\u6548\u5b9e\u73b0\u5168\u5c40\u6ce8\u610f\u529b\u6765\u51cf\u5c11\u5185\u5b58\u5f00\u9500\u548c\u8fd0\u884c\u65f6\u95f4\uff0c\u800c Ring Attention \u901a\u8fc7\u5c06\u6ce8\u610f\u529b\u8ba1\u7b97\u5206\u5e03\u5230\u591a\u4e2a\u8bbe\u5907\u4e0a\u6765\u63d0\u9ad8\u53ef\u6269\u5c55\u6027\u3002\u5c3d\u7ba1\u8fd9\u4e9b\u65b9\u6cd5\u5728\u67d0\u4e9b\u65b9\u9762\u63d0\u9ad8\u4e86\u6548\u7387\uff0c\u4f46\u4ecd\u7136\u5b58\u5728\u901a\u4fe1\u5f00\u9500\u5927\u548c\u96be\u4ee5\u8fdb\u4e00\u6b65\u6269\u5c55\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. Star Attention \u65b9\u6cd5\u8be6\u89e3<\/h4>\n\n\n\n<p>\u8bba\u6587\u4e2d\u63d0\u51fa\u7684 Star Attention \u662f\u4e00\u79cd\u9488\u5bf9\u957f\u5e8f\u5217\u63a8\u7406\u4efb\u52a1\u8bbe\u8ba1\u7684\u9ad8\u6548\u5757\u7a00\u758f\u6ce8\u610f\u529b\u673a\u5236\uff0c\u65e8\u5728\u663e\u8457\u51cf\u5c11\u81ea\u6ce8\u610f\u529b\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u5185\u5b58\u9700\u6c42\uff0c\u540c\u65f6\u4fdd\u6301\u6a21\u578b\u7cbe\u5ea6\u3002Star Attention \u5305\u542b\u4e24\u4e2a\u9636\u6bb5\u7684\u5904\u7406\uff1a<strong>\u9636\u6bb5\u4e00\u662f\u4e0a\u4e0b\u6587\u7f16\u7801\uff0c\u9636\u6bb5\u4e8c\u662f\u67e5\u8be2\u7f16\u7801\u4e0e\u751f\u6210<\/strong>\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2.1 \u9636\u6bb5\u4e00\uff1a\u4e0a\u4e0b\u6587\u7f16\u7801\uff08Context Encoding\uff09<\/h5>\n\n\n\n<p>\u5728\u4e0a\u4e0b\u6587\u7f16\u7801\u9636\u6bb5\uff0c\u8f93\u5165\u5e8f\u5217\u88ab\u5206\u5272\u4e3a\u591a\u4e2a\u5757\uff0c\u5e76\u5206\u914d\u7ed9\u4e0d\u540c\u7684\u8ba1\u7b97\u8282\u70b9\uff0c\u6bcf\u4e2a\u8282\u70b9\u72ec\u7acb\u8ba1\u7b97\u81ea\u5df1\u7684\u5757\uff0c\u8fd9\u6837\u7684\u65b9\u5f0f\u53ef\u4ee5\u663e\u8457\u964d\u4f4e\u8ba1\u7b97\u7684\u590d\u6742\u5ea6\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0a\u4e0b\u6587\u5206\u5757\uff08Blockwise Context Encoding\uff09<\/strong>\uff1a\u8f93\u5165\u5e8f\u5217\u88ab\u5212\u5206\u4e3a\u8fde\u7eed\u7684\u591a\u4e2a\u5757\uff0c\u6bcf\u4e2a\u5757\u88ab\u5206\u914d\u5230\u4e00\u4e2a\u4e0d\u540c\u7684\u201c\u4e0a\u4e0b\u6587\u4e3b\u673a\uff08context host\uff09\u201d\u8fdb\u884c\u5904\u7406\u3002\u6bcf\u4e2a\u5757\u8fd8\u4f1a\u5305\u542b\u5e8f\u5217\u7684\u9996\u5757\uff0c\u8fd9\u4e2a\u9996\u5757\u88ab\u79f0\u4e3a\u201c\u951a\u5757\uff08Anchor Block\uff09\u201d\u3002\u951a\u5757\u7684\u4f5c\u7528\u662f\u4e3a\u6bcf\u4e2a\u5757\u63d0\u4f9b\u7edf\u4e00\u7684\u5168\u5c40\u53c2\u8003\uff0c\u786e\u4fdd\u6574\u4e2a\u6a21\u578b\u4e2d\u751f\u6210\u7684\u4e00\u81f4\u6027\u548c\u7cbe\u786e\u6027\u3002<\/li>\n\n\n\n<li><strong>\u5757\u5c40\u90e8\u6ce8\u610f\u529b\uff08Blockwise-Local Attention\uff09<\/strong>\uff1a\u6bcf\u4e2a\u4e3b\u673a\u53ea\u8ba1\u7b97\u5206\u914d\u7ed9\u5b83\u7684\u5757\u7684\u81ea\u6ce8\u610f\u529b\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u4e0e\u5176\u4ed6\u4e3b\u673a\u901a\u4fe1\u3002\u7531\u4e8e\u6bcf\u4e2a\u5757\u90fd\u6709\u951a\u5757\u4f5c\u4e3a\u53c2\u8003\uff0c\u8fd9\u6837\u7684\u5c40\u90e8\u6ce8\u610f\u529b\u673a\u5236\u53ef\u4ee5\u964d\u4f4e\u590d\u6742\u5ea6\u4e3a\u7ebf\u6027\uff0c\u540c\u65f6\u8fd8\u4fdd\u6301\u76f8\u5f53\u7684\u6ce8\u610f\u529b\u8d28\u91cf\u3002\u8fd9\u79cd\u5904\u7406\u65b9\u5f0f\u7c7b\u4f3c\u4e8e Ring Attention \u4f46\u907f\u514d\u4e86\u201c\u73af\u5f62\u201d\u901a\u4fe1\uff0c\u4ece\u800c\u51cf\u5c11\u4e86\u901a\u4fe1\u5e26\u6765\u7684\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5177\u4f53\u5730\uff0c\u951a\u5757\u7684\u5f15\u5165\u662f\u4e3a\u4e86\u6d88\u9664\u5757\u95f4\u6ce8\u610f\u529b\u8ba1\u7b97\u4e2d\u7531\u4e8e\u7f3a\u4e4f\u5168\u5c40\u4fe1\u606f\u800c\u5bfc\u81f4\u7684\u6ce8\u610f\u529b\u504f\u5dee\u95ee\u9898\u3002\u5728\u6ca1\u6709\u951a\u5757\u7684\u60c5\u51b5\u4e0b\uff0c\u6bcf\u4e2a\u5757\u53ea\u80fd\u770b\u5230\u81ea\u5df1\u7684\u5185\u5bb9\uff0c\u8fd9\u4f1a\u5bfc\u81f4\u5728\u5757\u7684\u5f00\u5934\u4ea7\u751f\u5927\u91cf\u7684\u201c\u6ce8\u610f\u529b\u6c89\uff08attention sink\uff09\u201d\uff0c\u5373\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u6bcf\u4e2a\u5757\u7684\u7b2c\u4e00\u4e2a\u6807\u8bb0\u4e0a\u3002\u901a\u8fc7\u5728\u6bcf\u4e2a\u5757\u524d\u52a0\u5165\u951a\u5757\uff0c\u6ce8\u610f\u529b\u6c89\u73b0\u8c61\u88ab\u79fb\u5230\u951a\u5757\u4e0a\uff0c\u4ece\u800c\u4f7f\u5f97\u6ce8\u610f\u529b\u6a21\u5f0f\u66f4\u63a5\u8fd1\u5168\u5c40\u6ce8\u610f\u529b\uff0c\u540c\u65f6\u4fdd\u6301\u8ba1\u7b97\u7684\u7ebf\u6027\u590d\u6742\u5ea6\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2.2 \u9636\u6bb5\u4e8c\uff1a\u67e5\u8be2\u7f16\u7801\u4e0e\u751f\u6210\uff08Query Encoding and Token Generation\uff09<\/h5>\n\n\n\n<p>\u5728\u751f\u6210\u9636\u6bb5\uff0c\u6a21\u578b\u8fdb\u5165\u7b2c\u4e8c\u9636\u6bb5\uff0c\u5373\u5bf9\u67e5\u8be2\u8fdb\u884c\u7f16\u7801\u5e76\u751f\u6210\u8f93\u51fa\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u67e5\u8be2\u4e0e\u751f\u6210<\/strong>\uff1a\u67e5\u8be2\u88ab\u5e7f\u64ad\u5230\u6240\u6709\u4e0a\u4e0b\u6587\u4e3b\u673a\uff0c\u6bcf\u4e2a\u4e3b\u673a\u8ba1\u7b97\u672c\u5730\u7684\u6ce8\u610f\u529b\u8f93\u51fa\uff0c\u7136\u540e\u5c06\u7ed3\u679c\u53d1\u9001\u5230\u201c\u67e5\u8be2\u4e3b\u673a\uff08query host\uff09\u201d\u3002\u67e5\u8be2\u4e3b\u673a\u6536\u96c6\u6240\u6709\u4e0a\u4e0b\u6587\u4e3b\u673a\u7684\u8f93\u51fa\uff0c\u901a\u8fc7\u5168\u5c40 softmax \u8ba1\u7b97\u51fa\u5168\u5c40\u6ce8\u610f\u529b\uff0c\u4ece\u800c\u751f\u6210\u65b0\u7684\u6807\u8bb0\u3002<\/li>\n\n\n\n<li><strong>\u5206\u5e03\u5f0f softmax<\/strong>\uff1aStar Attention \u4f7f\u7528\u4e86\u4e00\u79cd\u5728\u7ebf softmax \u7b97\u6cd5\u6765\u5b9e\u73b0\u5168\u5c40\u6ce8\u610f\u529b\uff0c\u8be5\u7b97\u6cd5\u53ea\u9700\u5728\u5404\u4e3b\u673a\u4e4b\u95f4\u4f20\u9012\u4e00\u4e2a\u6807\u91cf\uff08\u4ee3\u8868 softmax \u5206\u6bcd\uff09\u548c\u4e00\u4e2a\u5411\u91cf\uff08\u4ee3\u8868\u6ce8\u610f\u529b\u8f93\u51fa\uff09\uff0c\u663e\u8457\u964d\u4f4e\u4e86\u901a\u4fe1\u5f00\u9500\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u79cd\u5206\u5e03\u5f0f\u7684\u6ce8\u610f\u529b\u8ba1\u7b97\u65b9\u5f0f\u901a\u8fc7\u51cf\u5c11\u8de8\u8282\u70b9\u7684 KV\uff08\u952e\u503c\u5bf9\uff09\u4f20\u8f93\uff0c\u6781\u5927\u5730\u63d0\u5347\u4e86\u6548\u7387\uff0c\u5e76\u786e\u4fdd\u4e86\u5168\u5c40 attention \u7684\u6b63\u786e\u6027\u3002\u6b64\u5916\uff0c\u7531\u4e8e Star Attention \u662f\u57fa\u4e8e Transformer \u7684\u901a\u7528\u6ce8\u610f\u529b\u673a\u5236\uff0c\u53ef\u4ee5\u65e0\u7f1d\u96c6\u6210\u5230\u5927\u591a\u6570\u5df2\u7ecf\u901a\u8fc7\u5168\u5c40\u6ce8\u610f\u529b\u8bad\u7ec3\u7684 Transformer \u6a21\u578b\u4e2d\uff0c\u800c\u65e0\u9700\u989d\u5916\u7684\u6a21\u578b\u5fae\u8c03\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. \u5b9e\u9a8c\u4e0e\u7ed3\u679c\u5206\u6790<\/h4>\n\n\n\n<p>\u4e3a\u4e86\u9a8c\u8bc1 Star Attention \u7684\u6709\u6548\u6027\uff0c\u8bba\u6587\u5728 Llama3.1 \u7cfb\u5217\u6a21\u578b\uff08\u5305\u62ec Llama3.1-8B \u548c Llama3.1-70B\uff09\u4e0a\u8fdb\u884c\u4e86\u591a\u4e2a\u957f\u5e8f\u5217\u63a8\u7406\u5b9e\u9a8c\uff0c\u6db5\u76d6\u4e86\u4ece 16K \u5230 1M \u6807\u8bb0\u957f\u5ea6\u7684\u63a8\u7406\u4efb\u52a1\u3002\u4e3b\u8981\u8bc4\u4f30\u6307\u6807\u4e3a\u63a8\u7406\u901f\u5ea6\u548c\u63a8\u7406\u7cbe\u5ea6\u7684\u6743\u8861\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">3.1 \u5b9e\u9a8c\u8bbe\u7f6e<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6a21\u578b\u4e0e\u57fa\u7ebf<\/strong>\uff1a\u5b9e\u9a8c\u5728\u591a\u4e2a\u7248\u672c\u7684 Llama \u6a21\u578b\u4e0a\u8fdb\u884c\uff0c\u5305\u62ec\u652f\u6301\u957f\u4e0a\u4e0b\u6587\u957f\u5ea6\u7684 Llama-3.1-8B \u548c Llama-3.1-70B\u3002\u5728\u57fa\u51c6\u5bf9\u6bd4\u4e2d\uff0cStar Attention \u4e0e Ring Attention \u4f5c\u4e3a\u5bf9\u6bd4\u5bf9\u8c61\uff0c\u540e\u8005\u901a\u8fc7\u73af\u5f62\u901a\u4fe1\u6765\u5b9e\u73b0\u5168\u5c40\u5757\u6ce8\u610f\u529b\u3002<\/li>\n\n\n\n<li><strong>\u8bc4\u4f30\u57fa\u51c6<\/strong>\uff1a\u4f7f\u7528\u4e86 RULER \u548c BABILong \u57fa\u51c6\u6765\u8bc4\u4f30\u6a21\u578b\u7684\u6027\u80fd\u3002RULER \u57fa\u51c6\u5305\u62ec 13 \u4e2a\u4efb\u52a1\uff0c\u6db5\u76d6\u4e86\u4ece\u7b80\u5355\u67e5\u8be2\u5230\u591a\u8df3\u63a8\u7406\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\u7684\u4efb\u52a1\uff1b\u800c BABILong \u57fa\u51c6\u5219\u6d4b\u8bd5\u4e86\u5728\u8d85\u957f\u4e0a\u4e0b\u6587\u4e0b\u5bf9\u590d\u6742\u5173\u7cfb\u7684\u63a8\u7406\u80fd\u529b\u3002<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">3.2 \u7ed3\u679c\u5206\u6790<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u901f\u5ea6\u4e0e\u7cbe\u5ea6\u7684\u6743\u8861<\/strong>\uff1aStar Attention \u5728\u63a8\u7406\u901f\u5ea6\u4e0a\u76f8\u6bd4 Ring Attention \u63d0\u9ad8\u4e86\u6700\u591a 11 \u500d\uff0c\u5e76\u4e14\u4fdd\u6301\u4e86 95%-100% \u7684\u7cbe\u5ea6\u3002\u5c24\u5176\u662f\u5728\u957f\u5e8f\u5217\uff08\u5982 128K \u6807\u8bb0\u53ca\u4ee5\u4e0a\uff09\u4e0a\uff0cStar Attention \u7684\u4f18\u52bf\u66f4\u52a0\u660e\u663e\u3002\u6a21\u578b\u5728\u957f\u5e8f\u5217\u4efb\u52a1\u4e2d\u7684\u8868\u73b0\u8868\u660e\uff0c\u901a\u8fc7\u4f7f\u7528\u9002\u5f53\u5927\u5c0f\u7684\u951a\u5757\u548c\u4e0a\u4e0b\u6587\u5206\u5757\uff0c\u53ef\u4ee5\u5728\u901f\u5ea6\u548c\u7cbe\u5ea6\u4e4b\u95f4\u627e\u5230\u826f\u597d\u7684\u5e73\u8861\u70b9\u3002<\/li>\n\n\n\n<li><strong>\u4efb\u52a1\u7c7b\u522b\u5206\u6790<\/strong>\uff1a\u5728 RULER \u57fa\u51c6\u4e2d\uff0c\u4e0d\u540c\u4efb\u52a1\u5bf9\u6a21\u578b\u7684\u8981\u6c42\u6709\u6240\u4e0d\u540c\u3002Star Attention \u5728\u7b80\u5355\u7684\u5355\u70b9\u67e5\u8be2\uff08Single-NIAH\uff09\u548c\u805a\u5408\u4efb\u52a1\u4e2d\u8868\u73b0\u4e0e\u5168\u5c40\u6ce8\u610f\u529b\u51e0\u4e4e\u4e00\u81f4\uff0c\u800c\u5728\u9700\u8981\u8de8\u8d8a\u591a\u4e2a\u5757\u7684\u4fe1\u606f\u4f20\u9012\u7684\u591a\u8df3\u63a8\u7406\u4efb\u52a1\u4e2d\uff08Multi-Hop Tracing\uff09\uff0c\u7531\u4e8e\u5757\u95f4\u7f3a\u4e4f\u901a\u4fe1\uff0c\u7cbe\u5ea6\u6709\u4e00\u5b9a\u7684\u4e0b\u964d\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. \u6d88\u878d\u5b9e\u9a8c\uff1a\u951a\u5757\u7684\u4f5c\u7528\u4e0e\u5f71\u54cd<\/h4>\n\n\n\n<p>\u4e3a\u66f4\u597d\u5730\u7406\u89e3\u951a\u5757\u7684\u4f5c\u7528\uff0c\u8bba\u6587\u8fdb\u884c\u4e86\u591a\u9879\u6d88\u878d\u5b9e\u9a8c\u6765\u5206\u6790\u951a\u5757\u7684\u5185\u5bb9\u548c\u4f4d\u7f6e\u5bf9\u6a21\u578b\u6027\u80fd\u7684\u5f71\u54cd\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">4.1 \u951a\u5757\u7684\u4f4d\u7f6e\u4e0e\u5185\u5bb9<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f4d\u7f6e\u53d8\u5316<\/strong>\uff1a\u5b9e\u9a8c\u53d1\u73b0\uff0c\u951a\u5757\u7684\u4f4d\u7f6e\uff08\u5373\u951a\u5757\u7684\u4f4d\u7f6e ID \u662f\u5426\u53d8\u5316\uff09\u5bf9\u6a21\u578b\u7684\u5f71\u54cd\u8f83\u5c0f\uff0c\u65e0\u8bba\u951a\u5757\u7684\u4f4d\u7f6e ID \u662f\u968f\u673a\u751f\u6210\uff0c\u8fd8\u662f\u4e0e\u4e0a\u4e0b\u6587\u5757\u4fdd\u6301\u4e00\u81f4\uff0c\u6a21\u578b\u7684\u7cbe\u5ea6\u53d8\u5316\u4e0d\u5927\u3002<\/li>\n\n\n\n<li><strong>\u5185\u5bb9\u53d8\u5316<\/strong>\uff1a\u951a\u5757\u7684\u5185\u5bb9\u5bf9\u6a21\u578b\u7684\u5f71\u54cd\u975e\u5e38\u663e\u8457\u3002\u5b9e\u9a8c\u6d4b\u8bd5\u4e86\u951a\u5757\u5185\u5bb9\u7684\u591a\u79cd\u914d\u7f6e\uff0c\u5305\u62ec\u4f7f\u7528\u5355\u4e00\u91cd\u590d\u6807\u8bb0\u3001\u968f\u673a\u6807\u8bb0\u3001\u6253\u4e71\u7684\u9996\u5757\u5185\u5bb9\u7b49\uff0c\u7ed3\u679c\u8868\u660e\uff0c\u53ea\u6709\u4fdd\u7559\u539f\u59cb\u7684\u9996\u5757\u5185\u5bb9\u624d\u80fd\u4f7f\u6a21\u578b\u4fdd\u6301\u6700\u4f73\u7684\u6027\u80fd\u3002\u8fd9\u610f\u5473\u7740\u951a\u5757\u5728\u4e0a\u4e0b\u6587\u5757\u4e2d\u5145\u5f53\u4e86\u5168\u5c40\u4fe1\u606f\u7684\u89d2\u8272\uff0c\u5176\u5185\u5bb9\u5bf9\u4e8e\u4fdd\u6301\u6ce8\u610f\u529b\u6a21\u5f0f\u7684\u4e00\u81f4\u6027\u81f3\u5173\u91cd\u8981\u3002<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">4.2 \u951a\u5757\u7684\u5927\u5c0f<\/h5>\n\n\n\n<p>\u5b9e\u9a8c\u8fd8\u5206\u6790\u4e86\u951a\u5757\u5927\u5c0f\u5bf9\u6a21\u578b\u6027\u80fd\u7684\u5f71\u54cd\uff0c\u7ed3\u679c\u8868\u660e\uff0c\u968f\u7740\u951a\u5757\u5927\u5c0f\u7684\u589e\u52a0\uff0c\u6a21\u578b\u7684\u7cbe\u5ea6\u663e\u8457\u63d0\u9ad8\u3002\u7279\u522b\u662f\u5728\u5e8f\u5217\u957f\u5ea6\u4e3a 128K \u7684\u5b9e\u9a8c\u4e2d\uff0c\u5f53\u951a\u5757\u5927\u5c0f\u4e0e\u4e0a\u4e0b\u6587\u5757\u5927\u5c0f\u4e00\u81f4\u65f6\uff0c\u6a21\u578b\u7684\u7cbe\u5ea6\u6700\u9ad8\u3002\u8fd9\u8868\u660e\u951a\u5757\u7684\u4f5c\u7528\u4e0d\u4ec5\u4ec5\u662f\u51cf\u5c11\u6ce8\u610f\u529b\u6c89\u73b0\u8c61\uff0c\u5b83\u8fd8\u53ef\u80fd\u627f\u62c5\u4e86\u5176\u4ed6\u7ef4\u6301\u6a21\u578b\u6027\u80fd\u7684\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5. \u7ed3\u8bba\u4e0e\u672a\u6765\u5de5\u4f5c<\/h4>\n\n\n\n<p>Star Attention \u901a\u8fc7\u7ed3\u5408\u5757\u5f0f\u5c40\u90e8\u6ce8\u610f\u529b\u548c\u5168\u5c40\u6ce8\u610f\u529b\u7684\u673a\u5236\uff0c\u663e\u8457\u63d0\u5347\u4e86\u957f\u5e8f\u5217\u63a8\u7406\u7684\u6548\u7387\uff0c\u5728\u5927\u5e45\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u5185\u5b58\u9700\u6c42\u7684\u540c\u65f6\uff0c\u4fdd\u6301\u4e86\u8f83\u9ad8\u7684\u7cbe\u5ea6\u3002\u8be5\u65b9\u6cd5\u65e0\u9700\u5bf9\u5df2\u6709\u7684 Transformer \u6a21\u578b\u8fdb\u884c\u5fae\u8c03\uff0c\u53ef\u4ee5\u76f4\u63a5\u96c6\u6210\u5230\u5927\u591a\u6570\u57fa\u4e8e\u5168\u5c40\u6ce8\u610f\u529b\u7684 LLM \u4e2d\u3002<\/p>\n\n\n\n<p>\u5c3d\u7ba1\u53d6\u5f97\u4e86\u663e\u8457\u8fdb\u5c55\uff0c\u8bba\u6587\u4e5f\u6307\u51fa\u4e86\u4e00\u4e9b\u672a\u6765\u9700\u8981\u89e3\u51b3\u7684\u95ee\u9898\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u951a\u5757\u673a\u5236\u7684\u8fdb\u4e00\u6b65\u4f18\u5316<\/strong>\uff1a\u5982\u4f55\u9009\u62e9\u6700\u4f18\u7684\u951a\u5757\u5927\u5c0f\u548c\u5185\u5bb9\u4ee5\u5728\u590d\u6742\u4efb\u52a1\u4e2d\u8fdb\u4e00\u6b65\u63d0\u5347\u6a21\u578b\u7684\u6027\u80fd\u3002<\/li>\n\n\n\n<li><strong>\u5757\u95f4\u901a\u4fe1\u7684\u6539\u8fdb<\/strong>\uff1a\u5f53\u524d Star Attention \u7684\u5c40\u90e8\u5757\u5904\u7406\u867d\u7136\u63d0\u9ad8\u4e86\u6548\u7387\uff0c\u4f46\u5728\u591a\u8df3\u63a8\u7406\u7b49\u9700\u8981\u5757\u95f4\u901a\u4fe1\u7684\u4efb\u52a1\u4e2d\u8868\u73b0\u4e0d\u5982\u5168\u5c40\u6ce8\u610f\u529b\u3002\u672a\u6765\u53ef\u80fd\u9700\u8981\u63a2\u7d22\u5982\u4f55\u5728\u4fdd\u8bc1\u6548\u7387\u7684\u524d\u63d0\u4e0b\u5f15\u5165\u6709\u9650\u7684\u5757\u95f4\u901a\u4fe1\uff0c\u4ee5\u6539\u5584\u6a21\u578b\u5728\u590d\u6742\u4efb\u52a1\u4e2d\u7684\u8868\u73b0\u3002<\/li>\n\n\n\n<li><strong>\u66f4\u590d\u6742\u7684\u957f\u5e8f\u5217\u4efb\u52a1<\/strong>\uff1a\u672a\u6765\u7684\u5de5\u4f5c\u5c06\u5173\u6ce8\u5982\u4f55\u6539\u8fdb\u951a\u5757\u673a\u5236\uff0c\u4f7f\u5f97 Star Attention \u5728\u66f4\u52a0\u590d\u6742\u7684\u957f\u5e8f\u5217\u63a8\u7406\u4efb\u52a1\u4e2d\u8868\u73b0\u66f4\u52a0\u7a33\u5065\uff0c\u7279\u522b\u662f\u5728\u591a\u8df3\u63a8\u7406\u548c\u9700\u8981\u8de8\u8d8a\u4e0a\u4e0b\u6587\u7684\u5927\u8303\u56f4\u805a\u5408\u4efb\u52a1\u4e2d\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Star Attention on GitHub: <a href=\"https:\/\/github.com\/NVIDIA\/Star-Attention\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/NVIDIA\/Star-Attention<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bba\u6587\u300aStar Attention: Efficient LLM Inference over Long Se [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[39,84,95,86],"class_list":["post-5195","post","type-post","status-publish","format-standard","hentry","category-tech","tag-ai","tag-nvidia","tag-transformer","tag-llm"],"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"NullThought","author_link":"https:\/\/nullthought.net\/?author=1"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/nullthought.net\/?cat=8\" rel=\"category\">Tech<\/a>","rttpg_excerpt":"\u8bba\u6587\u300aStar Attention: Efficient LLM Inference over Long Se&hellip;","_links":{"self":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/5195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5195"}],"version-history":[{"count":2,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/5195\/revisions"}],"predecessor-version":[{"id":5198,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/5195\/revisions\/5198"}],"wp:attachment":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}