{"id":1036,"date":"2026-02-06T22:17:13","date_gmt":"2026-02-06T14:17:13","guid":{"rendered":"https:\/\/www.ndnlab.com\/?p=1036"},"modified":"2026-02-06T22:17:14","modified_gmt":"2026-02-06T14:17:14","slug":"attention-is-all-you-need","status":"publish","type":"post","link":"https:\/\/www.ndnlab.com\/?p=1036","title":{"rendered":"Attention Is All You Need"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.ndnlab.com\/?cat=1\">\u6df1\u5ea6\u5b66\u4e60<\/a><\/p>\n\n\n\n<p><strong>\u4f1a\u8bae<\/strong>\uff1aNeurIPS 2017\uff08\u7b2c31\u5c4a\u795e\u7ecf\u4fe1\u606f\u5904\u7406\u7cfb\u7edf\u5927\u4f1a\uff09<\/p>\n\n\n\n<p>Ashish Vaswani\u2217, Noam Shazeer\u2217, Niki Parmar\u2217, Jakob Uszkoreit\u2217, Llion Jones\u2217, Aidan N. Gomez\u2217\u2020, \u0141ukasz Kaiser\u2217, Illia Polosukhin\u2217 Google Brain \/ Google Research \/ University of Toronto arXiv:1706.03762v7 [cs.CL] 2 Aug 2023<\/p>\n\n\n\n<p>\u8fd9\u7bc7\u8bba\u6587\u63d0\u51fa\u4e86<strong>Transformer<\/strong>\u2014\u2014\u4e00\u79cd\u5b8c\u5168\u57fa\u4e8e\u6ce8\u610f\u529b\u673a\u5236\u7684\u5168\u65b0\u5e8f\u5217\u8f6c\u6362\u6a21\u578b\u67b6\u6784\uff0c\u5f7b\u5e95\u6452\u5f03\u4e86\u5faa\u73af\u548c\u5377\u79ef\u7ed3\u6784\u3002Transformer \u51ed\u501f\u5176\u9ad8\u5ea6\u5e76\u884c\u5316\u7684\u8bbe\u8ba1\u548c\u5353\u8d8a\u7684\u6027\u80fd\uff0c\u4e0d\u4ec5\u5728\u673a\u5668\u7ffb\u8bd1\u4efb\u52a1\u4e0a\u5237\u65b0\u4e86\u5f53\u65f6\u7684\u6700\u4f18\u8bb0\u5f55\uff0c\u66f4\u6df1\u8fdc\u5730\u91cd\u5851\u4e86\u6574\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4e43\u81f3\u4eba\u5de5\u667a\u80fd\u9886\u57df\u7684\u6280\u672f\u8303\u5f0f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u7814\u7a76\u52a8\u673a\u4e0e\u80cc\u666f<\/h1>\n\n\n\n<p>\u5728 Transformer \u51fa\u73b0\u4e4b\u524d\uff0c\u5e8f\u5217\u5efa\u6a21\u548c\u8f6c\u6362\u4efb\u52a1\uff08\u5982\u8bed\u8a00\u5efa\u6a21\u3001\u673a\u5668\u7ffb\u8bd1\uff09\u7684\u4e3b\u6d41\u65b9\u6cd5\u662f<strong>\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08RNN\uff09<\/strong>\uff0c\u7279\u522b\u662f LSTM \u548c GRU\u3002\u8fd9\u4e9b\u6a21\u578b\u867d\u7136\u6709\u6548\uff0c\u4f46\u5b58\u5728\u4e00\u4e2a\u6839\u672c\u6027\u74f6\u9888\uff1a<strong>\u8ba1\u7b97\u7684\u987a\u5e8f\u4f9d\u8d56\u6027<\/strong>\u3002RNN \u5fc5\u987b\u6cbf\u7740\u5e8f\u5217\u7684\u65f6\u95f4\u6b65\u9010\u6b65\u5904\u7406\uff0c\u524d\u4e00\u6b65\u7684\u9690\u85cf\u72b6\u6001 <math><semantics><mrow><msub><mi>h<\/mi><mrow><mi>t<\/mi><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">h_{t-1}<\/annotation><\/semantics><\/math>\u662f\u540e\u4e00\u6b65 <math><semantics><mrow><msub><mi>h<\/mi><mi>t<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">h_t<\/annotation><\/semantics><\/math>\u7684\u8f93\u5165\uff0c\u8fd9\u79cd\u56fa\u6709\u7684\u4e32\u884c\u7279\u6027\u4e25\u91cd\u963b\u788d\u4e86\u8bad\u7ec3\u7684\u5e76\u884c\u5316\uff0c\u5728\u5904\u7406\u957f\u5e8f\u5217\u65f6\u5c24\u4e3a\u7a81\u51fa\u3002<\/p>\n\n\n\n<p>\u4e0e\u6b64\u540c\u65f6\uff0c<strong>\u6ce8\u610f\u529b\u673a\u5236<\/strong>\u5df2\u5728\u591a\u79cd\u4efb\u52a1\u4e2d\u5c55\u793a\u51fa\u5f3a\u5927\u7684\u80fd\u529b\uff0c\u5b83\u80fd\u591f\u5728\u4e0d\u8003\u8651\u5e8f\u5217\u8ddd\u79bb\u7684\u60c5\u51b5\u4e0b\u5efa\u6a21\u4f9d\u8d56\u5173\u7cfb\u3002\u7136\u800c\uff0c\u5728\u51e0\u4e4e\u6240\u6709\u5148\u524d\u5de5\u4f5c\u4e2d\uff0c\u6ce8\u610f\u529b\u673a\u5236\u90fd\u662f\u4f5c\u4e3a RNN \u7684\u9644\u5c5e\u7ec4\u4ef6\u5b58\u5728\u7684\u3002<\/p>\n\n\n\n<p>\u672c\u8bba\u6587\u7684\u6838\u5fc3\u95ee\u9898\u662f\uff1a<strong>\u80fd\u5426\u5b8c\u5168\u629b\u5f03\u5faa\u73af\u7ed3\u6784\uff0c\u4ec5\u51ed\u6ce8\u610f\u529b\u673a\u5236\u5c31\u6784\u5efa\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\u5e8f\u5217\u8f6c\u6362\u6a21\u578b\uff1f<\/strong> Transformer \u7ed9\u51fa\u4e86\u80af\u5b9a\u7684\u7b54\u6848\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u3001\u6838\u5fc3\u67b6\u6784\uff1aTransformer \u6a21\u578b<\/h1>\n\n\n\n<p>Transformer \u9075\u5faa\u7ecf\u5178\u7684\u7f16\u7801\u5668-\u89e3\u7801\u5668\uff08Encoder-Decoder\uff09<strong>\u5b8f\u89c2\u7ed3\u6784\uff0c\u4f46\u5176\u5185\u90e8\u5b8c\u5168\u7531<\/strong>\u81ea\u6ce8\u610f\u529b\uff08Self-Attention\uff09<strong>\u548c<\/strong>\u9010\u4f4d\u7f6e\u7684\u524d\u9988\u7f51\u7edc\uff08Position-wise Feed-Forward Networks\uff09\u5806\u53e0\u800c\u6210\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"483\" height=\"595\" src=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-4.png\"  class=\"wp-image-1037\" srcset=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-4.png 483w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-4-244x300.png 244w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" title=\"Attention Is All You Need\u63d2\u56fe\" alt=\"Attention Is All You Need\u63d2\u56fe\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u7f16\u7801\u5668\uff08Encoder\uff09<\/h3>\n\n\n\n<p>\u7f16\u7801\u5668\u7531 <math><semantics><mrow><mi>N<\/mi><mo>=<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">N=6<\/annotation><\/semantics><\/math>\u4e2a\u76f8\u540c\u7684\u5c42\u5806\u53e0\u800c\u6210\u3002\u6bcf\u4e00\u5c42\u5305\u542b\u4e24\u4e2a\u5b50\u5c42\uff1a\u4e00\u4e2a <strong>\u591a\u5934\u81ea\u6ce8\u610f\u529b\u673a\u5236<\/strong>\u548c\u4e00\u4e2a<strong>\u9010\u4f4d\u7f6e\u5168\u8fde\u63a5\u524d\u9988\u7f51\u7edc<\/strong>\u3002\u6bcf\u4e2a\u5b50\u5c42\u5468\u56f4\u90fd\u4f7f\u7528\u4e86<strong>\u6b8b\u5dee\u8fde\u63a5\uff08Residual Connection\uff09\u548c\u5c42\u5f52\u4e00\u5316\uff08Layer Normalization\uff09<\/strong>\uff0c\u5373\u5b50\u5c42\u8f93\u51fa\u4e3a <math><semantics><mrow><mtext>LayerNorm<\/mtext><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo>+<\/mo><mtext>Sublayer<\/mtext><mo stretchy=\"false\">(<\/mo><mi>x<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\text{LayerNorm}(x + \\text{Sublayer}(x))<\/annotation><\/semantics><\/math>\u3002\u6a21\u578b\u6240\u6709\u5b50\u5c42\u548c\u5d4c\u5165\u5c42\u7684\u8f93\u51fa\u7ef4\u5ea6\u7edf\u4e00\u4e3a <math><semantics><mrow><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><mo>=<\/mo><mn>512<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">d_{\\text{model}} = 512<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u7801\u5668\uff08Decoder\uff09<\/h3>\n\n\n\n<p>\u89e3\u7801\u5668\u540c\u6837\u7531 <math><semantics><mrow><mi>N<\/mi><mo>=<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">N=6<\/annotation><\/semantics><\/math>N=6 \u4e2a\u76f8\u540c\u7684\u5c42\u5806\u53e0\u800c\u6210\u3002\u9664\u4e86\u7f16\u7801\u5668\u4e2d\u7684\u4e24\u4e2a\u5b50\u5c42\u5916\uff0c\u89e3\u7801\u5668\u989d\u5916\u63d2\u5165\u4e86\u7b2c\u4e09\u4e2a\u5b50\u5c42\uff0c\u7528\u4e8e\u5bf9\u7f16\u7801\u5668\u7684\u8f93\u51fa\u6267\u884c <strong>\u591a\u5934\u6ce8\u610f\u529b<\/strong>\uff08\u5373\u7f16\u7801\u5668-\u89e3\u7801\u5668\u6ce8\u610f\u529b\uff09\u3002\u6b64\u5916\uff0c\u89e3\u7801\u5668\u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u5b50\u5c42\u901a\u8fc7\u63a9\u7801\uff08Masking\uff09\u673a\u5236\u963b\u6b62\u5f53\u524d\u4f4d\u7f6e\u5173\u6ce8\u5176\u540e\u7eed\u4f4d\u7f6e\uff0c\u4ee5\u4fdd\u8bc1\u81ea\u56de\u5f52\u7279\u6027\u2014\u2014\u5373\u4f4d\u7f6e <math><semantics><mrow><mi>i<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">i<\/annotation><\/semantics><\/math>i \u7684\u9884\u6d4b\u53ea\u80fd\u4f9d\u8d56\u4e8e\u4f4d\u7f6e\u5c0f\u4e8e <math><semantics><mrow><mi>i<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">i<\/annotation><\/semantics><\/math>i \u7684\u5df2\u77e5\u8f93\u51fa\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u3001\u5173\u952e\u521b\u65b0\u70b9<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1) \u7f29\u653e\u70b9\u79ef\u6ce8\u610f\u529b\uff08Scaled Dot-Product Attention\uff09<\/h2>\n\n\n\n<p>Transformer \u7684\u6838\u5fc3\u8ba1\u7b97\u5355\u5143\u662f<strong>\u7f29\u653e\u70b9\u79ef\u6ce8\u610f\u529b<\/strong>\u3002\u7ed9\u5b9a\u67e5\u8be2\uff08Query\uff09\u3001\u952e\uff08Key\uff09\u548c\u503c\uff08Value\uff09\u77e9\u9635\uff0c\u6ce8\u610f\u529b\u8f93\u51fa\u7684\u8ba1\u7b97\u516c\u5f0f\u4e3a\uff1a<math display=\"block\"><semantics><mrow><mtext>Attention<\/mtext><mo stretchy=\"false\">(<\/mo><mi>Q<\/mi><mo separator=\"true\">,<\/mo><mi>K<\/mi><mo separator=\"true\">,<\/mo><mi>V<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mtext>softmax<\/mtext><mrow><mo fence=\"true\">(<\/mo><mfrac><mrow><mi>Q<\/mi><msup><mi>K<\/mi><mi>T<\/mi><\/msup><\/mrow><msqrt><msub><mi>d<\/mi><mi>k<\/mi><\/msub><\/msqrt><\/mfrac><mo fence=\"true\">)<\/mo><\/mrow><mi>V<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\text{Attention}(Q, K, V) = \\text{softmax}\\left(\\frac{QK^T}{\\sqrt{d_k}}\\right)V<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p>\u5176\u4e2d <math><semantics><mrow><msqrt><msub><mi>d<\/mi><mi>k<\/mi><\/msub><\/msqrt><\/mrow><annotation encoding=\"application\/x-tex\">\\sqrt{d_k}<\/annotation><\/semantics><\/math>\u7684\u7f29\u653e\u56e0\u5b50\u81f3\u5173\u91cd\u8981\u2014\u2014\u5f53 <math><semantics><mrow><msub><mi>d<\/mi><mi>k<\/mi><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">d_k<\/annotation><\/semantics><\/math>\u8f83\u5927\u65f6\uff0c\u70b9\u79ef\u7684\u6570\u503c\u4f1a\u589e\u5927\uff0c\u5c06 softmax \u51fd\u6570\u63a8\u5165\u68af\u5ea6\u6781\u5c0f\u7684\u533a\u57df\uff0c\u7f29\u653e\u64cd\u4f5c\u6709\u6548\u7f13\u89e3\u4e86\u8fd9\u4e00\u95ee\u9898\u3002\u76f8\u6bd4\u52a0\u6027\u6ce8\u610f\u529b\uff0c\u70b9\u79ef\u6ce8\u610f\u529b\u5728\u5b9e\u8df5\u4e2d\u66f4\u5feb\u4e14\u66f4\u8282\u7701\u7a7a\u95f4\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u76f4\u63a5\u5229\u7528\u9ad8\u5ea6\u4f18\u5316\u7684\u77e9\u9635\u4e58\u6cd5\u5b9e\u73b0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"425\" src=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-5.png\"  class=\"wp-image-1038\" srcset=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-5.png 755w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-5-300x169.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" title=\"Attention Is All You Need\u63d2\u56fe1\" alt=\"Attention Is All You Need\u63d2\u56fe1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2) \u591a\u5934\u6ce8\u610f\u529b\uff08Multi-Head Attention\uff09<\/h2>\n\n\n\n<p>\u8bba\u6587\u53d1\u73b0\uff0c\u4e0e\u5176\u4f7f\u7528\u5355\u4e00\u7684 <math><semantics><mrow><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">d_{\\text{model}}<\/annotation><\/semantics><\/math>dmodel\u200b \u7ef4\u5ea6\u6ce8\u610f\u529b\u51fd\u6570\uff0c\u4e0d\u5982\u5c06\u67e5\u8be2\u3001\u952e\u548c\u503c\u901a\u8fc7\u4e0d\u540c\u7684\u7ebf\u6027\u6295\u5f71\u6620\u5c04 <math><semantics><mrow><mi>h<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">h<\/annotation><\/semantics><\/math>h \u6b21\u5230\u4f4e\u7ef4\u7a7a\u95f4\uff0c\u5206\u522b\u6267\u884c\u6ce8\u610f\u529b\u8ba1\u7b97\uff0c\u518d\u5c06\u7ed3\u679c\u62fc\u63a5\u5e76\u6295\u5f71\u56de\u539f\u59cb\u7ef4\u5ea6\uff1a <math display=\"block\"><semantics><mrow><mtext>MultiHead<\/mtext><mo stretchy=\"false\">(<\/mo><mi>Q<\/mi><mo separator=\"true\">,<\/mo><mi>K<\/mi><mo separator=\"true\">,<\/mo><mi>V<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mtext>Concat<\/mtext><mo stretchy=\"false\">(<\/mo><msub><mtext>head<\/mtext><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u2026<\/mo><mo separator=\"true\">,<\/mo><msub><mtext>head<\/mtext><mi>h<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><msup><mi>W<\/mi><mi>O<\/mi><\/msup><\/mrow><annotation encoding=\"application\/x-tex\">\\text{MultiHead}(Q,K,V) = \\text{Concat}(\\text{head}_1, \\dots, \\text{head}_h)W^O<\/annotation><\/semantics><\/math>MultiHead(Q,K,V)=Concat(head1\u200b,\u2026,headh\u200b)WO<\/p>\n\n\n\n<p>\u5176\u4e2d <math><semantics><mrow><msub><mtext>head<\/mtext><mi>i<\/mi><\/msub><mo>=<\/mo><mtext>Attention<\/mtext><mo stretchy=\"false\">(<\/mo><mi>Q<\/mi><msubsup><mi>W<\/mi><mi>i<\/mi><mi>Q<\/mi><\/msubsup><mo separator=\"true\">,<\/mo><mi>K<\/mi><msubsup><mi>W<\/mi><mi>i<\/mi><mi>K<\/mi><\/msubsup><mo separator=\"true\">,<\/mo><mi>V<\/mi><msubsup><mi>W<\/mi><mi>i<\/mi><mi>V<\/mi><\/msubsup><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\text{head}_i = \\text{Attention}(QW_i^Q, KW_i^K, VW_i^V)<\/annotation><\/semantics><\/math>\u3002<\/p>\n\n\n\n<p>\u8bba\u6587\u4f7f\u7528 <math><semantics><mrow><mi>h<\/mi><mo>=<\/mo><mn>8<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">h=8<\/annotation><\/semantics><\/math>h=8 \u4e2a\u6ce8\u610f\u529b\u5934\uff0c\u6bcf\u4e2a\u5934\u7684\u7ef4\u5ea6\u4e3a <math><semantics><mrow><msub><mi>d<\/mi><mi>k<\/mi><\/msub><mo>=<\/mo><msub><mi>d<\/mi><mi>v<\/mi><\/msub><mo>=<\/mo><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><mi mathvariant=\"normal\">\/<\/mi><mi>h<\/mi><mo>=<\/mo><mn>64<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">d_k = d_v = d_{\\text{model}}\/h = 64<\/annotation><\/semantics><\/math>\u3002\u591a\u5934\u673a\u5236\u5141\u8bb8\u6a21\u578b\u540c\u65f6\u5173\u6ce8\u4e0d\u540c\u8868\u793a\u5b50\u7a7a\u95f4\u4e2d\u4e0d\u540c\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u8fd9\u662f\u5355\u5934\u6ce8\u610f\u529b\u56e0&#8221;\u5e73\u5747\u5316&#8221;\u6548\u5e94\u800c\u65e0\u6cd5\u505a\u5230\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3) \u4f4d\u7f6e\u7f16\u7801\uff08Positional Encoding\uff09<\/h2>\n\n\n\n<p>\u7531\u4e8e Transformer \u5b8c\u5168\u6ca1\u6709\u5faa\u73af\u548c\u5377\u79ef\u7ed3\u6784\uff0c\u6a21\u578b\u672c\u8eab\u65e0\u6cd5\u611f\u77e5\u5e8f\u5217\u4e2d\u7684\u4f4d\u7f6e\u987a\u5e8f\u3002\u4e3a\u6b64\uff0c\u8bba\u6587\u5728\u8f93\u5165\u5d4c\u5165\u4e2d\u52a0\u5165\u4e86<strong>\u6b63\u5f26\/\u4f59\u5f26\u4f4d\u7f6e\u7f16\u7801<\/strong>\uff1a<math display=\"block\"><semantics><mrow><mi>P<\/mi><msub><mi>E<\/mi><mrow><mo stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><mo separator=\"true\">,<\/mo><mn>2<\/mn><mi>i<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/msub><mo>=<\/mo><mi>sin<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><mi mathvariant=\"normal\">\/<\/mi><msup><mn>10000<\/mn><mrow><mn>2<\/mn><mi>i<\/mi><mi mathvariant=\"normal\">\/<\/mi><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><\/mrow><\/msup><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">PE_{(pos, 2i)} = \\sin(pos \/ 10000^{2i\/d_{\\text{model}}})<\/annotation><\/semantics><\/math><math display=\"block\"><semantics><mrow><mi>P<\/mi><msub><mi>E<\/mi><mrow><mo stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><mo separator=\"true\">,<\/mo><mn>2<\/mn><mi>i<\/mi><mo>+<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><\/msub><mo>=<\/mo><mi>cos<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><mi mathvariant=\"normal\">\/<\/mi><msup><mn>10000<\/mn><mrow><mn>2<\/mn><mi>i<\/mi><mi mathvariant=\"normal\">\/<\/mi><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><\/mrow><\/msup><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">PE_{(pos, 2i+1)} = \\cos(pos \/ 10000^{2i\/d_{\\text{model}}})<\/annotation><\/semantics><\/math><\/p>\n\n\n\n<p>\u9009\u62e9\u8fd9\u79cd\u51fd\u6570\u7684\u539f\u56e0\u662f\uff0c\u5bf9\u4e8e\u4efb\u610f\u56fa\u5b9a\u504f\u79fb <math><semantics><mrow><mi>k<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">k<\/annotation><\/semantics><\/math>k\uff0c<math><semantics><mrow><mi>P<\/mi><msub><mi>E<\/mi><mrow><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><mo>+<\/mo><mi>k<\/mi><\/mrow><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">PE_{pos+k}<\/annotation><\/semantics><\/math>PEpos+k\u200b \u53ef\u4ee5\u8868\u793a\u4e3a <math><semantics><mrow><mi>P<\/mi><msub><mi>E<\/mi><mrow><mi>p<\/mi><mi>o<\/mi><mi>s<\/mi><\/mrow><\/msub><\/mrow><annotation encoding=\"application\/x-tex\">PE_{pos}<\/annotation><\/semantics><\/math>PEpos\u200b \u7684\u7ebf\u6027\u51fd\u6570\uff0c\u4ece\u800c\u4f7f\u6a21\u578b\u80fd\u591f\u8f7b\u677e\u5b66\u4e60\u76f8\u5bf9\u4f4d\u7f6e\u5173\u7cfb\u3002\u6b64\u5916\uff0c\u6b63\u5f26\u7f16\u7801\u8fd8\u5177\u6709 <strong>\u5916\u63a8\u80fd\u529b<\/strong>\uff0c\u53ef\u80fd\u5141\u8bb8\u6a21\u578b\u5904\u7406\u8bad\u7ec3\u4e2d\u672a\u89c1\u8fc7\u7684\u66f4\u957f\u5e8f\u5217\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u56db\u3001\u81ea\u6ce8\u610f\u529b\u7684\u4f18\u52bf\u5206\u6790<\/h1>\n\n\n\n<p>\u8bba\u6587\u4ece\u4e09\u4e2a\u7ef4\u5ea6\u5c06\u81ea\u6ce8\u610f\u529b\u5c42\u4e0e\u5faa\u73af\u5c42\u548c\u5377\u79ef\u5c42\u8fdb\u884c\u4e86\u7cfb\u7edf\u5bf9\u6bd4\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5c42\u7c7b\u578b<\/th><th>\u6bcf\u5c42\u8ba1\u7b97\u590d\u6742\u5ea6<\/th><th>\u987a\u5e8f\u64cd\u4f5c\u6570<\/th><th>\u6700\u5927\u8def\u5f84\u957f\u5ea6<\/th><\/tr><\/thead><tbody><tr><td>\u81ea\u6ce8\u610f\u529b<\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><msup><mi>n<\/mi><mn>2<\/mn><\/msup><mo>\u22c5<\/mo><mi>d<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(n^2 \\cdot d)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(1)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(1)<\/annotation><\/semantics><\/math><\/td><\/tr><tr><td>\u5faa\u73af<\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo>\u22c5<\/mo><msup><mi>d<\/mi><mn>2<\/mn><\/msup><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(n \\cdot d^2)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(n)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(n)<\/annotation><\/semantics><\/math>O(n)<\/td><\/tr><tr><td>\u5377\u79ef<\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mi>k<\/mi><mo>\u22c5<\/mo><mi>n<\/mi><mo>\u22c5<\/mo><msup><mi>d<\/mi><mn>2<\/mn><\/msup><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(k \\cdot n \\cdot d^2)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(1)<\/annotation><\/semantics><\/math><\/td><td><math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(\\log_k(n))<\/annotation><\/semantics><\/math><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u81ea\u6ce8\u610f\u529b\u5c42\u7684\u5173\u952e\u4f18\u52bf\u5728\u4e8e\uff1a\u4efb\u610f\u4e24\u4e2a\u4f4d\u7f6e\u4e4b\u95f4\u7684<strong>\u6700\u5927\u8def\u5f84\u957f\u5ea6\u4e3a O(1)<\/strong>\uff08\u5e38\u6570\u7ea7\uff09\uff0c\u800c\u5faa\u73af\u5c42\u9700\u8981 <math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(n)<\/annotation><\/semantics><\/math>O(n)\uff0c\u5377\u79ef\u5c42\u9700\u8981 <math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><msub><mrow><mi>log<\/mi><mo>\u2061<\/mo><\/mrow><mi>k<\/mi><\/msub><mo stretchy=\"false\">(<\/mo><mi>n<\/mi><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(\\log_k(n))<\/annotation><\/semantics><\/math>\u3002\u66f4\u77ed\u7684\u8def\u5f84\u610f\u5473\u7740\u66f4\u5bb9\u6613\u5b66\u4e60 <strong>\u957f\u8ddd\u79bb\u4f9d\u8d56\u5173\u7cfb<\/strong>\u3002\u6b64\u5916\uff0c\u5f53\u5e8f\u5217\u957f\u5ea6 <math><semantics><mrow><mi>n<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">n<\/annotation><\/semantics><\/math>\u5c0f\u4e8e\u8868\u793a\u7ef4\u5ea6 <math><semantics><mrow><mi>d<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d<\/annotation><\/semantics><\/math> \u65f6\uff08\u8fd9\u5728\u4e3b\u6d41\u7ffb\u8bd1\u6a21\u578b\u4e2d\u5f88\u5e38\u89c1\uff09\uff0c\u81ea\u6ce8\u610f\u529b\u5c42\u7684\u8ba1\u7b97\u901f\u5ea6\u4e5f\u5feb\u4e8e\u5faa\u73af\u5c42\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e94\u3001\u5b9e\u9a8c\u8bc4\u4f30<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1) \u673a\u5668\u7ffb\u8bd1<\/h2>\n\n\n\n<p>\u8bba\u6587\u5728\u4e24\u4e2a\u6807\u51c6\u7684\u673a\u5668\u7ffb\u8bd1\u57fa\u51c6\u4e0a\u9a8c\u8bc1\u4e86 Transformer \u7684\u6027\u80fd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WMT 2014 \u82f1\u5fb7\u7ffb\u8bd1<\/strong>\uff1aTransformer (big) \u8fbe\u5230 <strong>28.4 BLEU<\/strong>\uff0c\u6bd4\u6b64\u524d\u6240\u6709\u6a21\u578b\uff08\u5305\u62ec\u96c6\u6210\u6a21\u578b\uff09\u9ad8\u51fa\u8d85\u8fc7 2.0 BLEU\uff0c\u521b\u4e0b\u65b0\u7684\u6700\u4f18\u7eaa\u5f55\u3002<\/li>\n\n\n\n<li><strong>WMT 2014 \u82f1\u6cd5\u7ffb\u8bd1<\/strong>\uff1a\u8fbe\u5230 <strong>41.8 BLEU<\/strong> \u7684\u5355\u6a21\u578b\u6700\u4f18\u6210\u7ee9\uff0c\u800c\u8bad\u7ec3\u4ec5\u9700\u5728 8 \u5757 P100 GPU \u4e0a\u8dd1 <strong>3.5 \u5929<\/strong>\uff0c\u8bad\u7ec3\u6210\u672c\u4e0d\u5230\u5f53\u65f6\u6700\u4f18\u6a21\u578b\u7684 1\/4\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5373\u4f7f\u662f\u57fa\u7840\u6a21\u578b\uff08base model\uff09\u4e5f\u8d85\u8d8a\u4e86\u6240\u6709\u6b64\u524d\u53d1\u8868\u7684\u6a21\u578b\u548c\u96c6\u6210\u65b9\u6848\uff0c\u4e14\u8bad\u7ec3\u4ee3\u4ef7\u4ec5\u4e3a\u7ade\u4e89\u6a21\u578b\u7684\u4e00\u5c0f\u90e8\u5206\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2) \u6a21\u578b\u53d8\u4f53\u5206\u6790<\/h2>\n\n\n\n<p>\u8bba\u6587\u901a\u8fc7\u7cfb\u7edf\u7684\u6d88\u878d\u5b9e\u9a8c\uff08\u88683\uff09\u63a2\u7d22\u4e86\u4e0d\u540c\u8d85\u53c2\u6570\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6ce8\u610f\u529b\u5934\u6570<\/strong>\uff1a\u5355\u5934\u6ce8\u610f\u529b\u6bd4\u6700\u4f73\u8bbe\u7f6e\u4f4e 0.9 BLEU\uff0c\u4f46\u5934\u6570\u8fc7\u591a\u540c\u6837\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\uff1b<\/li>\n\n\n\n<li><strong>\u6a21\u578b\u89c4\u6a21<\/strong>\uff1a\u66f4\u5927\u7684\u6a21\u578b\u8868\u73b0\u66f4\u597d\uff08\u5982 <math><semantics><mrow><msub><mi>d<\/mi><mtext>model<\/mtext><\/msub><mo>=<\/mo><mn>1024<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">d_{\\text{model}}=1024<\/annotation><\/semantics><\/math> \u4f18\u4e8e 512\uff09\uff1b<\/li>\n\n\n\n<li><strong>Dropout<\/strong>\uff1a\u6b63\u5219\u5316\u5bf9\u9632\u6b62\u8fc7\u62df\u5408\u81f3\u5173\u91cd\u8981\uff1b<\/li>\n\n\n\n<li><strong>\u4f4d\u7f6e\u7f16\u7801<\/strong>\uff1a\u6b63\u5f26\u7f16\u7801\u4e0e\u5b66\u4e60\u5f0f\u4f4d\u7f6e\u5d4c\u5165\u6027\u80fd\u51e0\u4e4e\u4e00\u81f4\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">3) \u82f1\u8bed\u6210\u5206\u53e5\u6cd5\u5206\u6790<\/h2>\n\n\n\n<p>\u4e3a\u9a8c\u8bc1 Transformer \u7684\u6cdb\u5316\u80fd\u529b\uff0c\u8bba\u6587\u5c06\u5176\u5e94\u7528\u4e8e\u82f1\u8bed\u6210\u5206\u53e5\u6cd5\u5206\u6790\u4efb\u52a1\u3002\u5728\u51e0\u4e4e\u6ca1\u6709\u9488\u5bf9\u4efb\u52a1\u8fdb\u884c\u8c03\u4f18\u7684\u60c5\u51b5\u4e0b\uff0c4 \u5c42 Transformer \u5728 WSJ \u6d4b\u8bd5\u96c6\u4e0a\u53d6\u5f97\u4e86 <strong>91.3 F1<\/strong>\uff08\u7eaf\u76d1\u7763\uff09\u548c <strong>92.7 F1<\/strong>\uff08\u534a\u76d1\u7763\uff09\u7684\u6210\u7ee9\uff0c\u8868\u73b0\u4f18\u4e8e\u9664\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u6587\u6cd5\uff08RNNG\uff09\u4e4b\u5916\u7684\u6240\u6709\u6b64\u524d\u62a5\u544a\u7684\u6a21\u578b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h1 class=\"wp-block-heading\">\u516d\u3001\u6ce8\u610f\u529b\u53ef\u89c6\u5316<\/h1>\n\n\n\n<p>\u8bba\u6587\u5728\u9644\u5f55\u4e2d\u5c55\u793a\u4e86\u6ce8\u610f\u529b\u5934\u5b66\u5230\u7684\u4e30\u5bcc\u8bed\u8a00\u7ed3\u6784\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"516\" src=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-6.png\"  class=\"wp-image-1039\" srcset=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-6.png 782w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-6-300x198.png 300w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-6-768x507.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" title=\"Attention Is All You Need\u63d2\u56fe2\" alt=\"Attention Is All You Need\u63d2\u56fe2\" \/><\/figure>\n\n\n\n<p>\u5728\u7f16\u7801\u5668\u7b2c5\u5c42\u7684\u81ea\u6ce8\u610f\u529b\u4e2d\uff0c\u591a\u4e2a\u6ce8\u610f\u529b\u5934\u80fd\u591f\u51c6\u786e\u6355\u83b7\u52a8\u8bcd&#8221;making&#8221;\u7684\u8fdc\u8ddd\u79bb\u4f9d\u8d56\uff0c\u5b8c\u6210&#8221;making&#8230;more difficult&#8221;\u8fd9\u4e00\u8de8\u8d8a\u591a\u4e2a\u8bcd\u7684\u77ed\u8bed\u7ed3\u6784\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"811\" src=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-7.png\"  class=\"wp-image-1040\" srcset=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-7.png 775w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-7-287x300.png 287w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-7-768x804.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" title=\"Attention Is All You Need\u63d2\u56fe3\" alt=\"Attention Is All You Need\u63d2\u56fe3\" \/><\/figure>\n\n\n\n<p>\u53e6\u5916\u7684\u6ce8\u610f\u529b\u5934\u5219\u5c55\u793a\u51fa\u6307\u4ee3\u6d88\u89e3\uff08Anaphora Resolution\uff09\u7684\u80fd\u529b\u2014\u2014\u5f53\u5904\u7406\u4ee3\u8bcd&#8221;its&#8221;\u65f6\uff0c\u6ce8\u610f\u529b\u975e\u5e38\u96c6\u4e2d\u5730\u6307\u5411\u4e86\u5176\u5148\u884c\u8bcd&#8221;Law&#8221;\uff0c\u8868\u660e\u4e0d\u540c\u7684\u5934\u81ea\u52a8\u5b66\u4f1a\u4e86\u6267\u884c\u4e0d\u540c\u7684\u8bed\u6cd5\u548c\u8bed\u4e49\u4efb\u52a1\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"856\" src=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-8.png\"  class=\"wp-image-1041\" srcset=\"https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-8.png 765w, https:\/\/www.ndnlab.com\/wp-content\/uploads\/2026\/02\/image-8-268x300.png 268w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" title=\"Attention Is All You Need\u63d2\u56fe4\" alt=\"Attention Is All You Need\u63d2\u56fe4\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e03\u3001\u603b\u7ed3\u4e0e\u6df1\u8fdc\u5f71\u54cd<\/h1>\n\n\n\n<p><strong>Transformer<\/strong> \u662f\u7b2c\u4e00\u4e2a\u5b8c\u5168\u57fa\u4e8e\u6ce8\u610f\u529b\u673a\u5236\u7684\u5e8f\u5217\u8f6c\u6362\u6a21\u578b\uff0c\u5b83\u4ee5\u7b80\u6d01\u800c\u5f3a\u5927\u7684\u67b6\u6784\u8bc1\u660e\u4e86\uff1a\u5faa\u73af\u548c\u5377\u79ef\u5e76\u975e\u5e8f\u5217\u5efa\u6a21\u7684\u5fc5\u9700\u7ec4\u4ef6\u3002\u5176\u6838\u5fc3\u8d21\u732e\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u81ea\u6ce8\u610f\u529b\u673a\u5236\u4f5c\u4e3a\u552f\u4e00\u8ba1\u7b97\u8303\u5f0f<\/strong>\uff1a\u4ee5 <math><semantics><mrow><mi>O<\/mi><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">O(1)<\/annotation><\/semantics><\/math>\u7684\u8def\u5f84\u957f\u5ea6\u6355\u83b7\u4efb\u610f\u8ddd\u79bb\u7684\u4f9d\u8d56\u5173\u7cfb\uff1b<\/li>\n\n\n\n<li><strong>\u591a\u5934\u6ce8\u610f\u529b<\/strong>\uff1a\u8ba9\u6a21\u578b\u540c\u65f6\u5173\u6ce8\u4e0d\u540c\u5b50\u7a7a\u95f4\u7684\u4fe1\u606f\uff1b<\/li>\n\n\n\n<li><strong>\u9ad8\u5ea6\u5e76\u884c\u5316<\/strong>\uff1a\u8bad\u7ec3\u901f\u5ea6\u8fdc\u8d85 RNN\/CNN \u67b6\u6784\uff1b<\/li>\n\n\n\n<li><strong>\u5f3a\u5927\u7684\u6cdb\u5316\u80fd\u529b<\/strong>\uff1a\u5728\u7ffb\u8bd1\u4e4b\u5916\u7684\u4efb\u52a1\uff08\u5982\u53e5\u6cd5\u5206\u6790\uff09\u4e2d\u540c\u6837\u8868\u73b0\u4f18\u5f02\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u66f4\u91cd\u8981\u7684\u662f\uff0cTransformer \u7684\u5f71\u54cd\u8fdc\u8d85\u8fd9\u7bc7\u8bba\u6587\u672c\u8eab\u3002\u5b83\u76f4\u63a5\u50ac\u751f\u4e86 <strong>BERT<\/strong>\u3001<strong>GPT<\/strong> \u7cfb\u5217\u3001<strong>T5<\/strong>\u3001<strong>ViT<\/strong> \u7b49\u4e00\u7cfb\u5217\u91cc\u7a0b\u7891\u5f0f\u6a21\u578b\uff0c\u6210\u4e3a\u4e86\u5f53\u4eca\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u548c\u591a\u6a21\u6001\u6a21\u578b\u7684\u57fa\u7840\u67b6\u6784\u3002\u53ef\u4ee5\u8bf4\uff0c\u8fd9\u7bc7 2017 \u5e74\u7684\u8bba\u6587\u5b9a\u4e49\u4e86\u6b64\u540e\u6574\u4e2a AI \u9886\u57df\u7684\u6280\u672f\u65b9\u5411\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u76f8\u5173\u7814\u7a76\u65b9\u5411\uff0cTransformer \u5728<strong>\u81ea\u6ce8\u610f\u529b\u673a\u5236\u8bbe\u8ba1<\/strong>\u3001<strong>\u4f4d\u7f6e\u7f16\u7801\u7b56\u7565<\/strong>\u4ee5\u53ca<strong>\u7f16\u7801\u5668-\u89e3\u7801\u5668\u67b6\u6784\u5206\u79bb<\/strong>\u65b9\u9762\u7684\u601d\u8def\u5177\u6709\u6781\u5f3a\u7684\u53c2\u8003\u4ef7\u503c\u3002\u7279\u522b\u662f\u5176\u901a\u8fc7\u591a\u5934\u673a\u5236\u5b9e\u73b0&#8221;\u5206\u800c\u6cbb\u4e4b&#8221;\u7684\u7b56\u7565\uff0c\u5bf9\u7406\u89e3\u548c\u8bbe\u8ba1\u66f4\u9ad8\u6548\u7684\u6ce8\u610f\u529b\u53d8\u4f53\uff08\u5982\u7ebf\u6027\u6ce8\u610f\u529b\u3001\u7a00\u758f\u6ce8\u610f\u529b\u3001FlashAttention \u7b49\uff09\u63d0\u4f9b\u4e86\u91cd\u8981\u7684\u7406\u8bba\u57fa\u7840\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5ea6\u5b66\u4e60 \u4f1a\u8bae\uff1aNeurIPS 2017\uff08\u7b2c31\u5c4a\u795e\u7ecf\u4fe1\u606f\u5904\u7406\u7cfb\u7edf\u5927\u4f1a\uff09 Ashish Vaswani\u2217, Noam Shazeer\u2217, Niki Parmar\u2217, Jakob Uszkoreit\u2217, Llion Jones\u2217, Aidan N. Gomez\u2217\u2020, \u0141ukasz Kaiser\u2217, Illia Polosukhin\u2217 Google Brain \/ Google Research \/ University of Toronto arXiv:1706.03762v7 &hellip; <a href=\"https:\/\/www.ndnlab.com\/?p=1036\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1036","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/posts\/1036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1036"}],"version-history":[{"count":1,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/posts\/1036\/revisions"}],"predecessor-version":[{"id":1042,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=\/wp\/v2\/posts\/1036\/revisions\/1042"}],"wp:attachment":[{"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ndnlab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}