{"id":2705,"date":"2026-09-05T23:27:37","date_gmt":"2026-09-05T15:27:37","guid":{"rendered":"http:\/\/blog.xtaa.cn\/?p=2705"},"modified":"2026-09-06T10:37:56","modified_gmt":"2026-09-06T02:37:56","slug":"%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%9f%ba%e7%a1%80%e6%a6%82%e5%bf%b5","status":"publish","type":"post","link":"http:\/\/blog.xtaa.cn\/index.php\/2026\/09\/05\/%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%9f%ba%e7%a1%80%e6%a6%82%e5%bf%b5\/","title":{"rendered":"\u5927\u6a21\u578b\u57fa\u7840\u6982\u5ff5"},"content":{"rendered":"\n<p>\u53ef\u4ee5\u628a\u6574\u4e2a\u5927\u6a21\u578b\u8bad\u7ec3\u60f3\u8c61\u6210<mark>\u200c<strong>\u201c\u4ece\u96f6\u5f00\u59cb\u57f9\u517b\u4e00\u4e2a\u901a\u624d\u5b66\u751f\uff0c\u518d\u628a\u4ed6\u5b9a\u5411\u57f9\u517b\u6210\u542c\u8bdd\u7684\u4e13\u4e1a\u4eba\u624d\u201d<\/strong>\u200c<mark>\u3002\u6574\u4e2a\u8fc7\u7a0b\u4e3b\u8981\u5206\u4e09\u5927\u6b65\uff1a<\/mark>\u200c<strong>\u9884\u8bad\u7ec3\uff08\u5b66\u8bed\u8a00\uff09\u2192 \u5fae\u8c03\uff08\u5b66\u505a\u4e8b\uff09\u2192 \u5bf9\u9f50\uff08\u5b66\u89c4\u77e9\uff09<\/strong>\u200c<\/mark>\u3002<br><br><strong>\u6838\u5fc3\u673a\u5236<\/strong>\u200c\uff1a\u5927\u6a21\u578b\uff08\u672c\u8d28\u662f\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\uff09\u7684\u5de5\u4f5c\u65b9\u5f0f\uff0c\u4e0d\u662f\u771f\u6b63\u201c\u7406\u89e3\u201d\u6587\u5b57\uff0c\u800c\u662f\u200c<strong>\u6839\u636e\u4e0a\u4e0b\u6587\u9884\u6d4b\u4e0b\u4e00\u4e2a\u8bcd\u7684\u6982\u7387<\/strong>\u200c\u3002\u6bd4\u5982\u770b\u5230\u201c\u6211\u6b63\u5728\u70f9\u996a\u201d\uff0c\u5b83\u9884\u6d4b\u4e0b\u4e00\u4e2a\u8bcd\u6700\u53ef\u80fd\u662f\u201c\u98df\u7269\u201d\u800c\u975e\u201c\u98de\u673a\u201d\u3002<\/p>\n\n\n\n<p>\u200c<strong>\u6570\u5b57\u89c6\u89d2<\/strong>\u200c\uff1a\u6240\u6709\u6587\u5b57\u5148\u88ab\u5207\u6210\u5c0f\u788e\u7247\uff08\u53ebToken\uff09\uff0c\u6bcf\u4e2a\u788e\u7247\u53d8\u6210\u4e00\u4e2a\u6570\u5b57\u7f16\u53f7\u3002\u6a21\u578b\u5185\u90e8\u6709\u200c<strong>\u6d77\u91cf\u53c2\u6570<\/strong>\u200c\uff08\u53ef\u4ee5\u7406\u89e3\u4e3a\u65e0\u6570\u4e2a<strong>\u65cb\u94ae<\/strong>\uff09\uff0c\u901a\u8fc7\u8c03\u6574\u8fd9\u4e9b\u65cb\u94ae\uff0c\u8ba9\u9884\u6d4b\u8d8a\u6765\u8d8a\u51c6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e09\u5927\u8bad\u7ec3\u9636\u6bb5\uff1a\u4ece\u201c\u901a\u624d\u201d\u5230\u201c\u4e13\u5bb6\u201d\u518d\u5230\u201c\u4e56\u5b69\u5b50\u201d<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e00\u9636\u6bb5\uff1a\u9884\u8bad\u7ec3\u2014\u2014\u75af\u72c2\u201c\u5237\u9898\u201d\u6253\u57fa\u7840<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>\u505a\u4ec0\u4e48<\/strong>\u200c\uff1a\u5582\u7ed9\u6a21\u578b\u6d77\u91cf\u6587\u672c\uff08\u51e0\u4e4e\u6574\u4e2a\u4e92\u8054\u7f51\u7684\u516c\u5f00\u5185\u5bb9\uff09\uff0c\u8ba9\u5b83\u4e0d\u65ad\u505a\u201c\u586b\u7a7a\/\u7eed\u5199\u201d\u9898\uff0c\u5373\u6839\u636e\u524d\u6587\u9884\u6d4b\u4e0b\u4e00\u4e2a\u8bcd\u3002\u8fd9\u4e2a\u9636\u6bb5\u6781\u5176\u70e7\u94b1\uff0c\u4e07\u4ebf\u53c2\u6570\u7ea7\u522b\u7684\u6a21\u578b\u786c\u4ef6\u6210\u672c\u5c31\u8981\u200c<strong>5\u4ebf\u523020\u4ebf\u7f8e\u5143<\/strong>\u200c\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u4ea7\u51fa<\/strong>\u200c\uff1a\u4e00\u4e2a\u201c\u901a\u624d\u201d\u57fa\u7840\u6a21\u578b\u3002\u5b83\u8bed\u8a00\u6d41\u7545\u3001\u77e5\u8bc6\u4e30\u5bcc\uff0c\u4f46\u200c<strong>\u4e0d\u542c\u8bdd<\/strong>\u200c\u2014\u2014\u4f60\u95ee\u5b83\u95ee\u9898\uff0c\u5b83\u53ef\u80fd\u50cf\u590d\u8bfb\u673a\u4e00\u6837\u7ed9\u4f60\u7eed\u5199\u4e00\u6bb5\uff0c\u800c\u4e0d\u662f\u56de\u7b54\u95ee\u9898\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u9884\u8bad\u7ec3\u540e\u9762\u7684\u6b65\u9aa4\u90fd\u53ef\u4ee5\u53eb\u540e\u8bad\u7ec3<\/strong>\uff0c\u5305\u542b\u76d1\u7763\u5fae\u8c03\u3001\u5956\u52b1\u5efa\u6a21\u3001\u5f3a\u5316\u5b66\u4e60\u7b49\u5b50\u73af\u8282\uff0c\u8fd8\u53ef\u4ee5\u6309\u5fae\u8c03\uff0c\u5bf9\u9f50\u6765\u5206\u3002<strong>RLHF<\/strong>&nbsp;\u7684\u5168\u79f0\u662f&nbsp;<strong>Reinforcement Learning from Human Feedback\uff08\u57fa\u4e8e\u4eba\u7c7b\u53cd\u9988\u7684\u5f3a\u5316\u5b66\u4e60\uff09<\/strong>\u662f\u4e00\u5957\u5b8c\u6574\u7684\u5bf9\u9f50\u6846\u67b6\uff0c\u5b83\u521a\u597d\u8986\u76d6\u4e86\u201c\u5956\u52b1\u5efa\u6a21+\u5f3a\u5316\u5b66\u4e60\u201d\u8fd9\u4e24\u4e2a\u5b50\u73af\u8282\uff1b\u800cDPO\u662f\u8f7b\u91cf\u5316\u7684\u5bf9\u9f50\u7b97\u6cd5\uff0c\u5b83\u8df3\u8fc7\u4e86\u5355\u72ec\u8bad\u7ec3\u5956\u52b1\u6a21\u578b\u7684\u6b65\u9aa4\uff0c\u76f4\u63a5\u7528\u504f\u597d\u6570\u636e\u901a\u8fc7\u635f\u5931\u51fd\u6570\u5b8c\u6210\u5bf9\u9f50\u4f18\u5316\uff0c\u4e0d\u9700\u8981\u663e\u5f0f\u7684\u5f3a\u5316\u5b66\u4e60\u6d41\u7a0b\u3002\u7b80\u5355\u6765\u8bf4\uff1a\u5f3a\u5316\u5b66\u4e60\u662f\u5b9e\u73b0\u5bf9\u9f50\u7684\u6838\u5fc3\u6280\u672f\u624b\u6bb5\u4e4b\u4e00\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e8c\u9636\u6bb5\uff1a\u5fae\u8c03\u2014\u2014\u6559\u5b83\u201c\u542c\u61c2\u6307\u4ee4\u201d<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>\u505a\u4ec0\u4e48<\/strong>\u200c\uff1a\u7528\u5927\u91cf\u201c\u95ee\u9898-\u6807\u51c6\u7b54\u6848\u201d\u7684\u914d\u5bf9\u6570\u636e\uff08\u6bd4\u5982\u201c\u628a\u8fd9\u6bb5\u8bdd\u603b\u7ed3\u4e00\u4e0b\u2192\u603b\u7ed3\u597d\u7684\u6587\u5b57\u201d\uff09\uff0c\u7ee7\u7eed\u8bad\u7ec3\u6a21\u578b\uff0c\u8ba9\u5b83\u5b66\u4f1a\u200c<strong>\u9075\u5faa\u6307\u4ee4\u3001\u5b8c\u6210\u4efb\u52a1\u3001\u591a\u8f6e\u5bf9\u8bdd<\/strong>\u200c\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u6570\u5b57\/\u751f\u6d3b\u89c6\u89d2<\/strong>\u200c\uff1a\u76f8\u5f53\u4e8e\u7ed9\u901a\u624d\u5b66\u751f\u505a\u201c\u4e13\u9879\u57f9\u8bad\u201d\u3002\u5168\u53c2\u6570\u5fae\u8c03\u6548\u679c\u6700\u597d\u4f46\u6700\u8d35\uff1b\u73b0\u5728\u6700\u5e38\u7528LoRA\uff08\u4f4e\u79e9\u9002\u914d\uff09\uff0c\u53ea\u8bad\u7ec3\u5c11\u91cf\u65b0\u589e\u53c2\u6570\uff0c\u663e\u5b58\u5360\u7528\u964d\u4f4e80%\uff0c\u6548\u679c\u63a5\u8fd1\u5168\u91cf\u5fae\u8c03\uff0c\u662f\u4e2d\u5c0f\u56e2\u961f\u548c\u4f01\u4e1a\u7684\u9996\u9009\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e09\u9636\u6bb5\uff1a\u5bf9\u9f50\u2014\u2014\u6559\u5b83\u201c\u5b88\u89c4\u77e9\u201d<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>\u4e3a\u4ec0\u4e48\u9700\u8981<\/strong>\u200c\uff1a\u6a21\u578b\u53ef\u80fd\u201c\u81ea\u4fe1\u5730\u80e1\u8bf4\u201d\uff08\u5e7b\u89c9\uff09\uff0c\u6216\u8f93\u51fa\u6709\u5bb3\u5185\u5bb9\u3002\u5bf9\u9f50\u5c31\u662f\u5851\u9020\u6a21\u578b\u7684\u201c\u4ef7\u503c\u89c2\u201d\uff0c\u8ba9\u5b83\u66f4\u6709\u7528\u3001\u66f4\u8bda\u5b9e\u3001\u66f4\u65e0\u5bb3\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u4e3b\u6d41\u65b9\u6cd5<\/strong>\u200c\uff1a\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>RLHF\uff08\u4eba\u7c7b\u53cd\u9988\u5f3a\u5316\u5b66\u4e60\uff09<\/strong>\u200c\uff1a\u8fd9\u662f\u7ecf\u5178\u8def\u7ebf\u3002\u5148\u8ba9\u6a21\u578b\u751f\u6210\u591a\u4e2a\u7b54\u6848\uff0c\u7531\u4eba\u7c7b\u6807\u6ce8\u5458\u5bf9\u7b54\u6848\u597d\u574f\u6392\u5e8f\uff0c\u636e\u6b64\u8bad\u7ec3\u4e00\u4e2a\u201c\u5956\u52b1\u6a21\u578b\u201d\u6765\u7ed9\u7b54\u6848\u6253\u5206\uff0c\u6700\u540e\u7528PPO\uff08\u8fd1\u7aef\u7b56\u7565\u4f18\u5316\uff09\u7b97\u6cd5\u8c03\u6574\u6a21\u578b\uff0c\u8ba9\u5b83\u503e\u5411\u8f93\u51fa\u9ad8\u5206\u7684\u7b54\u6848\u3002<\/li>\n\n\n\n<li>\u200c<strong>DPO\uff08\u76f4\u63a5\u504f\u597d\u4f18\u5316\uff09<\/strong>\u200c\uff1a\u66f4\u7b80\u5355\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u4e0d\u9700\u8981\u8bad\u7ec3\u5956\u52b1\u6a21\u578b\uff0c\u76f4\u63a5\u7528\u201c\u597d\u56de\u7b54 vs \u5dee\u56de\u7b54\u201d\u7684\u6570\u636e\u5bf9\u8bad\u7ec3\u6a21\u578b\uff0c\u6210\u672c\u4f4e\u3001\u4e0a\u624b\u5feb\uff0c\u4e2d\u5c0f\u56e2\u961f\u5e38\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u4e00\u4e9b\u6982\u5ff5\uff1a<\/strong><\/p>\n\n\n\n<p><br><strong>\u635f\u5931\u51fd\u6570<\/strong>\uff1a\u6a21\u578b\u8fdb\u6b65\u7684\u201c\u8001\u5e08\u201d\u548c\u201c\u5bfc\u822a\u201d<br>\u635f\u5931\u503c\u662f\u4e2a\u6570\u5b57\uff0c\u6bd4\u59820.5\u6216100\u3002\u8bad\u7ec3\u7684\u76ee\u6807\u5c31\u662f\u8ba9\u8fd9\u4e2a\u6570\u5b57\u200c<strong>\u8d8a\u6765\u8d8a\u5c0f<\/strong>\u200c\uff0c\u76f4\u5230\u63a5\u8fd10\u3002\u6a21\u578b\u901a\u8fc7\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\uff0c\u6cbf\u7740\u201c\u635f\u5931\u53d8\u5c0f\u201d\u7684\u65b9\u5411\u4e00\u6b65\u6b65\u8c03\u6574\u53c2\u6570\u3002<\/p>\n\n\n\n<p>\u200c\u5e38\u89c1\u7c7b\u578b\u200c\uff1a<\/p>\n\n\n\n<p>\u200c\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u200c\uff1a\u7528\u4e8e\u9884\u6d4b\u8fde\u7eed\u6570\u503c\uff08\u5982\u623f\u4ef7\uff09\u3002\u5b83\u628a\u8bef\u5dee\u5e73\u65b9\uff0c\u200c<strong>\u5927\u9519\u8bef\u4f1a\u88ab\u653e\u5927\u5730\u60e9\u7f5a<\/strong>\u200c\u3002<\/p>\n\n\n\n<p>\u200c\u4ea4\u53c9\u71b5\uff08Cross-Entropy\uff09\u200c\uff1a\u7528\u4e8e\u5206\u7c7b\u95ee\u9898\uff08\u5982\u8bc6\u522b\u732b\u72d7\uff09\u3002\u5b83\u4e0d\u4ec5\u60e9\u7f5a\u201c\u7b54\u9519\u201d\uff0c\u8fd8\u60e9\u7f5a\u201c\u200c<strong>\u7b54\u5bf9\u4f46\u4e0d\u591f\u81ea\u4fe1<\/strong>\u200c\u201d\u2014\u2014\u6a21\u578b\u7ed9\u51fa0.51\u6982\u7387\u5224\u65ad\u6b63\u786e\uff0c\u548c\u7ed9\u51fa0.99\u6982\u7387\u5224\u65ad\u6b63\u786e\uff0c\u635f\u5931\u4e0d\u4e00\u6837\uff0c\u8feb\u4f7f\u6a21\u578b\u7ed9\u51fa\u53c8\u6b63\u786e\u53c8\u6709\u628a\u63e1\u7684\u7b54\u6848\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u5f3a\u5316\u5b66\u4e60\uff1a<\/strong>\u5c31\u50cf\u73a9\u6e38\u620f\u3002\u4f60\u91c7\u53d6\u4e00\u4e2a\u7b56\u7565\uff0c\u5f97\u5206\u9ad8\u5c31\u5f3a\u5316\u8fd9\u4e2a\u7b56\u7565\uff0c\u5f97\u5206\u4f4e\u5c31\u8c03\u6574\u3002\u5b83\u200c<strong>\u4e0d\u9700\u8981\u5927\u91cf\u6807\u6ce8\u597d\u7684\u201c\u6807\u51c6\u7b54\u6848\u201d<\/strong>\u200c\uff0c\u800c\u662f\u901a\u8fc7\u81ea\u5df1\u4e0d\u65ad\u5c1d\u8bd5\u548c\u53cd\u9988\uff08\u5956\u52b1\u4fe1\u53f7\uff09\u6765\u8fdb\u6b65\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\u5168\u8fc7\u7a0b<\/strong>\u200c\uff1a\u200c<strong>\u9884\u8bad\u7ec3\u8ba9\u6a21\u578b\u201c\u4f1a\u8bf4\u8bdd\u201d\uff0c\u5fae\u8c03\u8ba9\u6a21\u578b\u201c\u4f1a\u529e\u4e8b\u201d\uff0c\u5bf9\u9f50\u8ba9\u6a21\u578b\u201c\u5b88\u89c4\u77e9\u201d\uff0c\u635f\u5931\u51fd\u6570\u662f\u5168\u7a0b\u7684\u201c\u8001\u5e08\u201d\uff0c\u5f3a\u5316\u5b66\u4e60\u5219\u662f\u201c\u81ea\u6211\u8fdb\u5316\u201d\u7684\u9ad8\u7ea7\u624b\u6bb5<\/strong>\u200c\u3002\u6574\u4e2a\u8bad\u7ec3\u5c31\u662f\u201c\u9884\u6d4b-\u7b97\u635f\u5931-\u8c03\u53c2\u6570\u201d\u7684\u5faa\u73af\uff0c\u76f4\u5230\u635f\u5931\u8db3\u591f\u5c0f\uff0c\u6a21\u578b\u5c31\u201c\u6bd5\u4e1a\u201d\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6cdb\u5316\u80fd\u529b<\/strong>\u200c\uff1a\u662f\u5927\u6a21\u578b\u6700\u6838\u5fc3\u7684\u5e95\u5c42\u80fd\u529b\uff0c\u6307\u6a21\u578b\u628a\u8bad\u7ec3\u6570\u636e\u4e2d\u5b66\u5230\u7684\u901a\u7528\u89c4\u5f8b\uff0c\u8fc1\u79fb\u5230\u4ece\u672a\u89c1\u8fc7\u7684\u672a\u77e5\u65b0\u6570\u636e\u4e0a\u7684\u80fd\u529b\uff0c\u672c\u8d28\u662f\u6a21\u578b\u5bf9\u6570\u636e\u5206\u5e03\u7684\u5916\u63a8\u80fd\u529b\uff0c\u800c\u975e\u5355\u7eaf\u8bb0\u5fc6\u8bad\u7ec3\u6837\u672c\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u8fc7\u62df\u5408<\/strong>\u200c\uff1a\u662f\u6cdb\u5316\u80fd\u529b\u7684\u53cd\u9762\u5178\u578b\uff0c\u6307\u6a21\u578b\u8fc7\u5ea6\u5b66\u4e60\u4e86\u8bad\u7ec3\u96c6\u91cc\u7684\u566a\u58f0\u3001\u5c40\u90e8\u7279\u4f8b\uff0c\u628a\u8fd9\u4e9b\u5076\u7136\u7279\u5f81\u5f53\u6210\u4e86\u666e\u904d\u89c4\u5f8b\uff0c\u6700\u7ec8\u8868\u73b0\u4e3a\u8bad\u7ec3\u96c6\u4e0a\u8bef\u5dee\u6781\u4f4e\u3001\u5f97\u5206\u865a\u9ad8\uff0c\u4f46\u5728\u6d4b\u8bd5\u96c6\u548c\u771f\u5b9e\u573a\u666f\u4e2d\u6027\u80fd\u65ad\u5d16\u5f0f\u4e0b\u8dcc\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u8fc1\u79fb\u5b66\u4e60<\/strong>\u200c\uff1a\u662f\u63d0\u5347\u6cdb\u5316\u80fd\u529b\u7684\u6838\u5fc3\u5de5\u7a0b\u624b\u6bb5\uff0c\u5b83\u901a\u8fc7\u201c\u77e5\u8bc6\u8fc1\u79fb\u201d\u673a\u5236\uff0c\u628a\u6e90\u57df\uff08\u6bd4\u5982\u5927\u89c4\u6a21\u901a\u7528\u8bed\u6599\u9884\u8bad\u7ec3\u7684\u6a21\u578b\uff09\u5b66\u5230\u7684\u901a\u7528\u7279\u5f81\uff0c\u8fc1\u79fb\u5230\u76ee\u6807\u57df\uff08\u6bd4\u5982\u533b\u7597\u3001\u65b9\u8a00\u8fd9\u7c7b\u5c0f\u4f17\u5782\u76f4\u573a\u666f\uff09\uff0c\u7528\u6781\u5c11\u7684\u76ee\u6807\u57df\u6570\u636e\u5c31\u80fd\u5feb\u901f\u9002\u914d\u65b0\u4efb\u52a1\u3002\u5728\u533b\u7597\u95ee\u8bca\u3001\u5de5\u4e1a\u63a7\u5236\u8fd9\u7c7b\u6807\u6ce8\u6570\u636e\u7a00\u7f3a\u7684\u573a\u666f\uff0c\u57fa\u4e8e\u901a\u7528\u5927\u6a21\u578b\u505aLoRA\u5fae\u8c03\uff0c\u5c31\u662f\u5178\u578b\u7684\u8fc1\u79fb\u5b66\u4e60\u5e94\u7528\u3002\u5b83\u65e2\u4e0d\u4f1a\u8ba9\u6a21\u578b\u9057\u5fd8\u9884\u8bad\u7ec3\u9636\u6bb5\u5b66\u5230\u7684\u901a\u7528\u77e5\u8bc6\uff0c\u53c8\u80fd\u5feb\u901f\u9002\u914d\u5782\u76f4\u573a\u666f\u7684\u4e13\u4e1a\u672f\u8bed\uff0c\u907f\u514d\u5c0f\u6570\u636e\u96c6\u5168\u91cf\u5fae\u8c03\u5e26\u6765\u7684\u4e25\u91cd\u8fc7\u62df\u5408\uff0c\u6700\u7ec8\u8ba9\u6a21\u578b\u5728\u771f\u5b9e\u4e1a\u52a1\u573a\u666f\u4e0b\u4fdd\u6301\u7a33\u5b9a\u7684\u6cdb\u5316\u6027\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u8054\u90a6\u5b66\u4e60<\/strong>\uff1a\u4e0d\u662f\u628a\u6570\u636e\u6c47\u603b\u5230\u4e00\u8d77\u8bad\u7ec3\uff0c\u800c\u662f\u201c\u200c<strong>\u6570\u636e\u4e0d\u52a8\uff0c\u6a21\u578b\u52a8<\/strong>\u200c\u201d\uff1a\u628a\u521d\u59cb\u6a21\u578b\u4e0b\u53d1\u7ed9\u5404\u53c2\u4e0e\u65b9\uff0c\u5404\u65b9\u7528\u672c\u5730\u6570\u636e\u8bad\u7ec3\uff0c\u53ea\u4e0a\u4f20\u6a21\u578b\u53c2\u6570\u6216\u68af\u5ea6\uff0c\u7531\u4e2d\u592e\u670d\u52a1\u5668\u805a\u5408\u540e\u66f4\u65b0\u5168\u5c40\u6a21\u578b\uff0c\u518d\u4e0b\u53d1\u8fdb\u884c\u4e0b\u4e00\u8f6e\u8fed\u4ee3\u3002\u200c\u200c<strong>\u6838\u5fc3\u4ef7\u503c<\/strong>\u200c\uff1a\u65e2\u6253\u7834\u4e86\u201c\u6570\u636e\u5b64\u5c9b\u201d\uff0c\u8ba9\u591a\u65b9\u534f\u4f5c\u63d0\u5347\u6a21\u578b\u6548\u679c\uff0c\u53c8\u56e0\u4e3a\u539f\u59cb\u6570\u636e\u4e0d\u51fa\u672c\u5730\uff0c\u4ece\u6839\u6e90\u4e0a\u89c4\u907f\u4e86\u9690\u79c1\u6cc4\u9732\u98ce\u9669\uff0c\u7b26\u5408\u300a\u4e2a\u4eba\u4fe1\u606f\u4fdd\u62a4\u6cd5\u300b\u7b49\u5408\u89c4\u8981\u6c42\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>KV Cache<\/strong>  <br>Transformer \u6a21\u578b\u751f\u6210\u6587\u5b57\u65f6\uff0c\u6bcf\u751f\u6210\u4e00\u4e2a\u65b0 token\uff0c\u90fd\u8981\u548c\u4e4b\u524d\u6240\u6709\u7684 token \u505a\u6ce8\u610f\u529b\u8ba1\u7b97\u3002\u5982\u679c\u4e0d\u7f13\u5b58\uff0c\u6bcf\u6b21\u90fd\u5f97\u628a\u5386\u53f2 token \u7684 Key \u548c Value \u91cd\u65b0\u7b97\u4e00\u904d\uff0c\u975e\u5e38\u6d6a\u8d39\u3002KV Cache \u7684\u505a\u6cd5\u662f\u200c<strong>\u628a\u7b97\u8fc7\u7684 Key \u548c Value \u5b58\u8d77\u6765<\/strong>\u200c\uff0c\u65b0 token \u6765\u4e86\u76f4\u63a5\u590d\u7528\uff0c\u53ea\u7b97\u81ea\u5df1\u7684 Query \u5c31\u884c\u3002\u200c\u200c<br>\u8fd9\u6837\u505a\u7684\u597d\u5904\u5f88\u76f4\u63a5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>\u63a8\u7406\u63d0\u901f<\/strong>\u200c\uff1a\u628a\u81ea\u6ce8\u610f\u529b\u8ba1\u7b97\u7684\u590d\u6742\u5ea6\u4ece O(n\u00b2) \u964d\u5230 O(n)\uff0c\u751f\u6210\u901f\u5ea6\u660e\u663e\u53d8\u5feb\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u7701\u663e\u5b58<\/strong>\u200c\uff1a\u867d\u7136 KV Cache \u672c\u8eab\u4e5f\u5360\u663e\u5b58\uff0c\u4f46\u6bd4\u8d77\u53cd\u590d\u91cd\u7b97\uff0c\u6574\u4f53\u4e0a\u8fd8\u662f\u5212\u7b97\u5f97\u591a\uff0c\u5c24\u5176\u957f\u6587\u672c\u573a\u666f\u3002\u200c\u200c<\/li>\n<\/ul>\n\n\n\n<p>\u4e0d\u8fc7 KV Cache \u4e5f\u6709\u81ea\u5df1\u7684\u9ebb\u70e6\u2014\u2014\u200c<strong>\u5360\u663e\u5b58<\/strong>\u200c\u3002\u5e8f\u5217\u8d8a\u957f\u3001\u6a21\u578b\u8d8a\u5927\uff0c\u7f13\u5b58\u4f53\u79ef\u5c31\u8d8a\u5938\u5f20\uff0c\u6709\u65f6\u5019\u751a\u81f3\u6bd4\u6a21\u578b\u672c\u8eab\u8fd8\u5360\u5730\u65b9\u3002 \u6240\u4ee5\u4e1a\u754c\u53c8\u641e\u51fa\u4e86\u4e00\u5806\u4f18\u5316\u65b9\u6848\uff1a\u200c\u200c<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u200c<strong>MQA \/ GQA<\/strong>\u200c\uff1a\u8ba9\u591a\u4e2a\u6ce8\u610f\u529b\u5934\u5171\u4eab\u540c\u4e00\u7ec4 Key\/Value\uff0c\u51cf\u5c11\u7f13\u5b58\u91cf\u3002<\/li>\n\n\n\n<li>\u200c<strong>MLA<\/strong>\u200c\uff1a\u5148\u628a Key\/Value \u538b\u7f29\u6210\u4f4e\u7ef4\u5411\u91cf\u518d\u7f13\u5b58\uff0c\u7528\u7684\u65f6\u5019\u89e3\u538b\uff0c\u663e\u5b58\u5360\u7528\u80fd\u518d\u964d\u4e00\u622a\uff0cDeepSeek \u7528\u7684\u5c31\u662f\u8fd9\u5957\u3002<\/li>\n\n\n\n<li>\u200c<strong>\u6ed1\u52a8\u7a97\u53e3\u6ce8\u610f\u529b<\/strong>\u200c\uff1a\u53ea\u7f13\u5b58\u6700\u8fd1 N \u4e2a token \u7684 K\/V\uff0c\u8d85\u51fa\u7a97\u53e3\u7684\u76f4\u63a5\u4e22\u6389\uff0c\u63a7\u5236\u7f13\u5b58\u5927\u5c0f\u3002\u200c\u200c<\/li>\n<\/ul>\n\n\n\n<p>\u7b80\u5355\u8bf4\uff0cKV Cache \u662f LLM \u63a8\u7406\u52a0\u901f\u7684\u57fa\u77f3\uff0c\u540e\u7eed\u7684 MQA\u3001GQA\u3001MLA \u90fd\u662f\u5728\u89e3\u51b3\u5b83\u201c\u592a\u5360\u663e\u5b58\u201d\u8fd9\u4e2a\u526f\u4f5c\u7528\u3002<\/p>\n\n\n\n<p>\u9700\u8981\u6211\u5e2e\u4f60\u6574\u7406 KV Cache \u4f18\u5316\u65b9\u6848\u7684\u9002\u7528\u573a\u666f\u5bf9\u6bd4\u5417\uff1f\u80fd\u5e2e\u4f60\u5feb\u901f\u5339\u914d\u6700\u9002\u5408\u5f53\u524d\u6a21\u578b\u7684\u4f18\u5316\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u4ee5\u628a\u6574\u4e2a\u5927\u6a21\u578b\u8bad\u7ec3\u60f3\u8c61\u6210\u200c\u201c\u4ece\u96f6\u5f00\u59cb\u57f9\u517b\u4e00\u4e2a\u901a\u624d\u5b66\u751f\uff0c\u518d\u628a\u4ed6\u5b9a\u5411\u57f9\u517b\u6210\u542c\u8bdd\u7684\u4e13\u4e1a\u4eba\u624d\u201d\u200c\u3002\u6574\u4e2a\u8fc7\u7a0b\u4e3b\u8981\u5206\u4e09\u5927 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-2705","post","type-post","status-publish","format-standard","hentry","category-30"],"_links":{"self":[{"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/posts\/2705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2705"}],"version-history":[{"count":3,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/posts\/2705\/revisions"}],"predecessor-version":[{"id":2712,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/posts\/2705\/revisions\/2712"}],"wp:attachment":[{"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2705"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.xtaa.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}