{"id":104615,"date":"2026-09-12T19:49:51","date_gmt":"2026-09-12T11:49:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104615.html"},"modified":"2026-09-12T19:49:51","modified_gmt":"2026-09-12T11:49:51","slug":"java-%e7%a8%8b%e5%ba%8f%e5%91%98%e7%ac%ac-48-%e9%98%b6%e6%ae%b57%ef%bc%9atransformer-%e6%9e%b6%e6%9e%84%e6%80%bb%e8%a7%88%e4%b8%8e%e8%87%aa%e6%b3%a8%e6%84%8f%e5%8a%9b%e7%9b%b4%e8%a7%89%ef%bc%8ccausal","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104615.html","title":{"rendered":"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765"},"content":{"rendered":"<h3>1. \u81ea\u56de\u5f52\u751f\u6210\u7684\u6838\u5fc3\u7ea6\u675f<\/h3>\n<p>\u751f\u6210\u5f0f\u6a21\u578b\u662f\u81ea\u56de\u5f52\u7684&#xff1a;\u7b2c t \u4e2a\u8bcd\u53ea\u80fd\u57fa\u4e8e\u524d t-1 \u4e2a\u5df2\u751f\u6210\u7684\u8bcd\u6765\u9884\u6d4b\u3002\u5982\u679c Decoder \u5728\u7b97\u7b2c t \u4e2a\u4f4d\u7f6e\u65f6\u300c\u5077\u770b\u300d\u4e86\u7b2c t&#043;1\u3001t&#043;2 \u4e2a\u8bcd&#xff0c;\u8bad\u7ec3\u548c\u63a8\u7406\u5c31\u51fa\u73b0\u4e86\u4e0d\u4e00\u81f4\u2014\u2014\u8bad\u7ec3\u65f6\u5b83\u89c1\u8fc7\u7b54\u6848&#xff0c;\u63a8\u7406\u65f6\u5374\u6ca1\u6709&#xff0c;\u6a21\u578b\u4f1a\u5b66\u5230\u9519\u8bef\u7684\u6761\u4ef6\u6982\u7387\u3002<\/p>\n<p>\u6240\u4ee5\u5fc5\u987b\u6709\u4e00\u9053\u300c\u5899\u300d&#xff0c;\u6321\u4f4f\u672a\u6765\u3002\u8fd9\u9053\u5899\u5c31\u662f\u56e0\u679c\u63a9\u7801&#xff08;Causal Mask&#xff09;\u3002<\/p>\n<p>&#xff08;\u89c1\u56fe figure_07_1&#xff09;<\/p>\n<h3>2. \u4e0b\u4e09\u89d2\u63a9\u7801<\/h3>\n<p>\u5b9e\u73b0\u65b9\u5f0f\u5f88\u76f4\u63a5&#xff1a;\u5728\u6ce8\u610f\u529b\u5206\u6570\u77e9\u9635 Q\u00b7K\u1d40 \u4e0a&#xff0c;\u628a\u6240\u6709\u300c\u672a\u6765\u4f4d\u7f6e\u300d\u7684\u5206\u503c\u8bbe\u4e3a -\u221e\u3002\u7ecf\u8fc7 Softmax \u540e&#xff0c;exp(-\u221e)\u21920&#xff0c;\u8fd9\u4e9b\u4f4d\u7f6e\u6743\u91cd\u53d8\u6210 0&#xff0c;\u76f8\u5f53\u4e8e\u300c\u5b8c\u5168\u770b\u4e0d\u5230\u300d\u3002<\/p>\n<p>\u7ed3\u679c\u5c31\u662f\u5206\u6570\u77e9\u9635\u7684\u4e0a\u4e09\u89d2\u5168\u88ab\u5c4f\u853d&#xff0c;\u53ea\u4fdd\u7559\u5bf9\u89d2\u7ebf\u53ca\u5de6\u4e0b&#xff08;\u5f53\u524d\u4f4d\u7f6e\u770b\u81ea\u5df1\u548c\u5de6\u8fb9&#xff09;\u3002\u6570\u5b66\u4e0a&#xff1a;score[i][j] &#061; -\u221e when j &gt; i\u3002<\/p>\n<h3>3. \u77e9\u9635\u89c6\u89d2<\/h3>\n<p>\u628a\u6ce8\u610f\u529b\u5206\u6570\u94fa\u6210\u4e00\u4e2a n\u00d7n \u65b9\u9635&#xff0c;\u56e0\u679c\u63a9\u7801\u5c31\u662f\u628a\u5b83\u4e0a\u4e09\u89d2\u5168\u6d82\u9ed1\u3002\u7b2c 0 \u884c\u53ea\u80fd\u770b\u7b2c 0 \u5217&#xff0c;\u7b2c i \u884c\u53ea\u80fd\u770b\u7b2c 0\u2026i \u5217&#xff0c;\u7b2c n-1 \u884c\u80fd\u770b\u5168\u90e8\u3002<\/p>\n<p>\u8fd9\u4e2a\u7ed3\u6784\u7684\u7f8e\u5999\u4e4b\u5904\u5728\u4e8e&#xff1a;\u5b83\u7528\u4e00\u6b21\u77e9\u9635\u8fd0\u7b97\u540c\u65f6\u7ea6\u675f\u4e86\u6240\u6709\u4f4d\u7f6e\u7684\u53ef\u89c1\u6027&#xff0c;GPU \u4e0a\u6781\u5176\u9ad8\u6548\u3002\u53ef\u89c6\u5316\u6ce8\u610f\u529b\u77e9\u9635\u65f6&#xff0c;\u4f60\u4f1a\u770b\u5230\u4e00\u6761\u6e05\u6670\u7684\u300c\u53ea\u5de6\u4e0b\u6709\u6548\u300d\u7684\u4e09\u89d2\u5f62\u3002<\/p>\n<p>&#xff08;\u89c1\u56fe figure_07_2&#xff09;<\/p>\n<h3>4. \u8bad\u7ec3\u4e0e\u63a8\u7406\u4e00\u81f4\u6027<\/h3>\n<p>\u8bad\u7ec3\u65f6&#xff0c;\u6a21\u578b\u4e00\u6b21\u6027\u62ff\u5230\u6574\u53e5\u8bdd&#xff0c;\u7528\u4e0b\u4e09\u89d2\u63a9\u7801\u5e76\u884c\u7b97\u6240\u6709\u4f4d\u7f6e&#xff08;\u6bcf\u4e2a\u4f4d\u7f6e\u53ea\u770b\u5de6\u8fb9&#xff0c;\u6240\u4ee5\u5e76\u884c\u5b89\u5168&#xff09;&#xff1b;\u63a8\u7406\u65f6&#xff0c;\u6a21\u578b\u9010 token \u751f\u6210&#xff0c;\u6bcf\u6b65\u53ea\u5582\u5165\u5df2\u751f\u6210\u90e8\u5206&#xff0c;\u903b\u8f91\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n<p>\u5173\u952e\u70b9&#xff1a;\u8bad\u7ec3\u548c\u63a8\u7406\u7528\u7684\u662f\u540c\u4e00\u5957\u56e0\u679c\u7ea6\u675f&#xff0c;\u6240\u4ee5\u8bad\u7ec3\u5b66\u5230\u7684\u300c\u57fa\u4e8e\u524d\u6587\u9884\u6d4b\u540e\u6587\u300d\u7684\u80fd\u529b&#xff0c;\u80fd\u65e0\u7f1d\u8fc1\u79fb\u5230\u63a8\u7406\u65f6\u7684\u9010\u8bcd\u751f\u6210\u3002\u8fd9\u662f\u81ea\u56de\u5f52\u6a21\u578b\u80fd work \u7684\u6839\u672c\u4fdd\u8bc1\u3002<\/p>\n<p>&#xff08;\u89c1\u56fe figure_07_4&#xff09;<\/p>\n<h3>5. \u4e3a\u4ec0\u4e48 Mask \u4e0d\u80fd\u7701<\/h3>\n<p>\u5982\u679c\u53bb\u6389 Mask&#xff0c;Decoder \u5728\u8bad\u7ec3\u65f6\u5c31\u76f4\u63a5\u770b\u5230\u4e86\u672a\u6765\u7b54\u6848&#xff08;\u6807\u7b7e\u6cc4\u6f0f&#xff09;&#xff0c;\u635f\u5931\u51fd\u6570\u4f1a\u300c\u4f5c\u5f0a\u300d\u5730\u964d\u5230\u5f88\u4f4e&#xff0c;\u4f46\u4f60\u4e00\u63a8\u7406\u5c31\u539f\u5f62\u6bd5\u9732\u2014\u2014\u751f\u6210\u51fa\u6765\u7684\u6587\u672c\u8bed\u65e0\u4f26\u6b21\u6216\u590d\u8bfb\u3002<\/p>\n<p>\u5f88\u591a\u521d\u5b66\u8005\u590d\u73b0 GPT \u65f6\u751f\u6210\u6548\u679c\u5d29&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u67e5\u5b66\u4e60\u7387&#xff0c;\u5176\u5b9e\u5927\u534a\u662f\u56e0\u679c\u63a9\u7801\u65b9\u5411\u5199\u53cd\u4e86&#xff08;\u628a\u4e0b\u4e09\u89d2\u5199\u6210\u4e0a\u4e09\u89d2&#xff09;&#xff0c;\u6a21\u578b\u5728\u300c\u770b\u672a\u6765\u300d\u3002Mask \u662f\u5e95\u7ebf&#xff0c;\u4e0d\u662f\u4f18\u5316\u9879\u3002<\/p>\n<p>&#xff08;\u89c1\u56fe figure_07_3&#xff09;<\/p>\n<h3>6. Java \u4fa7\u89c2\u5bdf<\/h3>\n<p>\u4f60\u8c03 LLM API \u7eed\u5199\u65f6&#xff0c;\u56e0\u679c\u6027\u7531\u6a21\u578b\u5185\u90e8\u4fdd\u8bc1&#xff0c;\u4f60\u4e0d\u7528\u7ba1\u3002\u4f46\u6709\u4e00\u4e2a\u5de5\u7a0b\u63d0\u9192&#xff1a;\u4e0d\u8981\u5728 prompt \u91cc\u628a\u7b54\u6848\u4e5f\u653e\u8fdb\u53bb\u3002\u6bd4\u5982\u505a\u586b\u7a7a\u9898&#xff0c;\u4f60\u82e5\u628a\u300c\u6807\u51c6\u7b54\u6848\u300d\u5199\u8fdb\u4e0a\u4e0b\u6587&#xff0c;\u7b49\u4e8e\u4eba\u4e3a\u7834\u574f\u4e86 Mask \u8be5\u6709\u7684\u56e0\u679c\u7ea6\u675f&#xff0c;\u6a21\u578b\u4f1a\u76f4\u63a5\u6284\u4f60\u7ed9\u7684\u7b54\u6848&#xff0c;\u8f93\u51fa\u5931\u53bb\u6cdb\u5316\u610f\u4e49\u3002<\/p>\n<p>\u4e00\u53e5\u8bdd&#xff1a;\u56e0\u679c\u63a9\u7801\u4fdd\u8bc1\u300c\u6a21\u578b\u53ea\u80fd\u57fa\u4e8e\u5df2\u77e5\u9884\u6d4b\u672a\u77e5\u300d&#xff0c;\u4efb\u4f55\u7834\u574f\u8fd9\u4e2a\u524d\u63d0\u7684\u5199\u6cd5\u90fd\u4f1a\u8ba9\u8f93\u51fa\u9000\u5316\u3002<\/p>\n<p><span class=\"token comment\">\/** \u4e0b\u4e09\u89d2\u63a9\u7801\u793a\u610f *\/<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">CausalMask<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">double<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token function\">mask<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">double<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> scores<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> n <span class=\"token operator\">&#061;<\/span> scores<span class=\"token punctuation\">.<\/span>length<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> n<span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> j <span class=\"token operator\">&#061;<\/span> i <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span> j <span class=\"token operator\">&lt;<\/span> n<span class=\"token punctuation\">;<\/span> j<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                scores<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span>j<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Double<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">NEGATIVE_INFINITY<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> scores<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<table>\n<tr>\u4f4d\u7f6e\u53ef\u89c1\u8303\u56f4\u88ab Mask \u4f4d\u7f6eSoftmax \u540e\u6743\u91cd<\/tr>\n<tbody>\n<tr>\n<td>pos 0<\/td>\n<td>\u4ec5 pos 0<\/td>\n<td>pos 1\u2026n<\/td>\n<td>\u672a\u6765\u4e3a 0<\/td>\n<\/tr>\n<tr>\n<td>pos i<\/td>\n<td>pos 0\u2026i<\/td>\n<td>pos i&#043;1\u2026n<\/td>\n<td>\u672a\u6765\u4e3a 0<\/td>\n<\/tr>\n<tr>\n<td>pos n<\/td>\n<td>\u5168\u90e8<\/td>\n<td>\u65e0<\/td>\n<td>\u6b63\u5e38<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>1. \u81ea\u56de\u5f52\u751f\u6210\u7684\u6838\u5fc3\u7ea6\u675f<br \/>\n\u751f\u6210\u5f0f\u6a21\u578b\u662f\u81ea\u56de\u5f52\u7684&#xff1a;\u7b2c t \u4e2a\u8bcd\u53ea\u80fd\u57fa\u4e8e\u524d t-1 \u4e2a\u5df2\u751f\u6210\u7684\u8bcd\u6765\u9884\u6d4b\u3002\u5982\u679c Decoder \u5728\u7b97\u7b2c t \u4e2a\u4f4d\u7f6e\u65f6\u300c\u5077\u770b\u300d\u4e86\u7b2c t1\u3001t2 \u4e2a\u8bcd&#xff0c;\u8bad\u7ec3\u548c\u63a8\u7406\u5c31\u51fa\u73b0\u4e86\u4e0d\u4e00\u81f4\u2014\u2014\u8bad\u7ec3\u65f6\u5b83\u89c1\u8fc7\u7b54\u6848&#xff0c;\u63a8\u7406\u65f6\u5374\u6ca1\u6709&#xff0c;\u6a21\u578b\u4f1a\u5b66\u5230\u9519\u8bef\u7684\u6761\u4ef6\u6982\u7387\u3002<br \/>\n\u6240\u4ee5\u5fc5\u987b\u6709\u4e00\u9053\u300c\u5899\u300d&#xff0c;\u6321\u4f4f\u672a\u6765\u3002\u8fd9\u9053\u5899\u5c31\u662f\u56e0\u679c\u63a9\u7801&#xff08;Causal Mask&#xff09;\u3002<br \/>\n&#xff08;\u89c1\u56fe figure_0<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,841,190],"topic":[],"class_list":["post-104615","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-transformer","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \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\/104615.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u81ea\u56de\u5f52\u751f\u6210\u7684\u6838\u5fc3\u7ea6\u675f \u751f\u6210\u5f0f\u6a21\u578b\u662f\u81ea\u56de\u5f52\u7684&#xff1a;\u7b2c t \u4e2a\u8bcd\u53ea\u80fd\u57fa\u4e8e\u524d t-1 \u4e2a\u5df2\u751f\u6210\u7684\u8bcd\u6765\u9884\u6d4b\u3002\u5982\u679c Decoder \u5728\u7b97\u7b2c t \u4e2a\u4f4d\u7f6e\u65f6\u300c\u5077\u770b\u300d\u4e86\u7b2c t1\u3001t2 \u4e2a\u8bcd&#xff0c;\u8bad\u7ec3\u548c\u63a8\u7406\u5c31\u51fa\u73b0\u4e86\u4e0d\u4e00\u81f4\u2014\u2014\u8bad\u7ec3\u65f6\u5b83\u89c1\u8fc7\u7b54\u6848&#xff0c;\u63a8\u7406\u65f6\u5374\u6ca1\u6709&#xff0c;\u6a21\u578b\u4f1a\u5b66\u5230\u9519\u8bef\u7684\u6761\u4ef6\u6982\u7387\u3002 \u6240\u4ee5\u5fc5\u987b\u6709\u4e00\u9053\u300c\u5899\u300d&#xff0c;\u6321\u4f4f\u672a\u6765\u3002\u8fd9\u9053\u5899\u5c31\u662f\u56e0\u679c\u63a9\u7801&#xff08;Causal Mask&#xff09;\u3002 &#xff08;\u89c1\u56fe figure_0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104615.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T11:49:51+00:00\" \/>\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\/104615.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104615.html\",\"name\":\"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-12T11:49:51+00:00\",\"dateModified\":\"2026-09-12T11:49:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104615.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104615.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104615.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765\"}]},{\"@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":"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \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\/104615.html","og_locale":"zh_CN","og_type":"article","og_title":"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u81ea\u56de\u5f52\u751f\u6210\u7684\u6838\u5fc3\u7ea6\u675f \u751f\u6210\u5f0f\u6a21\u578b\u662f\u81ea\u56de\u5f52\u7684&#xff1a;\u7b2c t \u4e2a\u8bcd\u53ea\u80fd\u57fa\u4e8e\u524d t-1 \u4e2a\u5df2\u751f\u6210\u7684\u8bcd\u6765\u9884\u6d4b\u3002\u5982\u679c Decoder \u5728\u7b97\u7b2c t \u4e2a\u4f4d\u7f6e\u65f6\u300c\u5077\u770b\u300d\u4e86\u7b2c t1\u3001t2 \u4e2a\u8bcd&#xff0c;\u8bad\u7ec3\u548c\u63a8\u7406\u5c31\u51fa\u73b0\u4e86\u4e0d\u4e00\u81f4\u2014\u2014\u8bad\u7ec3\u65f6\u5b83\u89c1\u8fc7\u7b54\u6848&#xff0c;\u63a8\u7406\u65f6\u5374\u6ca1\u6709&#xff0c;\u6a21\u578b\u4f1a\u5b66\u5230\u9519\u8bef\u7684\u6761\u4ef6\u6982\u7387\u3002 \u6240\u4ee5\u5fc5\u987b\u6709\u4e00\u9053\u300c\u5899\u300d&#xff0c;\u6321\u4f4f\u672a\u6765\u3002\u8fd9\u9053\u5899\u5c31\u662f\u56e0\u679c\u63a9\u7801&#xff08;Causal Mask&#xff09;\u3002 &#xff08;\u89c1\u56fe figure_0","og_url":"https:\/\/www.wsisp.com\/helps\/104615.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-12T11:49:51+00:00","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\/104615.html","url":"https:\/\/www.wsisp.com\/helps\/104615.html","name":"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-12T11:49:51+00:00","dateModified":"2026-09-12T11:49:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104615.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104615.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104615.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java \u7a0b\u5e8f\u5458\u7b2c 48 \u9636\u6bb57\uff1aTransformer \u67b6\u6784\u603b\u89c8\u4e0e\u81ea\u6ce8\u610f\u529b\u76f4\u89c9\uff0cCausal Mask\uff1aDecoder \u5982\u4f55\u505a\u5230\u770b\u4e0d\u89c1\u672a\u6765"}]},{"@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\/104615","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=104615"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104615\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104615"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}