{"id":19888,"date":"2025-09-21T10:54:41","date_gmt":"2025-09-21T02:54:41","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=19888"},"modified":"2026-01-09T08:24:50","modified_gmt":"2026-01-09T00:24:50","slug":"svd-01","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2025\/09\/svd-01\/","title":{"rendered":"\u5947\u5f02\u503c\u5206\u89e3&#8211;\u6df1\u5ea6\u5b66\u4e60\u7684\u6570\u5b66\u57fa\u7840"},"content":{"rendered":"\n\n\n\n<p style=\"margin-top:4px;padding-top:4px\">\u5728 \\(\\text{Attention} \\) \u673a\u5236\uff08\u6216 \\( \\text{Multi-Head Attention} \\) \uff09\u4e2d\u6211\u4eec\u4f1a\u770b\u5230\u8fd9\u6837\u7684\u53d8\u6362\uff1a\\( \\text{Attention} = softmax(\\frac{Q_iK_i^{T}}{\\sqrt{d}}) \\)\uff0c\u5176\u4e2d\u8fd9\u91cc \\( Q_i = XW_i^Q \\) \u90a3\u4e48\u5982\u4f55\u7406\u89e3\u8fd9\u91cc\u7684 \\( XW_i^Q \\) \u5462\uff1f \u8be5\u53d8\u6362\u662f\u5411\u91cf\u7a7a\u95f4\u5185\u4e00\u4e2a\u5178\u578b\u7684\u7ebf\u6027\u53d8\u6362\uff0c\u800c\u8fd9\u91cc\u7684 \\( W_i^Q \\) \u5c31\u662f\u5bf9\u5e94\u7684\u7ebf\u6027\u53d8\u6362\u77e9\u9635\uff0c\u5728\u65e9\u671f GPT \u6a21\u578b\u4e2d\u8be5\u77e9\u9635\u662f\u4e00\u4e2a\\( 768 \\times 64\\) \u7684\u77e9\u9635\uff0c\u7814\u7a76\u8be5\u77e9\u9635\u7684\u5178\u578b\u65b9\u6cd5\u5c31\u53ef\u4ee5\u4f7f\u7528 \\( \\text{SVD} \\) \u5206\u89e3\uff0c\u672c\u6587\u5c55\u793a\u4e86\u7b80\u5355\u7684\u4e8c\u7ef4\u7a7a\u95f4\u4e2d \\( \\text{SVD} \\) \u5206\u89e3\u4ee5\u53ca\u5bf9\u5e94\u7684\u51e0\u4f55\u610f\u4e49\uff0c\u4ece\u800c\u53ef\u4ee5\u8f83\u597d\u7684\u5e2e\u52a9\u7406\u89e3\u4e0a\u8ff0\u8ba1\u7b97\u7684\u6df1\u5c42\u6b21\u542b\u4e49\u3002<\/p>\n\n\n\n<p>\u5173\u4e8e\u5947\u5f02\u503c\u5206\u89e3\uff08\\( \\text{SVD} \\)\uff09\u80fd\u591f\u89e3\u51b3\u7684\u95ee\u9898\u8fd9\u91cc\u4e0d\u518d\u8be6\u8ff0\u3002\u672c\u6587\u901a\u8fc7\u5c55\u793a\u5bf9\u4e8e\u5e73\u9762\u7a7a\u95f4\u4e2d\u7684\u7ebf\u6027\u53d8\u6362\u8fdb\u884c\u5947\u5f02\u503c\u5206\u89e3\uff0c\u4ece\u800c\u89c2\u5bdf\u8be5\u5206\u89e3\u5982\u4f55\u901a\u8fc7\u201c\u51e0\u4f55\u201d\u7684\u65b9\u5f0f\u63cf\u8ff0\u4e00\u4e2a\u7ebf\u6027\u53d8\u6362\uff0c\u4ece\u800c\u5efa\u7acb\u5bf9\u7ebf\u6027\u53d8\u6362\u7684\u76f4\u89c2\u7406\u89e3\u3002\u672c\u6587\u7684\u793a\u4f8b\u662f\u4e00\u4e2a\\( 2 \\times 2\\)\u7684\u77e9\u9635\uff0c\u6240\u4ee5\u8fd8\u8865\u5145\u4e86\u5bf9\u8be5\u77e9\u9635\u7684\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u7684\u8ba1\u7b97\uff0c\u4ece\u800c\u5bf9\u6bd4\u8fd9\u4e24\u79cd\u65b9\u6cd5\u5728\u5904\u7406\u201c\u65b9\u9635\u201d\u65f6\u7684\u5f02\u540c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u6982\u8ff0<\/h3>\n\n\n\n<p>\u672c\u6587\u901a\u8fc7\u5bf9\u4e8c\u7ef4\u7a7a\u95f4\u4e2d\u7684\u4e00\u4e2a\u7ebf\u6027\u53d8\u6362\uff08\u6ee1\u79e9\u65b9\u9635\uff09 \\( A = \\begin{bmatrix} 1 &amp; 2 \\\\ 2 &amp; 1 \\end{bmatrix} \\) \u8fdb\u884c \\( \\text{SVD} \\) \u5206\u6790\u3001\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u5206\u6790\uff0c\u4ece\u800c\u5efa\u7acb\u5728\u5e73\u9762\u7a7a\u95f4\u4e2d\u5bf9\u4e8e\u7ebf\u6027\u53d8\u6362\u7684\u76f4\u89c9\u7406\u89e3\uff0c\u66f4\u8fdb\u4e00\u6b65\u7684\u7406\u89e3\\( \\text{SVD} \\)\u548c\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u5206\u522b\u662f\u5982\u4f55\u63cf\u8ff0\u4e00\u4e2a\u7ebf\u6027\u53d8\u6362\u7684\u3002\u5177\u4f53\u7684\uff0c\u8fd9\u91cc\u89c2\u5bdf\u4e86\u5728\u8be5\u7ebf\u6027\u53d8\u6362\u7684\u4f5c\u7528\u4e0b\uff0c\u4e00\u4e2a\u70b9 \\( (1,0) \\) \u662f\u5982\u4f55\u5728\u4e24\u79cd\u77e9\u9635\u53d8\u6362\u4e0b\uff0c\u6620\u5c04\u5230\u76ee\u6807\u70b9\u7684\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5947\u5f02\u503c\u5206\u89e3<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">2.1 \u77e9\u9635A\u7684\u4e24\u79cd SVD \u5206\u89e3<\/h4>\n\n\n\n<p>\u5947\u5f02\u503c\u5206\u89e3\u5e76\u4e0d\u662f\u552f\u4e00\u7684\u3002\u4ece\u51e0\u4f55\u7684\u89d2\u5ea6\u7406\u89e3\uff0c\u4e00\u4e2a\u4e8c\u7ef4\u7a7a\u95f4\u7684\u7ebf\u6027\u53d8\u6362\uff0c\u662f\u7531\u65cb\u8f6c\u3001\u53cd\u5c04\u3001\u7f29\u653e\u7ec4\u6210\uff0c\u800c\u5148\u65cb\u8f6c\u3001\u6216\u5148\u53cd\u5c04\u90fd\u662f\u53ef\u4ee5\u7684\uff0c\u800c\u8fd9\u5bf9\u5e94\u7684\u5c31\u662f\u4e0d\u540c\u7684\u5947\u5f02\u503c\u5206\u89e3\u3002\u8003\u8651\u4e0a\u8ff0\u7684\u77e9\u9635 \\( A = \\begin{bmatrix} 1 &amp; 2 \\\\ 2 &amp; 1 \\end{bmatrix} \\) \u8fdb\u884c \\( \\text{SVD} \\)\uff0c\u6211\u4eec\u6709\u5982\u4e0b\u4e24\u79cd\u5206\u89e3\uff08\u5173\u4e8e\u5177\u4f53\u7684\u5206\u89e3\u65b9\u6cd5\uff0c\u672c\u6587\u5e76\u4e0d\u8be6\u8ff0\uff09\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u79cd\u5206\u89e3\uff1a<\/p>\n\n\n<p>$$ A = \\begin{bmatrix}<br \/>\n1 &#038; 2 \\\\<br \/>\n2 &#038; 1<br \/>\n\\end{bmatrix} = U\u03a3V^T =\\begin{bmatrix}<br \/>\n\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n3 &#038; 0 \\\\<br \/>\n0 &#038; 1<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}} \\\\<br \/>\n\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}<br \/>\n$$<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u79cd\u5206\u89e3\u5982\u4e0b\uff1a<\/p>\n\n\n<p>$$ A = \\begin{bmatrix}<br \/>\n1 &#038; 2 \\\\<br \/>\n2 &#038; 1<br \/>\n\\end{bmatrix} = U\u03a3V^T =\\begin{bmatrix}<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n3 &#038; 0 \\\\<br \/>\n0 &#038; 1<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n \\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix} $$<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.2 \u5206\u89e31\u7684\u51e0\u4f55\u610f\u4e49\u4e0e\u56fe\u793a<\/h4>\n\n\n<p>$$ A = \\begin{bmatrix}<br \/>\n1 &#038; 2 \\\\<br \/>\n2 &#038; 1<br \/>\n\\end{bmatrix} = U\\Sigma V^T = \\begin{bmatrix}<br \/>\n\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n3 &#038; 0 \\\\<br \/>\n0 &#038; 1<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}} \\\\<br \/>\n\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}<br \/>\n$$<\/p>\n\n\n\n<p>\u8003\u8651\uff1a<\/p>\n\n\n\n<p>\\( V^T = \\begin{bmatrix} \\frac{1}{\\sqrt{2}} &amp; \\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}}\\end{bmatrix} \\) \u5f62\u5f0f\u4e0e \\( \\begin{bmatrix} \\cos \\varphi &amp; \\sin\\varphi \\\\ \\sin\\varphi &amp; -\\cos \\varphi \\end{bmatrix} \\) \u76f8\u540c\uff0c\u6545\uff0c\u6b64\u4e3a\u5173\u4e8e\u76f4\u7ebf \\( y = (\\tan\\frac{\\varphi}{2})x \\) \u7684\u53cd\u5c04<sup>[\u9644\u5f551]<\/sup>\u3002<\/p>\n\n\n\n<p>\\( \\Sigma = \\begin{bmatrix} 3 &amp; 0 \\\\ 0 &amp; 1 \\end{bmatrix} \\) \u8868\u793a\u5c06\u70b9\u3001\u5411\u91cf\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u3002<\/p>\n\n\n\n<p>\\( U = \\begin{bmatrix} \\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} &amp; \\frac{1}{\\sqrt{2}} \\end{bmatrix} \\) \u5f62\u5f0f\u4e0e \\( \\begin{bmatrix} \\cos \\varphi &amp; -\\sin\\varphi \\\\ \\sin\\varphi &amp; \\cos \\varphi \\end{bmatrix} \\) \u76f8\u540c\uff0c\u6545\uff0c\u6b64\u4e3a\u4e00\u4e2a\u9006\u65f6\u9488 \\(  \\varphi \\) \u5ea6\u7684\u65cb\u8f6c<sup>[\u9644\u5f551]<\/sup>\u3002<\/p>\n\n\n\n<p>\u5373\uff0c\u4e0a\u8ff0\u7684\u7ebf\u6027\u53d8\u6362\u53ef\u4ee5\u505a\u8fd9\u6837\u7684\u7406\u89e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5148\u5c06\u70b9\u4ee5\\( y=\\tan\\frac{45}{2}x = (\\sqrt{2}-1)x \\)\u4e3a\u8f74\u8fdb\u884c\u53cd\u5c04<\/li>\n\n\n\n<li>\u7136\u540e\u5c06\u5750\u6807\u7b2c\u4e00\u4e2a\u5206\u91cf\u653e\u59273\u500d<\/li>\n\n\n\n<li>\u6700\u540e\u518d\u9006\u65f6\u9488\u65cb\u8f6c\\( 45^{\\circ} \\)  <\/li>\n<\/ul>\n\n\n\n<p>\u8003\u8651\u5750\u6807\u4e0a\u7684\u70b9\\( \\alpha = \\begin{pmatrix} 1 \\\\ 0 \\end{pmatrix} \\)\uff0c\u6211\u4eec\u770b\u770b\u5982\u4f55\u7ecf\u8fc7\u8be5\u7ebf\u6027\u53d8\u6362\uff0c\u6620\u5c04\u5230\u76ee\u6807\u70b9\uff1a<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:60%\">\n<p>\u53f3\u56fe\u53cd\u6620\u4e86\u5b8c\u6574\u7684\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\\( (1,0) \\) \u5148\u7ecf\u8fc7\u6309\u56fe\u4e2d\u865a\u7ebf\u4e3a\u8f74\u8fdb\u884c\u53cd\u5c04\uff0c\u5230\u7ea2\u70b9<\/li>\n\n\n\n<li>\u7136\u540e\uff0c\u8fdb\u884c\u62c9\u4f38\uff0c\u7b2c\u4e00\u4e2a\u5206\u91cf\u62c9\u4f383\u500d\uff0c\u5230\u7eff\u8272\u70b9<\/li>\n\n\n\n<li>\u6700\u540e\uff0c\u518d\u9006\u65f6\u9488\u65cb\u8f6c\\( 45^{\\circ} \\)  \u5230\u9ec4\u8272\u70b9<\/li>\n<\/ul>\n\n\n\n<p>\u5bf9\u5e94\u7684\u77e9\u9635\u8ba1\u7b97\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\\( \\text{red} = V^T \\alpha = \\begin{bmatrix} \\frac{1}{\\sqrt{2}} &amp; \\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}}\\end{bmatrix} \\begin{pmatrix} 1 \\\\ 0 \\end{pmatrix} = \\begin{pmatrix} \\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} \\end{pmatrix}  \\)<\/p>\n\n\n\n<p>\\( \\text{green} = \\Sigma V^T \\alpha = \\Sigma \\, \\text{red} = \\begin{bmatrix} 3 &amp; 0 \\\\ 0 &amp; 1 \\end{bmatrix} \\begin{pmatrix} \\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} \\end{pmatrix}  = \\begin{pmatrix} \\frac{3}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} \\end{pmatrix} \\)<\/p>\n\n\n\n<p>\\( \\text{yellow} = U\\Sigma V^T \\alpha =  U \\, \\text{green} = \\begin{bmatrix} \\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} &amp; \\frac{1}{\\sqrt{2}} \\end{bmatrix} \\begin{pmatrix} \\frac{3}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} \\end{pmatrix} = \\begin{pmatrix} 1 \\\\ 2 \\end{pmatrix} \\)<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:40%\">\n<div style=\"height:3em\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"976\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-10-1024x976.png\" alt=\"\" class=\"wp-image-19934\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-10-1024x976.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-10-300x286.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-10-768x732.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-10.png 1192w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">2.3 \u5206\u89e32\u7684\u51e0\u4f55\u610f\u4e49\u4e0e\u56fe\u793a<\/h4>\n\n\n<p>$$ A = \\begin{bmatrix}<br \/>\n1 &#038; 2 \\\\<br \/>\n2 &#038; 1<br \/>\n\\end{bmatrix} = U\u03a3V^T =\\begin{bmatrix}<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; \\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n3 &#038; 0 \\\\<br \/>\n0 &#038; 1<br \/>\n\\end{bmatrix}\\begin{bmatrix}<br \/>\n-\\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}} \\\\<br \/>\n \\frac{1}{\\sqrt{2}} &#038; -\\frac{1}{\\sqrt{2}}<br \/>\n\\end{bmatrix} $$<\/p>\n\n\n\n<p>\u8003\u8651\uff1a<\/p>\n\n\n\n<p>\\( V^T = \\begin{bmatrix}-\\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}} \\\\ \\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}} \\end{bmatrix} \\) \u5f62\u5f0f\u4e0e  \\( \\begin{bmatrix} \\cos \\varphi &amp; -\\sin\\varphi \\\\ \\sin\\varphi &amp; \\cos \\varphi \\end{bmatrix} \\)\u76f8\u540c\uff0c\u6545\uff0c\u6b64\u4e3a\u4e00\u4e2a\u9006\u65f6\u9488 \\( \\varphi = 135^{\\circ} \\) \u5ea6\u7684\u65cb\u8f6c<sup>[\u9644\u5f551]<\/sup>\u3002<\/p>\n\n\n\n<p>\\( \\Sigma = \\begin{bmatrix} 3 &amp; 0 \\\\ 0 &amp; 1 \\end{bmatrix} \\) \u8868\u793a\u5c06\u70b9\u3001\u5411\u91cf\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u3002<\/p>\n\n\n\n<p>\\( U = \\begin{bmatrix} -\\frac{1}{\\sqrt{2}} &amp; -\\frac{1}{\\sqrt{2}} \\\\ -\\frac{1}{\\sqrt{2}} &amp; \\frac{1}{\\sqrt{2}} \\end{bmatrix} \\) \u5f62\u5f0f\u4e0e \\( \\begin{bmatrix} \\cos \\varphi &amp; \\sin\\varphi \\\\ \\sin\\varphi &amp; -\\cos \\varphi \\end{bmatrix} \\) \u76f8\u540c\uff0c\u6545\uff0c\u6b64\u4e3a\u5173\u4e8e\u76f4\u7ebf \\( y = (\\tan\\frac{\\varphi}{2})x \\) \u7684\u53cd\u5c04<sup>[\u9644\u5f551]<\/sup>\u3002<\/p>\n\n\n\n<p>\u5373\uff0c\u4e0a\u8ff0\u7684\u7ebf\u6027\u53d8\u6362\u53ef\u4ee5\u505a\u8fd9\u6837\u7684\u7406\u89e3\uff1a<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<ul class=\"wp-block-list\">\n<li>\u70b9\\( (1,0) \\) \u5148\u9006\u65f6\u9488\u65cb\u8f6c\\( \\varphi = 135^{\\circ} \\)\u5230\u8fbe\u7ea2\u8272\u70b9<\/li>\n\n\n\n<li>\u7136\u540e\u5c06\u5750\u6807\u7b2c\u4e00\u4e2a\u5206\u91cf\u653e\u59273\u500d\uff0c\u6210\u4e3a\u7eff\u8272\u70b9<\/li>\n\n\n\n<li>\u6700\u540e\u5c06\u70b9\u4ee5\\( y=\\tan\\frac{-135^{\\circ}}{2}x \\)\u4e3a\u8f74\u8fdb\u884c\u53cd\u5c04\uff0c\u5230\u9ec4\u8272\u70b9<\/li>\n<\/ul>\n\n\n\n<p>\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u53f3\u56fe\uff0c\u8be6\u7ec6\u7684\u8ba1\u7b97\u8fd9\u91cc\u4e0d\u518d\u7ed9\u51fa\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11-1024x768.png\" alt=\"\" class=\"wp-image-19953\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11-1024x768.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11-300x225.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11-768x576.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11-1536x1152.png 1536w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-11.png 1698w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u7279\u5f81\u503c\u4e0e\u7279\u5f81\u5411\u91cf<\/h3>\n\n\n\n<p>\u56e0\u4e3a\u8fd9\u91cc\u7684\\( A \\)\u662f\u4e00\u4e2a \\( 2 \\times 2 \\) \u7684\u65b9\u9635\uff0c\u6545\u53ef\u4ee5\u4f7f\u7528\u7279\u5f81\u503c\u4e0e\u7279\u5f81\u5411\u91cf\u6765\u6d1e\u5bdf\u8fd9\u4e2a\u7ebf\u6027\u53d8\u6362\u7684\u672c\u8d28\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u8be5\u77e9\u9635\u7684\u7279\u5f81\u503c\u3001\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u8ba1\u7b97\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bf9\u4e8e\u7279\u5f81\u503c \\( \\lambda_1 = 3 \\) \u65f6\uff0c\u7279\u5f81\u5411\u91cf\u4e3a \\( (\\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}) \\)<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u7279\u5f81\u503c \\( \\lambda_2 = -1 \\) \u65f6\uff0c\u7279\u5f81\u5411\u91cf\u4e3a \\( (\\frac{1}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}) \\)<\/li>\n<\/ul>\n\n\n\n<p>\u4f9d\u65e7\uff0c\u8fd9\u91cc\u6211\u4eec\u6765\u8003\u8651\u5411\u91cf \\( \\alpha = \\begin{pmatrix} 1 \\\\ 0 \\end{pmatrix}  \\) \u5728\u8fd9\u4e24\u4e2a\u7279\u5f81\u5411\u91cf\u65b9\u5411\u4e0a\u4f5c\u7528\u540e\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>\u53f3\u56fe\u5df2\u7ecf\u6bd4\u8f83\u76f4\u89c2\u7684\u53cd\u5e94\u4e86\u5982\u4f55\u4ece\u7279\u5f81\u5411\u91cf\u548c\u7279\u5f81\u503c\u7684\u89d2\u5ea6\u53bb\u7406\u89e3\u7ebf\u6027\u53d8\u6362\uff1a<\/p>\n\n\n\n<ul style=\"line-height:2.5\" class=\"wp-block-list\">\n<li>\u9996\u5148\uff0c\u5148\u5c06\u5411\u91cf \\( \\alpha \\) \u5728\u4e24\u4e2a\u7279\u5f81\u5411\u91cf\u4e0a\u8fdb\u884c\u5206\u89e3\uff0c\u5206\u89e3\u540e\u7684\u5411\u91cf\u5206\u522b\u4e3a \\( \\alpha_1 \\, \\alpha_2 \\) <\/li>\n\n\n\n<li>\u7136\u540e\u518d\u6309\u7167\u7279\u5f81\u503c\u8fdb\u884c\u7f29\u653e\uff1a\n<ul class=\"wp-block-list\">\n<li>\\( \\lambda_1 = 3 \\) \u6545\u5c06 \\( \\alpha_1\\)\u62c9\u4f38\u4e3a \\( \\beta_1 \\)<\/li>\n\n\n\n<li>\\( \\lambda_2 = -1 \\) \u6545\u5c06 \\( \\alpha_2\\)\u53cd\u5411\u4e3a \\( \\beta_2 \\)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u6700\u540e\uff0c\\( \\beta_1 \\) \u548c \\( \\beta_2 \\) \u5408\u5e76\u4e3a \\( \\beta \\)<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1015\" src=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14-1024x1015.png\" alt=\"\" class=\"wp-image-19959\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14-1024x1015.png 1024w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14-300x297.png 300w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14-150x150.png 150w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14-768x761.png 768w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2025\/09\/image-14.png 1082w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u5c0f\u7ed3<\/h3>\n\n\n\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff08\u6ce8\uff1a\u7ebf\u6027\u53d8\u6362\u77e9\u9635\u4e3a\u4e00\u4e2a \\( 2 \\times 2 \\)\u7684\u6ee1\u79e9\u77e9\u9635\uff09\uff0c \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5947\u5f02\u503c\u5206\u89e3\\( \\text{SVD} \\)\u3001\u7279\u5f81\u503c\u8ba1\u7b97\u7684\u65b9\u5f0f\u6765\u6d1e\u5bdf\u8fd9\u4e2a\u7ebf\u6027\u53d8\u6362\u7684\u201c\u672c\u8d28\u201d\u3002\u4e24\u79cd\u65b9\u6cd5\u5404\u6709\u4e00\u4e9b\u4f18\u7f3a\u70b9\uff0c\u5927\u5bb6\u53ef\u4ee5\u81ea\u5df1\u53bb\u4f53\u4f1a\uff0c\u8fd9\u91cc\u5c0f\u7ed3\u4e00\u4e0b\u6211\u7684\u7406\u89e3\u3002<\/p>\n\n\n\n<p>\u5947\u5f02\u503c\u5206\u89e3\\( \\text{SVD} \\)\u662f\u4e00\u79cd\u201c\u52a8\u6001\u201d\u7684\u5c55\u793a\u7ebf\u6027\u53d8\u6362\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4f60\u5f88\u6e05\u6670\u7684\u4e86\u89e3\u8fd9\u4e2a\u7ebf\u6027\u53d8\u6362\u662f\u5982\u4f55\u5c06\u7a7a\u95f4\u4e2d\u7684\u201c\u4e00\u4e2a\u70b9\u201d\u6620\u5c04\u5230\u201c\u53e6\u4e00\u4e2a\u70b9\u201d\u7684\u3002\u4f8b\u5982\u5728\u4e0a\u8ff0\u7684\u4f8b\u5b50\u4e2d\uff0c\u5219\u662f\u5148\u8fdb\u884c\u65cb\u8f6c\u3001\u7136\u540e\u8fdb\u884c\u7f29\u653e\u3001\u6700\u540e\u8fdb\u884c\u53cd\u5c04\u3002<\/p>\n\n\n\n<p>\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u8ba1\u7b97\u5219\u662f\u5bf9\u7ebf\u6027\u53d8\u6362\u7684\u201c\u9759\u6001\u201d\u89e3\u91ca\uff0c\u4f7f\u7528\u9759\u6001\u7684\u65b9\u5f0f\u5c55\u73b0\u4e86\u7ebf\u6027\u53d8\u6362\u5982\u4f55\u5c06\u201c\u4e00\u4e2a\u70b9\u201d\u6620\u5c04\u5230\u201c\u53e6\u4e00\u4e2a\u70b9\u201d\u7684\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u8865\u5145\u8bf4\u660e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5947\u5f02\u503c\u5206\u89e3\u901a\u5e38\u662f\u7528\u4e8e\u5904\u7406\u66f4\u9ad8\u7ef4\u7684\u5411\u91cf\u7a7a\u95f4\uff0c\u6240\u4ee5\u901a\u5e38\u6ca1\u6709\u8fd9\u4e48\u76f4\u89c2\u7684\u51e0\u4f55\u610f\u4e49\uff0c\u4f46\u662f\u4f9d\u65e7\u53ef\u4ee5\u4f7f\u7528\u7c7b\u6bd4\u7684\u201c\u53cd\u5c04\u201d\u3001\u201c\u65cb\u8f6c\u201d\u3001\u201c\u62c9\u4f38\/\u538b\u7f29\u201d\u7b49\u6982\u5ff5\u53bb\u6269\u5c55\u7684\u7406\u89e3\u3002<\/li>\n\n\n\n<li>\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u4ec5\u9002\u7528\u4e8e\u5904\u7406\u65b9\u9635\u7684\u573a\u666f\uff0c\u6240\u4ee5\u573a\u666f\u6bd4\u8f83\u53d7\u9650\u3002<\/li>\n\n\n\n<li>\u5173\u4e8e\u7279\u7279\u5f81\u503c\/\u7279\u5f81\u5411\u91cf\u8ba1\u7b97\uff0c\u5728\u5b9e\u9645\u4e2d\u53ef\u80fd\u4f1a\u66f4\u52a0\u590d\u6742\uff0c\u4f8b\u5982\uff0c\u91cd\u6839\u3001\u590d\u6570\u6839\u7b49\u60c5\u51b5\uff0c\u8981\u60f3\u8fdb\u4e00\u6b65\u7406\u89e3\uff0c\u5219\u9700\u8981\u505a\u66f4\u6df1\u5165\u7684\u7814\u7a76\u3002<\/li>\n\n\n\n<li>\u8981\u8fdb\u4e00\u6b65\u52a0\u6df1\u7406\u89e3\uff0c\u5219\u53ef\u4ee5\u8003\u8651\uff0c\u89c2\u5bdf\u4e00\u4e2a\u4e09\u7ef4\u7a7a\u95f4\u4e2d\u53d8\u6362\u7684\u5b9e\u4f8b\uff0c\u6709\u4e00\u4e9b\u76f8\u540c\uff0c\u4e5f\u6709\u4e00\u4e9b\u4e0d\u540c\uff1a\n<ul class=\"wp-block-list\">\n<li>\u53cd\u5c04\uff0c\u901a\u5e38\u662f\u57fa\u4e8e\u67d0\u4e2a\u5e73\u9762\uff08\u4e24\u4e2a\u57fa\u5f20\u6210\u7684\u5e73\u9762\uff09\u7684<\/li>\n\n\n\n<li>\u9009\u62e9\uff0c\u5219\u662f\u7ed5\u7740\u67d0\u4e2a\u76f4\u7ebf\uff08\u67d0\u4e2a\u5411\u91cf\u7684\u65b9\u5411\u4e0a\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u9644\u5f551 \u4e8c\u7ef4\u7a7a\u95f4\u7684\u6b63\u4ea4\u53d8\u6362<\/h3>\n\n\n\n<p>\u4e8c\u7ef4\u7a7a\u95f4\u4e2d\uff0c\u6709\u4e24\u79cd\u6b63\u4ea4\u53d8\u6362\uff0c\u5373\u65cb\u8f6c\u6216\u53cd\u5c04\u3002\u5176\u5bf9\u5e94\u7684\u7ebf\u6027\u53d8\u6362\u77e9\u9635\u5206\u522b\u6709\u5982\u4e0b\u7684\u5f62\u5f0f\uff1a\\( \\begin{bmatrix} \\cos \\varphi &amp; \\sin\\varphi \\\\ \\sin\\varphi &amp; -\\cos \\varphi \\end{bmatrix} \\) \u4e0e \\( \\begin{bmatrix} \\cos \\varphi &amp; -\\sin\\varphi \\\\ \\sin\\varphi &amp; \\cos \\varphi \\end{bmatrix} \\) \u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9644\u5f552 \u4e09\u7ef4\u7a7a\u95f4\u7684\u6b63\u4ea4\u53d8\u6362<\/h3>\n\n\n\n<p>\u5728\u4e09\u7ef4\u7a7a\u95f4\u5185\uff0c\u5bf9\u4e8e\u4e00\u7ec4\u89c4\u8303\u6b63\u4ea4\u57fa \\(  \\{ \\alpha_1,\\alpha_2,\\alpha_3 \\} \\) \uff0c\u8be5\u7a7a\u95f4\u4e0b\u7684\u6b63\u4ea4\u53d8\u6362\u77e9\u9635\u603b\u6709\u5982\u4e0b\u5f62\u5f0f\uff1a<\/p>\n\n\n<p>$$<br \/>\n\\begin{bmatrix}<br \/>\n\\pm 1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; a &#038; b \\\\<br \/>\n0 &#038; c &#038; c<br \/>\n\\end{bmatrix}<br \/>\n$$<\/p>\n\n\n\n<p>\u66f4\u4e3a\u5177\u4f53\u7684\u4e3a\u5982\u4e0b\u4e09\u79cd\u5f62\u6001\u4e4b\u4e00\uff1a<\/p>\n\n\n<p>$$<br \/>\nA = \\begin{bmatrix}<br \/>\n1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; \\cos\\varphi &#038; -\\sin\\varphi \\\\<br \/>\n0 &#038; \\sin\\varphi &#038; \\cos\\varphi<br \/>\n\\end{bmatrix}<br \/>\n\\quad<br \/>\nB = \\begin{bmatrix}<br \/>\n-1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; 1 &#038; 0 \\\\<br \/>\n0 &#038; 0 &#038; 1<br \/>\n\\end{bmatrix}<br \/>\n\\\\<br \/>\n\\begin{aligned}<br \/>\nC &#038; = \\begin{bmatrix}<br \/>\n-1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; \\cos\\varphi &#038; -\\sin\\varphi \\\\<br \/>\n0 &#038; \\sin\\varphi &#038; \\cos\\varphi<br \/>\n\\end{bmatrix} \\\\<br \/>\n&#038; =<br \/>\n\\begin{bmatrix}<br \/>\n1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; \\cos\\varphi &#038; -\\sin\\varphi \\\\<br \/>\n0 &#038; \\sin\\varphi &#038; \\cos\\varphi<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n-1 &#038; 0 &#038; 0 \\\\<br \/>\n0 &#038; 1 &#038; 0 \\\\<br \/>\n0 &#038; 0 &#038; 1<br \/>\n\\end{bmatrix}<br \/>\n\\end{aligned}<br \/>\n$$<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7684\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53d8\u6362 \\( A \\) \u4e3a\u4e00\u4e2a\u65cb\u8f6c\uff0c\u65cb\u8f6c\u8f74\u4e3a \\( \\alpha_1 \\) \u6240\u5728\u7684\u76f4\u7ebf<\/li>\n\n\n\n<li>\u53d8\u6362 \\( B \\) \u662f\u4e00\u4e2a\u53cd\u5c04\uff0c\u53cd\u5c04\u8f74\u5e73\u9762\u4e3a \\( \\mathscr{L}(\\alpha_2,\\alpha_3)  \\)<\/li>\n\n\n\n<li>\u53d8\u6362 \\( C \\) \u662f\u4e0a\u8ff0\u4e24\u4e2a\u53d8\u6362\u7684\u7ec4\u5408<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Attention \u673a\u5236\uff08\u6216 Multi-Head Attention \uff09\u4e2d\u6211\u4eec\u4f1a\u770b\u5230\u5404\u79cd\u5bf9\u5411\u91cf\u7a7a\u95f4\u7684\u53d8\u6362\u64cd\u4f5c\uff0c\u90a3\u4e48\u5982\u4f55\u7406\u89e3\u8fd9\u4e9b\u7ebf\u6027\u53d8\u6362\u5462\uff1f\u7ebf\u6027\u53d8\u6362\u7684\u672c\u8d28\u662f\u4ec0\u4e48\uff1f<\/p>\n","protected":false},"author":1,"featured_media":22164,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-a-1440-px-width-template","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[4,137],"tags":[],"class_list":["post-19888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-detail","category-learning-more"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/19888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=19888"}],"version-history":[{"count":125,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/19888\/revisions"}],"predecessor-version":[{"id":22167,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/19888\/revisions\/22167"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media\/22164"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=19888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=19888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=19888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}