{"id":104072,"date":"2026-09-11T19:41:02","date_gmt":"2026-09-11T11:41:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104072.html"},"modified":"2026-09-11T19:41:02","modified_gmt":"2026-09-11T11:41:02","slug":"%e4%bc%a0%e7%bb%9f-kv-cache%ef%bc%9a%e6%98%be%e5%ad%98%e6%98%8e%e6%98%8e%e5%a4%9f%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e5%b9%b6%e5%8f%91%e5%b0%b1%e6%98%af%e4%b8%8a%e4%b8%8d%e5%8e%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104072.html","title":{"rendered":"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb"},"content":{"rendered":"<p>\u4e0a\u7bc7\u8bb2\u5230&#xff0c;\u4e00\u79cd\u5f88\u76f4\u63a5\u7684\u505a\u6cd5\u662f\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u6309&#034;\u53ef\u80fd\u7684\u6700\u5927\u957f\u5ea6&#034;\u9884\u7559\u4e00\u5757\u8fde\u7eed\u7684\u663e\u5b58\u7a7a\u95f4\u3002\u8fd9\u79cd\u4f20\u7edf\u9884\u5206\u914d&#xff0c;\u6700\u5927\u7684\u95ee\u9898\u5c31\u662f\u8fd9\u5757\u7a7a\u95f4\u5e38\u5e38\u7528\u4e0d\u6ee1\u3002<\/p>\n<p>\u8fd9\u4e00\u7bc7\u5c31\u628a\u8fd9\u4ef6\u4e8b\u62c6\u5f00\u770b&#xff1a;KV cache \u5230\u5e95\u5360\u4e86\u591a\u5c11\u663e\u5b58&#xff0c;\u4f20\u7edf\u5206\u914d\u53c8\u4e3a\u4ec0\u4e48\u8ba9\u8fd9\u4e48\u591a\u663e\u5b58\u767d\u767d\u7a7a\u7740&#xff0c;\u4ee5\u53ca\u5b83\u4e3a\u4ec0\u4e48\u4f1a\u6210\u4e3a\u4f01\u4e1a\u7ea7\u90e8\u7f72\u7684\u74f6\u9888\u3002<\/p>\n<p>\u6211\u5728\u300a\u5927\u6a21\u578b\u63a8\u7406\u5230\u4e86\u63a8\u7406\u5f15\u64ce\u8fd9\u4e00\u6b65&#xff0c;\u5230\u5e95\u8981\u7ba1\u54ea\u4e9b\u4e8b\u300b\u91cc\u8bb2\u8fc7&#xff0c;KV cache \u7684\u7a7a\u95f4\u5206\u914d\u3001\u5199\u5165\u548c\u8bfb\u53d6&#xff0c;\u4e3b\u8981\u7531\u63a8\u7406\u5f15\u64ce\u8d1f\u8d23&#xff1b;<\/p>\n<p>\u5728\u300aDecode \u6bcf\u8f6e\u90fd\u91cd\u7b97\u4e00\u904d\u5386\u53f2 token \u5417&#xff1a;\u804a\u804a KV cache\u300b\u91cc\u4e5f\u5e26\u8fc7&#xff0c;Decode \u6bcf\u8f6e\u90fd\u8981\u628a\u5386\u53f2\u7684 K \u548c V \u8bfb\u51fa\u6765\u53c2\u4e0e\u6ce8\u610f\u529b\u8ba1\u7b97\u3002<\/p>\n<h3>KV cache \u4e3a\u4ec0\u4e48\u662f\u4e2a\u663e\u5b58\u541e\u91d1\u517d<\/h3>\n<p>\u5148\u8bf4\u6e05\u695a\u4e00\u4ef6\u4e8b&#xff1a;<\/p>\n<p>KV cache \u4e0d\u662f\u5b58\u4e00\u70b9\u5c31\u5b8c\u4e8b&#xff0c;\u5e8f\u5217\u8d8a\u957f&#xff0c;\u8981\u7559\u5728\u663e\u5b58\u91cc\u7684 K \u548c V \u5c31\u8d8a\u591a\u3002<\/p>\n<p>\u6a21\u578b\u91cc\u6709\u4e00\u5c42\u4e00\u5c42\u7684\u6ce8\u610f\u529b\u5c42&#xff0c;\u6bcf\u4e00\u5c42\u90fd\u4f1a\u4e3a\u5f53\u524d token \u7b97\u51fa K \u548c V \u4e24\u4e2a\u5411\u91cf\u3002<\/p>\n<p>\u4e00\u4e2a\u8bf7\u6c42\u4ece\u8f93\u5165 prompt \u5f00\u59cb&#xff0c;\u5230\u540e\u7eed\u4e0d\u65ad\u751f\u6210 token&#xff0c;\u6bcf\u4e00\u5c42\u3001\u6bcf\u4e00\u4e2a\u9700\u8981\u53c2\u4e0e\u540e\u7eed\u6ce8\u610f\u529b\u8ba1\u7b97\u7684\u5386\u53f2 token \u7684 K \u548c V \u90fd\u5f97\u7559\u5728\u663e\u5b58\u91cc&#xff0c;\u4e0b\u4e00\u8f6e Decode \u624d\u4e0d\u7528\u91cd\u7b97\u3002<\/p>\n<p>\u6240\u4ee5 KV cache \u7684\u5927\u5c0f&#xff0c;\u57fa\u672c\u7b49\u4e8e&#xff1a;<\/p>\n<p>\u5e8f\u5217\u957f\u5ea6 \u00d7 \u5c42\u6570 \u00d7 KV head \u6570 \u00d7 head_dim \u00d7 2 \u00d7 \u6bcf\u4e2a\u5143\u7d20\u7684\u5b57\u8282\u6570<\/p>\n<p>\u8fd9\u91cc\u662f\u4e3a\u4e86\u8bf4\u660e\u91cf\u7ea7\u7684\u7b80\u5316\u516c\u5f0f&#xff1b;<\/p>\n<p>\u5b9e\u9645\u5927\u5c0f\u8fd8\u4f1a\u53d7\u5230\u6a21\u578b\u67b6\u6784\u3001KV cache \u6570\u636e\u7c7b\u578b\u7b49\u56e0\u7d20\u5f71\u54cd\u3002<\/p>\n<p>\u5e8f\u5217\u8d8a\u957f&#xff0c;\u5360\u7684\u663e\u5b58\u5c31\u8d8a\u591a&#xff0c;\u800c\u4e14\u51e0\u4e4e\u662f\u7ebf\u6027\u5f80\u4e0a\u722c\u3002<\/p>\n<p>\u4e3e\u4e2a\u91cf\u7ea7\u4e0a\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<p>\u4e00\u4e2a 70 \u4ebf\u53c2\u6570\u7ea7\u522b\u7684\u6a21\u578b&#xff0c;\u6bcf\u4e2a token \u5bf9\u5e94\u7684 KV cache \u53ef\u80fd\u5c31\u662f\u51e0\u5341 KB \u5230\u51e0\u767e KB&#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u6a21\u578b\u7684\u5c42\u6570\u3001KV head \u6570\u548c KV cache \u6570\u636e\u7c7b\u578b&#xff1b;<\/p>\n<p>\u4e00\u4e2a\u8bf7\u6c42\u8dd1\u5230\u51e0\u5343\u4e2a token&#xff0c;\u5149 KV cache \u5c31\u53ef\u80fd\u5360\u6389\u51e0\u767e MB \u751a\u81f3\u4e0a GB \u7684\u663e\u5b58\u3002<\/p>\n<p>\u8fd9\u8fd8\u6ca1\u7b97\u6a21\u578b\u6743\u91cd\u672c\u8eab\u5360\u7684\u90a3\u4e00\u5927\u5757\u3002<\/p>\n<p>\u7c7b\u6bd4\u4e00\u4e0b&#xff1a;<\/p>\n<p>KV cache \u50cf\u4f60\u8bb0\u8bfe\u5802\u7b14\u8bb0&#xff0c;\u6bcf\u542c\u4e00\u53e5\u8bdd\u5c31\u5f80\u672c\u5b50\u4e0a\u6dfb\u4e00\u884c&#xff1b;<\/p>\n<p>\u672c\u5b50\u9875\u6570\u662f\u6709\u9650\u7684&#xff0c;\u8bdd\u5374\u8d8a\u8bf4\u8d8a\u957f&#xff0c;\u5199\u7740\u5199\u7740\u5c31\u4e0d\u591f\u7528\u4e86\u3002<\/p>\n<p>\u90a3\u95ee\u9898\u5c31\u6765\u4e86&#xff1a;<\/p>\n<p>\u65e2\u7136\u5b83\u8fd9\u4e48\u5360\u5730\u65b9&#xff0c;\u63a8\u7406\u5f15\u64ce\u5230\u5e95\u662f\u600e\u4e48\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u5b89\u6392\u7a7a\u95f4\u7684&#xff1f;<\/p>\n<h3>\u6700\u76f4\u89c9\u7684\u505a\u6cd5&#xff1a;\u6309\u6700\u5927\u957f\u5ea6&#xff0c;\u63d0\u524d\u7559\u591f<\/h3>\n<p>\u6700\u76f4\u89c9\u3001\u6700\u7701\u4e8b\u7684\u529e\u6cd5&#xff0c;\u5c31\u662f&#034;\u6309\u6700\u574f\u60c5\u51b5\u9884\u7559&#034;\u3002<\/p>\n<p>\u4e00\u4e2a\u8bf7\u6c42\u8fdb\u6765&#xff0c;\u5f15\u64ce\u5e76\u4e0d\u77e5\u9053\u5b83\u6700\u7ec8\u4f1a\u751f\u6210\u591a\u5c11\u4e2a token\u3002<\/p>\n<p>\u5982\u679c\u91c7\u7528\u6309\u6700\u5927\u957f\u5ea6\u9884\u5206\u914d\u7684\u8fde\u7eed KV cache&#xff0c;\u5c31\u53ef\u4ee5\u76f4\u63a5\u6309\u7167\u6a21\u578b\u5141\u8bb8\u7684\u6700\u5927\u5e8f\u5217\u957f\u5ea6&#xff08;\u6bd4\u5982 8192 \u4e2a token&#xff09;\u9884\u7559\u4e00\u6574\u5757\u7a7a\u95f4\u3002<\/p>\n<p>\u5b83\u7684\u597d\u5904\u5f88\u7b80\u5355&#xff1a;<\/p>\n<p>\u540e\u9762 Decode \u4e00\u8def\u8ffd\u52a0 K \u548c V&#xff0c;\u7a7a\u95f4\u6c38\u8fdc\u591f\u7528&#xff0c;\u4e0d\u7528\u5728\u751f\u6210\u4e2d\u9014\u53d1\u73b0\u4e0d\u591f\u4e86\u518d\u53bb\u6269\u5bb9\u3001\u628a\u5df2\u6709\u7684 KV cache \u632a\u5230\u522b\u5904&#xff0c;\u5f15\u64ce\u5b9e\u73b0\u8d77\u6765\u6700\u7701\u5fc3\u3002<\/p>\n<p>\u4ee3\u4ef7\u5462&#xff1f;<\/p>\n<p>\u4e5f\u6070\u6070\u85cf\u5728\u8fd9\u4e2a&#034;\u6309\u6700\u5927\u957f\u5ea6&#034;\u91cc\u3002<\/p>\n<h3>\u6d6a\u8d39\u4ece\u54ea\u6765&#xff1a;\u9884\u7559\u4e86&#xff0c;\u7528\u4e0d\u4e0a&#xff0c;\u8fd8\u72ec\u5360<\/h3>\n<p>\u5173\u952e\u77db\u76fe\u662f&#xff1a;<\/p>\n<p>\u7edd\u5927\u591a\u6570\u8bf7\u6c42&#xff0c;\u6839\u672c\u5230\u4e0d\u4e86\u6700\u5927\u957f\u5ea6\u3002<\/p>\n<p>\u8bbe\u60f3\u540c\u4e00\u65f6\u523b\u6709\u4e09\u4e2a\u8bf7\u6c42 A\u3001B\u3001C \u4e00\u8d77\u8fdb\u6765\u3002<\/p>\n<p>\u5f15\u64ce\u7ed9 A \u5212\u4e86 8192 \u4e2a token \u7684 KV \u7a7a\u95f4&#xff0c;\u7ed9 B\u3001C \u4e5f\u662f\u540c\u6837\u5927\u5c0f\u2014\u2014\u56e0\u4e3a&#034;\u6309\u6700\u5927\u957f\u5ea6&#034;\u5bf9\u6240\u6709\u8bf7\u6c42\u4e00\u89c6\u540c\u4ec1\u3002<\/p>\n<p>\u53ef A \u5b9e\u9645\u4e0a\u53ea\u95ee\u4e86\u4e00\u4e2a\u5f88\u77ed\u7684\u95ee\u9898&#xff0c;\u6574\u4e2a\u8bf7\u6c42\u6700\u7ec8\u4e5f\u5c31\u7528\u4e86\u5341\u51e0\u4e2a token \u5c31\u7ed3\u675f\u4e86\u3002<\/p>\n<p>\u4e8e\u662f A \u90a3\u5757 8192 \u7684\u989d\u5ea6\u91cc&#xff0c;\u524d\u9762\u4e00\u5c0f\u6bb5\u5199\u6ee1\u4e86 K \u548c V&#xff0c;\u540e\u9762\u7edd\u5927\u90e8\u5206\u90fd\u7a7a\u7740\u3002<\/p>\n<p>\u7a7a\u7740\u4e0d\u8981\u7d27&#xff0c;\u8981\u7d27\u7684\u662f&#xff1a;<\/p>\n<p>\u8fd9\u5757\u7a7a\u95f4\u5df2\u7ecf\u88ab A \u5360\u4e0b\u4e86&#xff0c;\u522b\u7684\u8bf7\u6c42\u7528\u4e0d\u4e86\u3002<\/p>\n<p>\u8fd9\u4e9b\u8fd8\u6ca1\u5199\u5165 KV \u7684\u7a7a\u95f4&#xff0c;\u4ece\u5185\u5b58\u7ba1\u7406\u7684\u89d2\u5ea6\u770b&#xff0c;\u4f1a\u5f62\u6210\u4e25\u91cd\u7684\u5185\u90e8\u788e\u7247\u3002<\/p>\n<p>\u8d8a\u662f\u77ed\u7684\u8bf7\u6c42&#xff0c;\u6d6a\u8d39\u7684\u6bd4\u4f8b\u8d8a\u9ad8\u3002<\/p>\n<p>\u4e00\u4e2a\u53ea\u9700\u8981\u5341\u51e0\u4e2a token \u5c31\u7ed3\u675f\u7684\u77ed\u8bf7\u6c42&#xff0c;\u5374\u5360\u7740 8192 \u7684\u989d\u5ea6&#xff0c;\u5229\u7528\u7387\u8fde 1% \u90fd\u4e0d\u5230&#xff1b;<\/p>\n<p>\u65c1\u8fb9\u90a3\u4e2a\u957f\u6587\u6863\u6458\u8981\u4efb\u52a1\u53ef\u80fd\u7528\u5230\u4e86 6000&#xff0c;\u4e5f\u8fd8\u662f\u6ca1\u586b\u6ee1\u3002<\/p>\n<p>\u5982\u679c\u8bf7\u6c42\u5e73\u5747\u53ea\u8dd1\u5230\u6700\u5927\u957f\u5ea6\u7684\u4e24\u4e09\u6210&#xff0c;\u90a3\u4e48\u8fd9\u90e8\u5206\u9884\u7559 KV cache \u7684\u5b9e\u9645\u4f7f\u7528\u7387\u4e5f\u53ef\u80fd\u53ea\u6709\u4e24\u4e09\u6210\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911114100-6aa3e8cc1b7d1.png\" alt=\"\" \/><\/p>\n<h3>\u4f4e\u5229\u7528\u7387&#xff0c;\u4e3a\u4ec0\u4e48\u8ba9\u5e76\u53d1\u4e0a\u4e0d\u53bb<\/h3>\n<p>\u4f4e\u5229\u7528\u7387\u7684\u4ee3\u4ef7&#xff0c;\u4e0d\u53ea\u662f\u6d6a\u8d39\u663e\u5b58\u3002<\/p>\n<p>\u663e\u5b58\u5c31\u90a3\u4e48\u591a&#xff0c;KV cache \u5360\u6389\u4e00\u5927\u534a\u9884\u7559\u989d\u5ea6\u5374\u7a7a\u7740&#xff0c;\u7b49\u4e8e\u540c\u4e00\u5f20\u5361\u80fd\u540c\u65f6\u670d\u52a1\u7684\u8bf7\u6c42\u6570\u88ab\u786c\u751f\u751f\u538b\u4f4e\u4e86\u3002<\/p>\n<p>\u56de\u5230\u4e0a\u7bc7\u8bf4\u7684\u6279\u5904\u7406&#xff1a;<\/p>\n<p>\u4f01\u4e1a\u7ea7\u63a8\u7406\u9760\u628a\u591a\u4e2a\u8bf7\u6c42\u62fc\u6210\u4e00\u6279\u6765\u63d0\u541e\u5410\u3002<\/p>\n<p>\u53ef\u6279\u5904\u7406\u7684\u524d\u63d0&#xff0c;\u662f\u663e\u5b58\u91cc\u80fd\u540c\u65f6\u653e\u4e0b\u66f4\u591a\u8bf7\u6c42\u7684 KV cache\u3002<\/p>\n<p>\u4f20\u7edf\u9884\u5206\u914d\u4e0b&#xff0c;\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u5148\u5360\u4f4f\u4e00\u6574\u5757\u6700\u5927\u957f\u5ea6\u7684 KV cache \u989d\u5ea6&#xff0c;\u5b9e\u9645\u5374\u53ea\u7528\u5176\u4e2d\u4e00\u5c0f\u90e8\u5206&#xff0c;\u663e\u5b58\u91cc\u80fd\u540c\u65f6\u653e\u4e0b\u7684\u8bf7\u6c42\u6570\u81ea\u7136\u5c31\u5c11\u3002<\/p>\n<p>\u7ed3\u679c\u5c31\u662f&#xff1a;<\/p>\n<p>\u5f88\u591a\u65f6\u5019&#xff0c;\u5355\u5f20\u663e\u5361\u771f\u6b63\u5361\u4f4f\u5e76\u53d1\u7684&#xff0c;\u4e0d\u53ea\u662f\u7b97\u529b&#xff0c;\u800c\u662f KV cache \u7684\u663e\u5b58\u5bb9\u91cf&#xff1a;<\/p>\n<p>\u5927\u91cf\u7a7a\u95f4\u88ab\u63d0\u524d\u9884\u7559\u5374\u7a7a\u7740&#xff0c;\u65b0\u8bf7\u6c42\u8fdb\u4e0d\u6765&#xff0c;\u541e\u5410\u81ea\u7136\u4e5f\u4e0a\u4e0d\u53bb\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;\u5728\u9700\u8981\u52a8\u6001\u8c03\u6574\u8fde\u7eed KV cache \u7a7a\u95f4\u7684\u5206\u914d\u65b9\u6848\u91cc&#xff0c;\u8fd8\u53ef\u80fd\u51fa\u73b0\u5916\u90e8\u788e\u7247\u3002<\/p>\n<p>\u8bf7\u6c42\u8fdb\u8fdb\u51fa\u51fa&#xff0c;\u5360\u7528\u7684\u8fde\u7eed\u7a7a\u95f4\u5927\u5c0f\u4e0d\u4e00&#xff0c;\u91ca\u653e\u4e4b\u540e\u5c31\u5728\u663e\u5b58\u91cc\u6563\u843d\u6210\u4e00\u4e9b\u96f6\u788e\u7684\u7a7a\u95f2\u533a\u95f4\u3002<\/p>\n<p>\u8fd9\u4e9b\u533a\u95f4\u5373\u4f7f\u52a0\u8d77\u6765\u5df2\u7ecf\u591f\u653e\u4e0b\u4e00\u4e2a\u65b0\u8bf7\u6c42&#xff0c;\u4e5f\u53ef\u80fd\u56e0\u4e3a\u5f7c\u6b64\u4e0d\u8fde\u7eed&#xff0c;\u51d1\u4e0d\u51fa\u4e00\u6574\u5757\u8fde\u7eed\u7a7a\u95f4\u3002<\/p>\n<p>\u4e8e\u662f&#xff0c;\u603b\u663e\u5b58\u660e\u660e\u8fd8\u6709&#xff0c;\u65b0\u7684\u8bf7\u6c42\u5374\u4e0d\u4e00\u5b9a\u585e\u5f97\u8fdb\u53bb\u2014\u2014\u8fd9\u53c8\u8fdb\u4e00\u6b65\u9650\u5236\u4e86\u5e76\u53d1\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911114100-6aa3e8ccd9963.png\" alt=\"\" \/><\/p>\n<h3>\u663e\u5b58\u88ab\u5403\u7a7a&#xff0c;\u6839\u6e90\u5728\u4f20\u7edf\u5206\u914d<\/h3>\n<p>\u95ee\u9898\u5df2\u7ecf\u5f88\u6e05\u695a&#xff1a;<\/p>\n<p>\u8fd9\u91cc\u7684\u6838\u5fc3\u95ee\u9898&#xff0c;\u4e0d\u662f KV cache \u672c\u8eab\u592a\u6d6a\u8d39&#xff0c;\u800c\u662f\u90a3\u5957&#034;\u6309\u6700\u5927\u957f\u5ea6\u4e00\u5200\u5207\u9884\u7559\u8fde\u7eed\u7a7a\u95f4&#034;\u7684\u5206\u914d\u65b9\u5f0f\u3002<\/p>\n<p>\u771f\u6b63\u9700\u8981\u89e3\u51b3\u7684\u662f KV cache \u7684\u663e\u5b58\u5206\u914d\u6548\u7387\u3002<\/p>\n<p>\u8981\u7834\u8fd9\u4e2a\u5c40&#xff0c;\u601d\u8def\u5f97\u6362&#xff1a;<\/p>\n<p>\u4e0e\u5176\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u9501\u6b7b\u4e00\u6574\u5757\u5927\u663e\u5b58&#xff0c;\u4e0d\u5982\u628a KV cache \u4e5f\u50cf\u64cd\u4f5c\u7cfb\u7edf\u7ba1\u5185\u5b58\u90a3\u6837&#xff0c;\u5207\u6210\u56fa\u5b9a\u5927\u5c0f\u7684\u5c0f\u5757&#xff0c;\u6309\u5b9e\u9645\u7528\u591a\u5c11\u3001\u52a8\u6001\u5206\u7ed9\u8c01\u3002<\/p>\n<p>\u8fd9\u6b63\u662f PagedAttention\u3001\u5206\u5757\u7ba1\u7406\u8fd9\u4e00\u7c7b\u89e3\u6cd5\u60f3\u505a\u7684\u4e8b\u2014\u2014\u628a&#034;\u6574\u5757\u9884\u7559&#034;\u6362\u6210&#034;\u6309\u9700\u5206\u9875&#034;&#xff0c;\u5927\u5e45\u51cf\u5c11\u8fde\u7eed\u9884\u5206\u914d\u5e26\u6765\u7684\u663e\u5b58\u6d6a\u8d39&#xff0c;\u5e76\u7f13\u89e3\u4f20\u7edf\u8fde\u7eed\u5185\u5b58\u5206\u914d\u4e2d\u7684\u788e\u7247\u95ee\u9898\u3002<\/p>\n<p>\u5230\u8fd9\u513f&#xff0c;\u5927\u6a21\u578b\u63a8\u7406\u6838\u5fc3\u539f\u7406\u8fd9\u4e00\u9636\u6bb5\u5c31\u8bb2\u5b8c\u4e86&#xff1a;<\/p>\n<p>\u4ece Prefill \u548c Decode \u4e24\u9636\u6bb5\u3001\u4e00\u6b21\u5b8c\u6574\u63a8\u7406\u8981\u8fc7\u7684\u51e0\u9053\u5de5\u5e8f\u3001TTFT \u548c ITL \u4e24\u4e2a\u901f\u5ea6\u6307\u6807&#xff0c;\u5230 KV cache \u4e3a\u4ec0\u4e48\u5fc5\u987b\u5b58\u5728\u3001\u63a8\u7406\u5f15\u64ce\u600e\u4e48\u628a\u5b83\u4eec\u8dd1\u8d77\u6765&#xff0c;\u4e00\u76f4\u5230\u4f20\u7edf KV cache \u5728\u663e\u5b58\u4e0a\u8e29\u7684\u5751\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u8bb2\u5230&#xff0c;\u4e00\u79cd\u5f88\u76f4\u63a5\u7684\u505a\u6cd5\u662f\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u6309\\&#8221;\u53ef\u80fd\u7684\u6700\u5927\u957f\u5ea6\\&#8221;\u9884\u7559\u4e00\u5757\u8fde\u7eed\u7684\u663e\u5b58\u7a7a\u95f4\u3002\u8fd9\u79cd\u4f20\u7edf\u9884\u5206\u914d&#xff0c;\u6700\u5927\u7684\u95ee\u9898\u5c31\u662f\u8fd9\u5757\u7a7a\u95f4\u5e38\u5e38\u7528\u4e0d\u6ee1\u3002<br \/>\n\u8fd9\u4e00\u7bc7\u5c31\u628a\u8fd9\u4ef6\u4e8b\u62c6\u5f00\u770b&#xff1a;KV cache \u5230\u5e95\u5360\u4e86\u591a\u5c11\u663e\u5b58&#xff0c;\u4f20\u7edf\u5206\u914d\u53c8\u4e3a\u4ec0\u4e48\u8ba9\u8fd9\u4e48\u591a\u663e\u5b58\u767d\u767d\u7a7a\u7740&#xff0c;\u4ee5\u53ca\u5b83\u4e3a\u4ec0\u4e48\u4f1a\u6210\u4e3a\u4f01\u4e1a\u7ea7\u90e8\u7f72\u7684\u74f6\u9888\u3002<br \/>\n\u6211\u5728\u300a\u5927\u6a21\u578b\u63a8\u7406\u5230\u4e86\u63a8\u7406\u5f15\u64ce\u8fd9\u4e00\u6b65&#xff0c;\u5230\u5e95\u8981\u7ba1\u54ea\u4e9b\u4e8b\u300b\u91cc\u8bb2\u8fc7&#xff0c;KV cache \u7684\u7a7a\u95f4\u5206\u914d\u3001\u5199\u5165\u548c\u8bfb\u53d6&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":104070,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50,86,224,51],"topic":[],"class_list":["post-104072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-50","tag-86","tag-224","tag-51"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \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\/104072.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u7bc7\u8bb2\u5230&#xff0c;\u4e00\u79cd\u5f88\u76f4\u63a5\u7684\u505a\u6cd5\u662f\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u6309&quot;\u53ef\u80fd\u7684\u6700\u5927\u957f\u5ea6&quot;\u9884\u7559\u4e00\u5757\u8fde\u7eed\u7684\u663e\u5b58\u7a7a\u95f4\u3002\u8fd9\u79cd\u4f20\u7edf\u9884\u5206\u914d&#xff0c;\u6700\u5927\u7684\u95ee\u9898\u5c31\u662f\u8fd9\u5757\u7a7a\u95f4\u5e38\u5e38\u7528\u4e0d\u6ee1\u3002 \u8fd9\u4e00\u7bc7\u5c31\u628a\u8fd9\u4ef6\u4e8b\u62c6\u5f00\u770b&#xff1a;KV cache \u5230\u5e95\u5360\u4e86\u591a\u5c11\u663e\u5b58&#xff0c;\u4f20\u7edf\u5206\u914d\u53c8\u4e3a\u4ec0\u4e48\u8ba9\u8fd9\u4e48\u591a\u663e\u5b58\u767d\u767d\u7a7a\u7740&#xff0c;\u4ee5\u53ca\u5b83\u4e3a\u4ec0\u4e48\u4f1a\u6210\u4e3a\u4f01\u4e1a\u7ea7\u90e8\u7f72\u7684\u74f6\u9888\u3002 \u6211\u5728\u300a\u5927\u6a21\u578b\u63a8\u7406\u5230\u4e86\u63a8\u7406\u5f15\u64ce\u8fd9\u4e00\u6b65&#xff0c;\u5230\u5e95\u8981\u7ba1\u54ea\u4e9b\u4e8b\u300b\u91cc\u8bb2\u8fc7&#xff0c;KV cache \u7684\u7a7a\u95f4\u5206\u914d\u3001\u5199\u5165\u548c\u8bfb\u53d6&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104072.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-11T11:41:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911114100-6aa3e8cc1b7d1.png\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104072.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104072.html\",\"name\":\"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-11T11:41:02+00:00\",\"dateModified\":\"2026-09-11T11:41:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104072.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104072.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104072.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb\"}]},{\"@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":"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \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\/104072.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u7bc7\u8bb2\u5230&#xff0c;\u4e00\u79cd\u5f88\u76f4\u63a5\u7684\u505a\u6cd5\u662f\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u6309\"\u53ef\u80fd\u7684\u6700\u5927\u957f\u5ea6\"\u9884\u7559\u4e00\u5757\u8fde\u7eed\u7684\u663e\u5b58\u7a7a\u95f4\u3002\u8fd9\u79cd\u4f20\u7edf\u9884\u5206\u914d&#xff0c;\u6700\u5927\u7684\u95ee\u9898\u5c31\u662f\u8fd9\u5757\u7a7a\u95f4\u5e38\u5e38\u7528\u4e0d\u6ee1\u3002 \u8fd9\u4e00\u7bc7\u5c31\u628a\u8fd9\u4ef6\u4e8b\u62c6\u5f00\u770b&#xff1a;KV cache \u5230\u5e95\u5360\u4e86\u591a\u5c11\u663e\u5b58&#xff0c;\u4f20\u7edf\u5206\u914d\u53c8\u4e3a\u4ec0\u4e48\u8ba9\u8fd9\u4e48\u591a\u663e\u5b58\u767d\u767d\u7a7a\u7740&#xff0c;\u4ee5\u53ca\u5b83\u4e3a\u4ec0\u4e48\u4f1a\u6210\u4e3a\u4f01\u4e1a\u7ea7\u90e8\u7f72\u7684\u74f6\u9888\u3002 \u6211\u5728\u300a\u5927\u6a21\u578b\u63a8\u7406\u5230\u4e86\u63a8\u7406\u5f15\u64ce\u8fd9\u4e00\u6b65&#xff0c;\u5230\u5e95\u8981\u7ba1\u54ea\u4e9b\u4e8b\u300b\u91cc\u8bb2\u8fc7&#xff0c;KV cache \u7684\u7a7a\u95f4\u5206\u914d\u3001\u5199\u5165\u548c\u8bfb\u53d6&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/104072.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-11T11:41:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260911114100-6aa3e8cc1b7d1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104072.html","url":"https:\/\/www.wsisp.com\/helps\/104072.html","name":"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-11T11:41:02+00:00","dateModified":"2026-09-11T11:41:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104072.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104072.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104072.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f20\u7edf KV cache\uff1a\u663e\u5b58\u660e\u660e\u591f\uff0c\u4e3a\u4ec0\u4e48\u5e76\u53d1\u5c31\u662f\u4e0a\u4e0d\u53bb"}]},{"@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\/104072","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=104072"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104072\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/104070"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104072"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}