{"id":99271,"date":"2024-11-16T23:26:20","date_gmt":"2024-11-16T15:26:20","guid":{"rendered":"\/\/www.viralrail.com\/?p=99271"},"modified":"2024-11-16T23:26:24","modified_gmt":"2024-11-16T15:26:24","slug":"lmxssmzmy","status":"publish","type":"post","link":"\/\/www.viralrail.com\/blog\/99271.html","title":{"rendered":"LoRA\u6a21\u578b\u662f\u4ec0\u4e48,\u600e\u4e48\u7528\uff1f"},"content":{"rendered":"\n
\u3000\u3000LoRA<\/strong>(Low-Rank Adaptation of Large Language Models)\u662f\u4e00\u79cd\u7531\u5fae\u8f6f\u7814\u7a76\u4eba\u5458\u5f00\u53d1\u7684\u6280\u672f\uff0c\u65e8\u5728\u89e3\u51b3\u5927\u8bed\u8a00\u6a21\u578b\u5fae\u8c03\u7684\u95ee\u9898\u3002LoRA\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5728\u9884\u8bad\u7ec3\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u6ce8\u5165\u53ef\u8bad\u7ec3\u7684\u4f4e\u79e9\u77e9\u9635\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u6a21\u578b\u7684\u5feb\u901f\u4e14\u9ad8\u6548\u7684\u5fae\u8c03\uff0c\u540c\u65f6\u4fdd\u6301\u4e0e\u5168\u6a21\u578b\u5fae\u8c03\u76f8\u5f53\u7684\u6548\u679c\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u6a21\u578b\u901a\u5e38\u7528\u4e8eStable Diffusion\u7b49\u751f\u6210\u6a21\u578b\u4e2d\uff0c\u901a\u8fc7\u5bf9\u5173\u952e\u5c42\u5982\u4ea4\u53c9\u6ce8\u610f\u529b\u5c42\u8fdb\u884c\u5c0f\u89c4\u6a21\u4fee\u6539\u6765\u5b9e\u73b0\u98ce\u683c\u6539\u53d8\u3002LoRA\u6a21\u578b\u7684\u6587\u4ef6\u5927\u5c0f\u901a\u5e38\u6bd4\u6807\u51c6\u7684checkpoint\u6a21\u578b\u5c0f10\u5230100\u500d\uff0c\u8fd9\u4f7f\u5f97\u5b83\u4eec\u5728\u5b58\u50a8\u548c\u4f7f\u7528\u4e0a\u66f4\u4e3a\u4fbf\u6377\u3002LoRA\u6a21\u578b\u4e0d\u80fd\u72ec\u7acb\u8fd0\u884c\uff0c\u5fc5\u987b\u4e0e\u5927\u6a21\u578b\u7ed3\u5408\u4f7f\u7528\uff0c\u901a\u8fc7\u5728\u63d0\u793a\u8bcd\u4e2d\u6dfb\u52a0\u7279\u5b9a\u8bed\u6cd5\u6765\u8c03\u7528LoRA\u6a21\u578b\u3002<\/p>\n\n\n\n \u3000\u3000\u4f7f\u7528LoRA\u6a21\u578b\u7684\u57fa\u672c\u6b65\u9aa4\u5305\u62ec\uff1a<\/p>\n\n\n\n \u3000\u3000\u6b64\u5916\uff0cLoRA\u6a21\u578b\u5728\u56fe\u50cf\u751f\u6210\u3001\u6587\u672c\u751f\u6210\u7b49\u591a\u4e2a\u9886\u57df\u90fd\u6709\u5e7f\u6cdb\u5e94\u7528\u3002\u4f8b\u5982\uff0c\u5728AI\u7ed8\u753b\u9886\u57df\uff0cLoRA\u53ef\u4ee5\u7528\u4e8e\u8c03\u6574\u56fe\u50cf\u7684\u98ce\u683c\u3001\u8272\u5f69\u548c\u6784\u56fe\uff0c\u4ece\u800c\u63d0\u5347\u751f\u6210\u56fe\u7247\u7684\u8d28\u91cf\u3002\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\uff0cLoRA\u53ef\u7528\u4e8e\u6587\u672c\u751f\u6210\u4efb\u52a1\uff0c\u5e2e\u52a9\u751f\u6210\u8fde\u8d2f\u3001\u5177\u6709\u903b\u8f91\u6027\u7684\u6587\u7ae0\u548c\u5bf9\u8bdd\u3002<\/p>\n\n\n\n \u3000\u3000\u603b\u4e4b\uff0cLoRA\u6a21\u578b\u901a\u8fc7\u51cf\u5c11\u8bad\u7ec3\u6240\u9700\u7684\u53c2\u6570\u91cf\u548c\u5185\u5b58\u6d88\u8017\uff0c\u4f7f\u5f97\u5927\u6a21\u578b\u7684\u5fae\u8c03\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\u548c\u7075\u6d3b\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u5e94\u7528\u573a\u666f\u3002<\/p>\n\n\n\n \u3000\u3000LoRA(Low-Rank Adaptation)\u6a21\u578b\u7684\u5177\u4f53\u5b9e\u73b0\u539f\u7406\u4e3b\u8981\u57fa\u4e8e\u4f4e\u79e9\u77e9\u9635\u5206\u89e3\u6280\u672f\uff0c\u7528\u4e8e\u5927\u578b\u8bed\u8a00\u6a21\u578b(LLMs)\u7684\u53c2\u6570\u9ad8\u6548\u5fae\u8c03\u3002\u4ee5\u4e0b\u662fLoRA\u6a21\u578b\u7684\u8be6\u7ec6\u5b9e\u73b0\u539f\u7406\uff1a<\/p>\n\n\n\n \u3000\u3000LoRA\u901a\u8fc7\u51bb\u7ed3\u9884\u8bad\u7ec3\u6743\u91cd\u5e76\u5f15\u5165\u4f4e\u79e9\u77e9\u9635\u5206\u89e3\u6280\u672f\uff0c\u5b9e\u73b0\u4e86\u53c2\u6570\u9ad8\u6548\u7684\u6a21\u578b\u5fae\u8c03\u3002<\/p>\n\n\n\n \u3000\u3000LoRA(\u4f4e\u79e9\u9002\u5e94)\u6280\u672f\u662f\u4e00\u79cd\u7528\u4e8e\u5927\u8bed\u8a00\u6a21\u578b\u5fae\u8c03\u7684\u6709\u6548\u65b9\u6cd5\uff0c\u5b83\u901a\u8fc7\u52a8\u6001\u8c03\u6574\u6bcf\u4e2a\u53c2\u6570\u77e9\u9635\u9700\u8981\u8bad\u7ec3\u7684\u79e9\u6765\u63a7\u5236\u8bad\u7ec3\u7684\u53c2\u6570\u603b\u91cf\uff0c\u4ece\u800c\u663e\u8457\u964d\u4f4e\u6a21\u578b\u8bad\u7ec3\u6210\u672c\u5e76\u63d0\u9ad8\u8bad\u7ec3\u901f\u5ea6\u3002\u4ee5\u4e0b\u662fLoRA\u6280\u672f\u5728\u4e0d\u540c\u5927\u8bed\u8a00\u6a21\u578b\u4e2d\u7684\u5e94\u7528\u53ca\u5176\u5177\u4f53\u5b9e\u73b0\u65b9\u5f0f\uff1a<\/p>\n\n\n\n \u3000\u3000LoRA \u5df2\u88ab\u5e7f\u6cdb\u5e94\u7528\u4e8e\u8fd9\u4e9b\u5927\u578b\u8bed\u8a00\u6a21\u578b\u4e2d\uff0c\u901a\u8fc7\u4ec5\u8bad\u7ec3\u5c11\u91cf\u4efb\u52a1\u7279\u5b9a\u53c2\u6570\u6765\u51cf\u5c11\u53c2\u6570\u6570\u91cf\uff0c\u4ece\u800c\u63d0\u9ad8\u90e8\u7f72\u6548\u7387\u3002\u4f8b\u5982\uff0c\u5728 GitHub \u4e0a\u5f00\u6e90\u7684\u5b9e\u73b0\u4e2d\uff0c\u63d0\u4f9b\u4e86 RoBERTa\u3001DeBERTa \u548c GPT-2 \u6a21\u578b\u7684\u5b9e\u73b0\u548c\u6a21\u578b\u68c0\u67e5\u70b9\u3002<\/p>\n\n\n\n \u3000\u3000LoRA \u5728\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\u5982 LLaMA \u548c BLOOM \u7684\u53c2\u6570\u9ad8\u6548\u5fae\u8c03\u4e2d\u5f97\u5230\u4e86\u5e7f\u6cdb\u5e94\u7528\u3002\u4f8b\u5982\uff0cAlpaca-LoRA2 \u662f\u57fa\u4e8e 7B \u53c2\u6570\u7684 LLaMA \u6a21\u578b\u5728 52K \u6761\u5408\u6210\u6570\u636e\u4e0a\u8fdb\u884c LoRA \u5fae\u8c03\u7684\u8f7b\u91cf\u5316\u7248\u672c\u3002\u6b64\u5916\uff0cLoRA \u65b9\u6cd5\u4e5f\u88ab\u7528\u4e8e BLOOM \u6a21\u578b\u7684\u8bad\u7ec3\u4e2d\uff0c\u901a\u8fc7\u51bb\u7ed3\u6a21\u578b\u9aa8\u5e72\u5c42\u5e76\u9002\u5e94\u5c11\u91cf\u53ef\u8bad\u7ec3\u5c42\u6765\u51cf\u5c11\u8bad\u7ec3\u65f6\u95f4\u3002<\/p>\n\n\n\n \u3000\u3000LoRA \u6280\u672f\u4e0d\u4ec5\u9650\u4e8e\u6587\u672c\u6a21\u578b\uff0c\u8fd8\u6269\u5c55\u5230\u4e86\u89c6\u89c9\u5927\u6a21\u578b\u5982 Stable Diffusion \u4e2d\uff0c\u8fdb\u4e00\u6b65\u5c55\u793a\u4e86\u5176\u5728\u591a\u6a21\u6001\u4efb\u52a1\u4e2d\u7684\u6f5c\u529b\u3002<\/p>\n\n\n\n \u3000\u3000\u7814\u7a76\u4eba\u5458\u8fd8\u63d0\u51fa\u4e86\u591a\u79cd LoRA \u7684\u53d8\u4f53\u65b9\u6cd5\uff0c\u5982 AdaLoRA\u3001QLoRA\u3001IncreLoRA \u548c LoRA-FA\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u8fdb\u4e00\u6b65\u6269\u5c55\u4e86 LoRA \u6280\u672f\u7684\u5e94\u7528\u8303\u56f4\u3002\u4f8b\u5982\uff0cQLoRA \u548c LoftQ \u65b9\u6cd5\u5206\u522b\u5728 4 \u4f4d\u4e0a\u5b9e\u73b0\u4e86 64 \u4e2a\u53c2\u6570\uff0c\u5e76\u5177\u6709\u5185\u5b58\u5360\u7528\u4f18\u52bf\u3002<\/p>\n\n\n\n \u3000\u3000\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0cLoRA \u7684\u4ee3\u7801\u5b9e\u73b0\u53ef\u4ee5\u901a\u8fc7\u7ee7\u627f PyTorch \u7684\u7ebf\u6027\u53d8\u6362\u7c7b\u6765\u5b8c\u6210\u3002\u9996\u5148\u52a0\u8f7d PEFT \u6a21\u5757\u76f8\u5173\u63a5\u53e3\uff0c\u5e76\u5b9a\u4e49\u4e00\u4e2a Arguments \u7c7b\u6765\u5b58\u50a8\u8bad\u7ec3\u53c2\u6570\u3002\u7136\u540e\u8bbe\u7f6e LoRA \u76f8\u5173\u7684\u8d85\u53c2\u6570\uff0c\u5305\u62ec\u662f\u5426\u4f7f\u7528 LoRA\u3001LoRA \u7684\u6ce8\u610f\u529b\u7ef4\u5ea6\u548c alpha \u53c2\u6570\u7b49\u3002\u6700\u540e\u5b9e\u4f8b\u5316 LoRAConfig \u7c7b\uff0c\u8bbe\u7f6e\u6a21\u578b\u67b6\u6784\u3001\u4f4e\u79e9\u77e9\u9635\u7684\u7ef4\u6570\u548c\u4e22\u5f03\u7387\u7b49\u53c2\u6570\uff0c\u521d\u59cb\u5316\u6a21\u578b\uff0c\u5e76\u5c06 LoRA \u8bad\u7ec3\u7684\u53c2\u6570\u4e0e\u6a21\u578b\u53c2\u6570\u5408\u5e76\u4fdd\u5b58\u3002<\/p>\n\n\n\n \u3000\u3000LoRA(Low-Rank Adaptation)\u6a21\u578b\u5728\u56fe\u50cf\u751f\u6210\u548c\u6587\u672c\u751f\u6210\u9886\u57df\u6709\u591a\u79cd\u5e94\u7528\u6848\u4f8b\uff0c\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\uff1a<\/p>\n\n\n\n \u3000\u3000LoRA(Low-Rank Adaptation)\u6a21\u578b\u4e0e\u5176\u4ed6\u5fae\u8c03\u6280\u672f(\u5982Fine-tuning)\u76f8\u6bd4\u5177\u6709\u663e\u8457\u7684\u4f18\u52bf\u548c\u52a3\u52bf\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u901a\u8fc7\u5f15\u5165\u4f4e\u79e9\u77e9\u9635\u6765\u51cf\u5c11\u9700\u8981\u66f4\u65b0\u7684\u53c2\u6570\u6570\u91cf\uff0c\u4ece\u800c\u663e\u8457\u964d\u4f4e\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u8ba1\u7b97\u548c\u5185\u5b58\u9700\u6c42\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ea\u9700\u66f4\u65b0\u5c11\u91cf\u53c2\u6570\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u6a21\u578b\u7684\u6240\u6709\u53c2\u6570\uff0c\u56e0\u6b64\u5728\u6709\u9650\u7684\u8ba1\u7b97\u8d44\u6e90\u4e0b\u53ef\u4ee5\u6709\u6548\u5730\u8fdb\u884c\u5927\u6a21\u578b\u7684\u5fae\u8c03\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u80fd\u591f\u5728\u4fdd\u6301\u9884\u8bad\u7ec3\u6a21\u578b\u5927\u90e8\u5206\u6743\u91cd\u4e0d\u53d8\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u4f4e\u79e9\u8fd1\u4f3c\u5bf9\u90e8\u5206\u6743\u91cd\u77e9\u9635\u8fdb\u884c\u66f4\u65b0\uff0c\u5b9e\u73b0\u5bf9\u76ee\u6807\u4efb\u52a1\u7684\u5feb\u901f\u9002\u5e94\u3002\u8fd9\u4f7f\u5f97LoRA\u5728\u5904\u7406\u5c0f\u6570\u636e\u96c6\u6216\u591a\u4e2a\u4efb\u52a1\u65f6\u8868\u73b0\u51fa\u8272\uff0c\u5e76\u4e14\u80fd\u591f\u66f4\u7cbe\u51c6\u5730\u8c03\u6574\u6a21\u578b\u7684\u884c\u4e3a\u3002<\/p>\n\n\n\n \u3000\u3000\u521d\u6b65\u5b9e\u9a8c\u8868\u660e\uff0cLoRA\u53ef\u4ee5\u5728\u4e0d\u727a\u7272\u6027\u80fd\u7684\u60c5\u51b5\u4e0b\uff0c\u5b9e\u73b0\u4e0e\u4f20\u7edf\u5168\u53c2\u6570\u5fae\u8c03\u76f8\u5f53\u751a\u81f3\u66f4\u597d\u7684\u6548\u679c\uff0c\u7279\u522b\u662f\u5728\u5904\u7406\u8f83\u5c0f\u6570\u636e\u96c6\u65f6\u3002\u6b64\u5916\uff0cLoRA\u8fd8\u53ef\u4ee5\u901a\u8fc7\u52a8\u6001\u8c03\u6574\u4f4e\u79e9\u77e9\u9635\u7684\u5927\u5c0f\u6765\u6269\u5c55\u5230\u66f4\u5927\u7684\u6a21\u578b\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u6a21\u5757\u589e\u5f3a\u4e86\u6a21\u578b\u7684\u8fd1\u57df\u5916(near-OOD)\u68c0\u6d4b\u80fd\u529b\uff0c\u4f7f\u5176\u80fd\u591f\u66f4\u597d\u5730\u76d1\u63a7\u6a21\u578b\u662f\u5426\u88ab\u7528\u4e8e\u9884\u671f\u4efb\u52a1\uff0c\u5e76\u5728\u9884\u6d4b\u4e0d\u786e\u5b9a\u6027\u8fc7\u9ad8\u65f6\u505c\u6b62\u6a21\u578b\u8fd0\u884c\u3002<\/p>\n\n\n\n \u3000\u3000\u5c3d\u7ba1LoRA\u5728\u8ba1\u7b97\u548c\u5185\u5b58\u6548\u7387\u65b9\u9762\u6709\u4f18\u52bf\uff0c\u4f46\u5176\u8bad\u7ec3\u6536\u655b\u901f\u5ea6\u901a\u5e38\u6bd4\u5168\u91cf\u5fae\u8c03\u6162\u3002\u8fd9\u610f\u5473\u7740\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cLoRA\u53ef\u80fd\u9700\u8981\u66f4\u957f\u7684\u65f6\u95f4\u624d\u80fd\u8fbe\u5230\u7406\u60f3\u7684\u6027\u80fd\u6c34\u5e73\u3002<\/p>\n\n\n\n \u3000\u3000\u5b9e\u8df5\u7ed3\u679c\u8868\u660e\uff0cLoRA\u5fae\u8c03\u7684\u6d4b\u8bd5\u6027\u80fd\u901a\u5e38\u4e0d\u5982\u5168\u91cf\u5fae\u8c03\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8eLoRA\u53ea\u66f4\u65b0\u4e86\u90e8\u5206\u53c2\u6570\uff0c\u5bfc\u81f4\u6a21\u578b\u5728\u67d0\u4e9b\u4efb\u52a1\u4e0a\u7684\u8868\u73b0\u4e0d\u5982\u5168\u91cf\u5fae\u8c03\u90a3\u6837\u5168\u9762\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u7684\u6027\u80fd\u53d7\u5176\u521d\u59cb\u5316\u65b9\u6cd5\u7684\u5f71\u54cd\u8f83\u5927\u3002\u4e0d\u6070\u5f53\u7684\u521d\u59cb\u5316\u53ef\u80fd\u5bfc\u81f4\u8bad\u7ec3\u6548\u7387\u4f4e\u4e0b\u548c\u6027\u80fd\u4e0d\u4f73\u3002\u7136\u800c\uff0c\u901a\u8fc7\u6539\u8fdb\u521d\u59cb\u5316\u65b9\u6cd5(\u5982LoRA-GA)\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8LoRA\u7684\u8bad\u7ec3\u6536\u655b\u901f\u5ea6\u548c\u6027\u80fd\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u4f5c\u4e3a\u4e00\u79cd\u9ad8\u6548\u7684\u5fae\u8c03\u6280\u672f\uff0c\u5728\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\u7684\u60c5\u51b5\u4e0b\u63d0\u4f9b\u4e86\u663e\u8457\u7684\u4f18\u52bf\uff0c\u4f46\u5728\u67d0\u4e9b\u65b9\u9762\u4ecd\u5b58\u5728\u4e0d\u8db3\u3002<\/p>\n\n\n\n \u3000\u3000LoRA(Low-Rank Adaptation)\u6a21\u578b\u4f5c\u4e3a\u4e00\u79cd\u9ad8\u6548\u7684\u5fae\u8c03\u6280\u672f\uff0c\u8fd1\u5e74\u6765\u5728\u5927\u578b\u8bed\u8a00\u6a21\u578b(LLM)\u7684\u9002\u5e94\u6027\u4f18\u5316\u4e2d\u53d6\u5f97\u4e86\u663e\u8457\u8fdb\u5c55\u3002\u4ee5\u4e0b\u662fLoRA\u6a21\u578b\u7684\u6700\u65b0\u7814\u7a76\u8fdb\u5c55\u548c\u672a\u6765\u53d1\u5c55\u65b9\u5411\u7684\u8be6\u7ec6\u5206\u6790\uff1a<\/p>\n\n\n\n \u3000\u3000LoRA\u901a\u8fc7\u4f4e\u79e9\u5206\u89e3\u7b97\u6cd5\uff0c\u663e\u8457\u51cf\u5c11\u4e86\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u9700\u8981\u8c03\u6574\u7684\u53c2\u6570\u6570\u91cf\uff0c\u4ece\u800c\u63d0\u9ad8\u4e86\u8ba1\u7b97\u6548\u7387\u548c\u6a21\u578b\u6027\u80fd\u3002\u4f8b\u5982\uff0cQLoRA\u63d0\u51fa\u4e86\u4e00\u79cd\u65b0\u7684\u91cf\u5316\u65b9\u6cd5\u6765\u51cf\u5c11LLM\u5728LoRA fine-tuning\u671f\u95f4\u7684\u5185\u5b58\u6d88\u8017\u3002<\/p>\n\n\n\n \u3000\u3000\u7814\u7a76\u4eba\u5458\u6b63\u5728\u63a2\u7d22\u5c06LoRA\u4e0e\u5176\u4ed6\u6a21\u578b\u538b\u7f29\u6280\u672f\u76f8\u7ed3\u5408\uff0c\u4ee5\u5b9e\u73b0\u66f4\u9ad8\u6548\u7684\u6a21\u578b\u538b\u7f29\u3002\u8fd9\u4e0d\u4ec5\u6709\u52a9\u4e8e\u51cf\u5c11\u6a21\u578b\u5927\u5c0f\uff0c\u8fd8\u80fd\u964d\u4f4e\u90e8\u7f72\u6210\u672c\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u7684\u5e94\u7528\u8303\u56f4\u6b63\u5728\u6269\u5c55\u5230\u591a\u6a21\u6001\u5b66\u4e60\u9886\u57df\uff0c\u5305\u62ec\u56fe\u50cf\u3001\u6587\u672c\u548c\u8bed\u97f3\u7b49\u4e0d\u540c\u7c7b\u578b\u7684\u8f93\u5165\u6570\u636e\u3002\u8fd9\u4e00\u65b9\u5411\u7684\u7814\u7a76\u65e8\u5728\u63d0\u9ad8\u6a21\u578b\u5728\u591a\u79cd\u4efb\u52a1\u4e2d\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n \u3000\u3000\u5f00\u53d1\u7b97\u6cd5\u81ea\u52a8\u786e\u5b9a\u6700\u4f18\u7684\u4f4e\u79e9\u77e9\u9635\u5927\u5c0f\u662f\u5f53\u524d\u7684\u4e00\u4e2a\u91cd\u8981\u7814\u7a76\u65b9\u5411\u3002\u8fd9\u5c06\u6709\u52a9\u4e8e\u8fdb\u4e00\u6b65\u63d0\u5347LoRA\u7684\u7075\u6d3b\u6027\u548c\u9002\u5e94\u6027\u3002<\/p>\n\n\n\n \u3000\u3000\u5229\u7528LoRA\u5b9e\u73b0\u9ad8\u6548\u7684\u591a\u4efb\u52a1\u5b66\u4e60\u4e5f\u662f\u672a\u6765\u7684\u4e00\u4e2a\u91cd\u8981\u7814\u7a76\u65b9\u5411\u3002\u901a\u8fc7\u5728\u591a\u4e2a\u4efb\u52a1\u4e0a\u5171\u4eab\u4f4e\u79e9\u77e9\u9635\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\u548c\u6548\u7387\u3002<\/p>\n\n\n\n \u3000\u3000\u7814\u7a76\u4eba\u5458\u6b63\u5728\u63a2\u7d22LoRA\u4e0e\u5176\u4ed6\u9ad8\u6548\u5fae\u8c03\u6280\u672f(\u5982Prompt-tuning)\u7684\u7ed3\u5408\u65b9\u5f0f\uff0c\u4ee5\u671f\u8fdb\u4e00\u6b65\u63d0\u5347\u6a21\u578b\u7684\u9002\u5e94\u6027\u548c\u6027\u80fd\u3002<\/p>\n\n\n\n \u3000\u3000\u76ee\u524dLoRA\u4e3b\u8981\u5e94\u7528\u4e8eTransformer\u67b6\u6784\uff0c\u672a\u6765\u7684\u7814\u7a76\u5c06\u63a2\u7d22\u5982\u4f55\u5c06\u5176\u6269\u5c55\u5230\u5176\u4ed6\u7c7b\u578b\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u5982\u5377\u79ef\u795e\u7ecf\u7f51\u7edc(CNN)\u548c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc(RNN)\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u7684\u601d\u60f3\u53ef\u80fd\u542f\u53d1\u65b0\u7684\u6a21\u578b\u8bbe\u8ba1\u8303\u5f0f\u3002\u7814\u7a76\u4eba\u5458\u6b63\u5728\u63a2\u7d22\u5982\u4f55\u5728\u9884\u8bad\u7ec3\u9636\u6bb5\u5c31\u8003\u8651\u5230\u540e\u7eed\u7684\u9ad8\u6548\u9002\u5e94\uff0c\u4ece\u800c\u8bbe\u8ba1\u51fa\u66f4\u5177\u9002\u5e94\u6027\u7684\u6a21\u578b\u3002<\/p>\n\n\n\n \u3000\u3000\u5b9e\u73b0LoRA\u7684\u96c6\u7ea6\u5316\u9ad8\u6027\u80fd\u63a8\u7406\u90e8\u7f72\u662f\u4e00\u79cd\u6709\u6548\u7684\u6574\u5408\u8d44\u6e90\u3001\u964d\u4f4e\u90e8\u7f72\u6210\u672c\u7684\u65b9\u5f0f\u3002\u7ed3\u5408\u7ec6\u7c92\u5ea6\u7b97\u5b50\u878d\u5408\u4f18\u5316\u3001\u5206\u6bb5LoRAGEMM\u8ba1\u7b97\u3001\u591a\u6d41\u5f02\u6b65\u63a8\u7406\u3001\u91cf\u5316\u63a8\u7406\u7b49\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728\u6027\u80fd\u548c\u663e\u5b58\u5360\u7528\u65b9\u9762\u5b9e\u73b0\u6700\u4f18\u3002<\/p>\n\n\n\n \u3000\u3000\u5c3d\u7ba1LoRA\u5728\u8ba1\u7b97\u6548\u7387\u4e0a\u5177\u6709\u4f18\u52bf\uff0c\u4f46\u5176\u4f4e\u79e9\u5206\u89e3\u4ecd\u9700\u8981\u8f83\u5927\u7684\u8ba1\u7b97\u8d44\u6e90\uff0c\u5bf9\u786c\u4ef6\u8981\u6c42\u8f83\u9ad8\u3002\u6b64\u5916\uff0c\u4f4e\u79e9\u5206\u89e3\u53ef\u80fd\u5bfc\u81f4\u6a21\u578b\u7684\u53ef\u89e3\u91ca\u6027\u548c\u5b89\u5168\u6027\u964d\u4f4e\uff0c\u8fd9\u4e9b\u6311\u6218\u9700\u8981\u5728\u672a\u6765\u7684\u7814\u7a76\u4e2d\u52a0\u4ee5\u89e3\u51b3\u3002<\/p>\n\n\n\n \u3000\u3000LoRA\u4f5c\u4e3a\u4e00\u79cd\u521b\u65b0\u7684\u6280\u672f\uff0c\u5728\u63d0\u9ad8\u5927\u578b\u8bed\u8a00\u6a21\u578b\u9002\u5e94\u6027\u548c\u6548\u7387\u65b9\u9762\u5c55\u73b0\u4e86\u5de8\u5927\u7684\u6f5c\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" LoRA(Low-Rank Adaptation of Large Language Models)\u662f\u4e00\u79cd\u7531\u5fae\u8f6f\u7814\u7a76\u4eba\u5458\u5f00\u53d1\u7684\u6280\u672f\uff0c\u65e8\u5728\u89e3\u51b3\u5927\u8bed\u8a00\u6a21\u578b\u5fae\u8c03\u7684\u95ee\u9898\u3002LoRA\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5728\u9884\u8bad\u7ec3\u6a21\u578b\u7684\u57fa\u7840<\/p>\n","protected":false},"author":1,"featured_media":98952,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[54],"class_list":["post-99271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-l-2"],"_links":{"self":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts\/99271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/comments?post=99271"}],"version-history":[{"count":0,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/posts\/99271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/media\/98952"}],"wp:attachment":[{"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/media?parent=99271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/categories?post=99271"},{"taxonomy":"post_tag","embeddable":true,"href":"\/\/www.viralrail.com\/wp-json\/wp\/v2\/tags?post=99271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\u3000\u3000\u4e00\u3001 LoRA\u6a21\u578b\u7684\u5177\u4f53\u5b9e\u73b0\u539f\u7406\u662f\u4ec0\u4e48?<\/h2>\n\n\n\n
\n
\u3000\u3000\u4e8c\u3001 \u5982\u4f55\u5728\u4e0d\u540c\u7684\u5927\u8bed\u8a00\u6a21\u578b\u4e2d\u5e94\u7528LoRA\u6280\u672f?<\/h2>\n\n\n\n
\u3000\u3000\u4e09\u3001 LoRA\u6a21\u578b\u5728\u56fe\u50cf\u751f\u6210\u548c\u6587\u672c\u751f\u6210\u9886\u57df\u7684\u5e94\u7528\u6848\u4f8b\u6709\u54ea\u4e9b?<\/h2>\n\n\n\n
\u3000\u30001. \u56fe\u50cf\u751f\u6210<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\u3000\u30002. \u6587\u672c\u751f\u6210<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\u3000\u30003. \u7efc\u5408\u5e94\u7528<\/strong>\uff1a<\/h3>\n\n\n\n
\n
\u3000\u3000\u56db\u3001 LoRA\u6a21\u578b\u4e0e\u5176\u4ed6\u5fae\u8c03\u6280\u672f(\u5982Fine-tuning)\u76f8\u6bd4\u6709\u54ea\u4e9b\u4f18\u52bf\u548c\u52a3\u52bf?<\/h2>\n\n\n\n
\u3000\u30001. \u4f18\u52bf\uff1a<\/h3>\n\n\n\n
\u3000\u30002. \u52a3\u52bf\uff1a<\/h3>\n\n\n\n
\u3000\u3000\u4e94\u3001 LoRA\u6a21\u578b\u7684\u6700\u65b0\u7814\u7a76\u8fdb\u5c55\u548c\u672a\u6765\u53d1\u5c55\u65b9\u5411\u662f\u4ec0\u4e48?<\/h2>\n\n\n\n
\u3000\u30001. \u6700\u65b0\u7814\u7a76\u8fdb\u5c55<\/h3>\n\n\n\n
\u3000\u30002. \u672a\u6765\u53d1\u5c55\u65b9\u5411<\/h3>\n\n\n\n